mirror of https://github.com/llvm/torch-mlir
5253282c55
As of https://github.com/pytorch/pytorch/pull/118969, `ExportedProgram` has the long awaited fixes to correctly categorize various things relating to parameters, buffers, mutated inputs and constants. With this additional modeling, we are finally able to implement (safely/soundly) the mutable semantics that were attempted on the TorchScript path. The difference is that on that path, we had to conservatively treat everything as mutable and run some dodgy heuristics (which have been the cause of many bugs relating to "MaximizeValueSemantics") to try to get back to an immutable state. The new model supports mutability at the graph edges, allowing both user inputs and buffers to be mutated (there is some more support than that, but that is all I fully tracked through to implementation). Therefore, when we receive programs like this, we now can selectively enable mutation at the edges. This happens to be the mutability model that IREE supports, which I expect to be a primary beneficiary. However, there is nothing stopping anyone else from handling the `!torch.tensor` types and the existing copy/overwrite ops that will be selectively added. Since this relies on API changes that will not release until 2.3, I'm being a bit cautious about not refactoring existing facilities. |
||
---|---|---|
.. | ||
_mlir_libs | ||
dialects | ||
extras | ||
tools/import_onnx | ||
fx.py |