torch-mlir/build_tools
Stella Laurenzo 74f7a0c9d6
Upstream the ONNX importer. (#2636)
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:

* Locating the `onnx_importer.py` into `torch_mlir.extras` as Maks
already has opened up that namespace and it seemed to fit. Better to
have fewer things at that level.
* Setup the build so that the root project only contains MLIR Python and
pure Python deps (like the importers), but this can be augmented with
the `projects/` adding more depending on which features are enabled.
* The default build continues to build everything whereas in
`TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS=1` mode, it builds a
`torch-mlir-core` wheel with the pure contents only.

`onnx_importer.py` and `importer_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:

* Added the ONNX importer unit test (which also can generate test data)
in lit, conditioned on the availability of the Python `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.
* Moved the ONNX conversion readme to `docs/`.
* Renamed CMake option `TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS` ->
`TORCH_MLIR_ENABLE_PYTORCH_EXTENSIONS` and inverted the sense. Made the
JitIR importer and LTC options `cmake_dependent_options` for robustness.
2023-12-12 19:02:51 -08:00
..
cmake Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
docker Dockerize CI + Release builds (#1234) 2022-08-30 11:07:25 -07:00
python_deploy Upstream the ONNX importer. (#2636) 2023-12-12 19:02:51 -08:00
autogen_ltc_backend.py Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
autogen_ltc_backend.yaml [LTC] Support torch.ones/zeros/arange ops (#2440) 2023-09-21 13:25:14 -04:00
build_libtorch.sh Fix typos in comments (#2539) 2023-10-31 20:10:47 -07:00
build_python_wheels.sh build: improve robustness of cmake and shell scripts (#1018) 2022-07-06 14:39:30 -07:00
build_standalone.sh Re-organize project structure to separate PyTorch dependencies from core project. (#2542) 2023-11-02 19:45:55 -07:00
scrape_releases.py Create github action for creating pip-compatible releases index 2022-09-23 15:26:19 -04:00
update_abstract_interp_lib.sh Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
update_torch_ods.sh Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
write_env_file.sh Update out of date docs (#2602) 2023-12-01 16:29:37 -06:00