--
You received this message because you are subscribed to the Google Groups "iree-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iree-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iree-discuss/9d9216e2-10e4-4675-93af-f95f9864b3een%40googlegroups.com.
The question would be what it lowers to. In the work I’ve done, we’ve typically done that in a different way, but if you’re coming from the stablehlo ecosystem, it makes some sense to use the programming model it has for that kind of comms.
If it were me trying to map this to IREE, I would lower it to a call into a VM module. Then you provide an implementation of the module at runtime or in the tools to do whatever I/O is called for. When I’ve done this in the past, I’ve often just implemented the prototype module in Python for testing (example: https://github.com/iree-org/iree/tree/main/samples/py_custom_module), but it isn’t very hard to write one in C (and then you just pass the SO to the runtime to load it and bind dynamically).
If going that route, you would add a pass to the stablehlo input pipeline which lowers the infeed/outfeed ops to util.calls of declared util.func functions like `stablehlo_rt.infeed` and `stablehlo_rt.outfeed`. Then the runtime will late band those to a `stablehlo_rt` module. If there are any of those extern declarations in the module (i.e. as a result of any surviving calls to them), then the runtime would require the module to be present. In this way, the compiler transforms just need to decide on the stub that represents the functionality.
There’s various advanced things that can be done from there, especially with respect to concurrency, but that’s the basic idea.
To view this discussion on the web visit https://groups.google.com/d/msgid/iree-discuss/8ee79ef3-ff38-41f9-b258-bcb1214a48f0n%40googlegroups.com.
If it were me trying to map this to IREE, I would lower it to a call into a VM module. Then you provide an implementation of the module at runtime or in the tools to do whatever I/O is called for.
I wonder if this is a good way to solve the problem generally? IREE could automatically lower the operation but I would be required to pass a VM module that it would invoke? So there is less plumbing required from the developer side.
--
You received this message because you are subscribed to a topic in the Google Groups "iree-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iree-discuss/f21s2LvE5nI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iree-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iree-discuss/CAH8pnHbLTEnPKAjQOBwPXB7DLiGyZ%3DpQseUCY3qhGbRAmUi0RA%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "iree-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iree-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iree-discuss/CAGnRm4LXi8Rzq5ggMsKU4KrY%2Bo9rXXwTzjWCvv%3DoTxB3ij848g%40mail.gmail.com.