torch-mlir/lib/Dialect/TorchConversion/Transforms
Sean Silva a5fe0cf063 Introduce new shape library design.
See the documentation in `docs/shape_lib.md` and
`docs/adding_a_shape_function.md` for an overview of the system.

This completely overhauls how we represent shape functions. In
particular, RefineTypes does not infer shapes anymore (only dtypes).
Shape functions are now written in (TorchScript'able) Python.

Recommended review order:

1. Read `docs/shape_lib.md` and `docs/adding_a_shape_function.md`.
1. Code and tests for ReifyShapeCalculations, DropShapeCalculations.
1. Code and tests for SimplifyShapeCalculations.
1. shape_lib_gen.py
1. Code and tests for new RefineTypes pass.
1. Random folders/canonicalizers in TorchOps.cpp and associated test in
   `canonicalize.mlir`.
1. New ReadOnly trait inferred from the registry.
1. Any miscellaneous remaining stuff.

Example `-print-ir-after-all` for ElementwiseUnaryModule:
[IR lowering dump](https://gist.github.com/silvasean/e4dc8cbc8d00aac7819602e3cbd8e212).

Example `-print-ir-after-all` for ElementwiseBinaryModule:
[IR lowering dump](https://gist.github.com/silvasean/daf6860ecced732af3568af6b1899113).
2022-03-15 12:41:58 -07:00
..
BackendTypeConversion.cpp [Torch][Linalg] Add basic support for RNG 2022-01-31 18:56:42 -05:00
CMakeLists.txt [MLIR][TORCH] Add TorchToTMTensor pass 2022-03-08 22:52:34 +05:30
PassDetail.h Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00
Passes.cpp [MLIR][TORCH] Add TorchToTMTensor pass 2022-03-08 22:52:34 +05:30
VerifyInvariantsBeforeBackendLowering.cpp Introduce new shape library design. 2022-03-15 12:41:58 -07:00
VerifyLinalgOnTensorsBackendContract.cpp [MLIR][TORCH] Add TorchToTMTensor pass 2022-03-08 22:52:34 +05:30
VerifyTosaBackendContract.cpp * [tosa] Support for AtenPowTensorScalarOp with constant Scalar as input 2022-01-11 22:55:54 -05:00