Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is part 1 of 2, which will also include upstreaming the FX importer. I started with ONNX because it forces some project layout updates and is more self contained/easier as a first step.
Deviating somewhat from the RFCs on project layout, I made the following decisions:
onnx_importer.py
intotorch_mlir.extras
as Maks already has opened up that namespace and it seemed to fit. Better to have fewer things at that level.projects/
adding more depending on which features are enabled.TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS=1
mode, it builds atorch-mlir-core
wheel with the pure contents only.onnx_importer.py
andimporter_smoke_test.py
are almost verbatim copies from SHARK-Turbine. I made some minor local alterations to adapt to paths and generalize the way they interact with the outer project. I expect I can copy these back to Turbine verbatim from here. I also updated the license boilerplate (they have the same license but slightly different project norms for the headers) but retained the correct copyright.Other updates:
onnx
package. In a followup once I know everything is stable, I'll add another env var that the CI can set to always enable this so we know conclusively if tests pass.docs/
.TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS
->TORCH_MLIR_ENABLE_PYTORCH_EXTENSIONS
and inverted the sense. Made the JitIR importer and LTC optionscmake_dependent_options
for robustness.