This is really exciting! Having a fully supported Dynamo path will simplify the Torch-MLIR codebase immensely and it will make the user experience much better.
I have a few questions:
I noticed that Turbine uses the Python-based FX importer from Torch-MLIR with a few changes/fixes. Is the plan to upstream these?
Is there an example of the dynamic shape support? From a quick glance at the importer, it seems that the tensor shapes used when creating the MLIR are obtained from the `shape` property of type `torch.Size` in the `TensorMetadata`. I'm not sure this would result in dynamic shapes in MLIR, since one needs to generate a question mark character for the dynamic dimension.
Is there an example of running Llama e2e? I noticed there is a test for Llama, but it is marked as `expectedFailure`.
Looking forward to future updates,
RamiroOn Thursday, September 7, 2023 at 12:34:20 PM UTC-7 Stella Laurenzo wrote:Hi folks --Over the last couple of months, we've (on the Nod side) have been running an experiment to see if it was a good time to embrace PyTorch 2 as a real frontend to IREE. For a bit of history, IREE started with TensorFlow/TFLite as its primary frontend and then due to organizational affiliation, also moved on to Jax. PyTorch support was always through a bit of an "air gap" from the torch-mlir project and not well integrated. Many of the core devs worked on both, but there were always partitions in the code.We've been working to change this via a new project that we are calling Turbine. Last week, we crossed the threshold to get real HF/LLaMa models working through this path (and we got to a 90% pass rate on the test suite we were tracking), using the native dynamic shapes support that Dynamo provides (and which matches IREE's model). This indicated to us that the experiment is over and we should aim to invest here and make it real.You've already seen some of this emerging from the RFC to Integrate toch-mlir into IREE (now landed), project work on the #mai-tai channel, and IREE Python API enhancements over the last months. With the torch-mlir integration landed, we have been able to drop the custom compiler/runtime build of IREE that was making the project unwieldy: Turbine is now just a pure Python project which bridges to both torch.compile and torch.[_dynamo.]export while also providing a low level iree-jax look-alike programming model for export cases of complicated programs. With the enhancements to both PyTorch and IREE's Python APIs, we have been able to remove the complicated native-code dependencies that dominated prior approaches.This isn't just about rebasing on a new tech: it is an essential step for unlocking some features:
- More efficient handling and optimization of weights, especially for giant models.
- Implementation of more complicated inference techniques which require additional low-level programming of the compiler/runtime.
- Efficient/async, eager execution and memory management on all backends.
- Enhanced integration of training based workflows.
- Tight integration with quantization approaches.
We've had a lively internal thread at Nod for a while on some of this, and we will be moving our conversation to the #pytorch channel on Discord. I wanted to provide this context for what is going on so that people can follow along. It is early work still but proceeding quickly.- Stella
--
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/b2df5ea4-c2f3-4023-8717-c726b4e75275n%40googlegroups.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/499cd093-e8c0-456e-862b-62903d412862n%40googlegroups.com.
Hi Stella et al,
This is an exciting direction indeed!At Cruise we're quite heavily using the TorchScript frontend in Torch-MLIR (at the moment), but also interested in exploring some of the aspects of TorchDynamo (e.g. dynamic shape support, custom op/type support) to better position ourselves for this switchover to the new frontend - is Turbine something we would need to take a dependency on (in addition to or instead of Torch-MLIR)?
Also, could you or Ramiro share some comments on the timeline for deprecating TS support in Torch-MLIR. Even if we do deploy some of our newer workloads using the experimental Dynamo frontend, we might want the legacy TS mode to be alive for most of our existing production use-cases, at least for the foreseeable future. Is that something we can continue to rely on?
Best,SambhavOn Thursday, September 7, 2023 at 3:15:01 PM UTC-7 Sean Silva wrote:Really excited to see this integration reaching the level of polish it deserves! Onward!!-- Sean SilvaOn Thu, Sep 7, 2023 at 12:34 PM Stella Laurenzo <ste...@nod-labs.com> wrote:Hi folks --Over the last couple of months, we've (on the Nod side) have been running an experiment to see if it was a good time to embrace PyTorch 2 as a real frontend to IREE. For a bit of history, IREE started with TensorFlow/TFLite as its primary frontend and then due to organizational affiliation, also moved on to Jax. PyTorch support was always through a bit of an "air gap" from the torch-mlir project and not well integrated. Many of the core devs worked on both, but there were always partitions in the code.We've been working to change this via a new project that we are calling Turbine. Last week, we crossed the threshold to get real HF/LLaMa models working through this path (and we got to a 90% pass rate on the test suite we were tracking), using the native dynamic shapes support that Dynamo provides (and which matches IREE's model). This indicated to us that the experiment is over and we should aim to invest here and make it real.You've already seen some of this emerging from the RFC to Integrate toch-mlir into IREE (now landed), project work on the #mai-tai channel, and IREE Python API enhancements over the last months. With the torch-mlir integration landed, we have been able to drop the custom compiler/runtime build of IREE that was making the project unwieldy: Turbine is now just a pure Python project which bridges to both torch.compile and torch.[_dynamo.]export while also providing a low level iree-jax look-alike programming model for export cases of complicated programs. With the enhancements to both PyTorch and IREE's Python APIs, we have been able to remove the complicated native-code dependencies that dominated prior approaches.This isn't just about rebasing on a new tech: it is an essential step for unlocking some features:
- More efficient handling and optimization of weights, especially for giant models.
- Implementation of more complicated inference techniques which require additional low-level programming of the compiler/runtime.
- Efficient/async, eager execution and memory management on all backends.
- Enhanced integration of training based workflows.
- Tight integration with quantization approaches.
We've had a lively internal thread at Nod for a while on some of this, and we will be moving our conversation to the #pytorch channel on Discord. I wanted to provide this context for what is going on so that people can follow along. It is early work still but proceeding quickly.- Stella--
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/499cd093-e8c0-456e-862b-62903d412862n%40googlegroups.com.
Confidentiality Note: We care about protecting our proprietary information, confidential material, and trade secrets. This message may contain some or all of those things. Cruise will suffer material harm if anyone other than the intended recipient disseminates or takes any action based on this message. If you have received this message (including any attachments) in error, please delete it immediately and notify the sender promptly. --
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/yyLTOXHsEZs/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/5f0a8f60-cb84-45c5-aded-ccef3262383an%40googlegroups.com.