Open MaheshRavishankar opened 7 months ago
Probably unrelated, but I tried something like this in SHARK-Turbine (https://github.com/nod-ai/SHARK-Turbine/issues/101) but hit an error up in Python. Interesting that there are errors at a lower level too. Code was like this:
from iree.compiler.ir import Context
import shark_turbine.aot as aot
import torch
counter_tensor = torch.tensor(0, dtype=torch.int32)
class CounterModule(aot.CompiledModule):
counter = aot.export_global(counter_tensor, mutable=True)
def get_value(self):
return self.counter
# RuntimeError: Calls to exported functions not yet supported
def add_to_value(self, value=aot.abstractify(value_example)):
self.counter = self.get_value() + value
counter_instance = CounterModule(context=Context())
print(aot.CompiledModule.get_mlir_module(counter_instance))
we'll probably want WrapEntryPoints (or a pass nearby) to handle internalizing calls to other exports - since exports get changed to buffer views/etc that creates a lot of junk that we want to avoid when doing intra-module calls
I encountered this error while trying to write some matchers. The core issue isnt important, but here is a link to the gist for the dump after all passes (https://gist.github.com/MaheshRavishankar/8def9d4a658c229410eb94956384ab62).
The failure itself is in
iree-stream-refine-usage
pass. This is the IR before the passThe error is