torch-mlir/lib/Conversion
Sean Silva 0c5c84d63d Add a basic TOSA E2E backend.
We lower through linalg-on-tensors and use RefBackend to run it.
This adds enough support for a "tanh" op. Adding more ops should be
fairly mechanical now that things are wired up. Run with:
```
./tools/torchscript_e2e_test.sh -c tosa
```

The backend structure is very similar to linalg-on-tensors based E2E
backends and is a nice parallel (see `tosa_backend.py`). Actually, this
forced a nice refactoring to the layering here. We removed
`torchscript-module-to-linalg-on-tensors-backend-pipeline` and instead
require separately running
```
torchscript-function-to-torch-backend-pipeline,torch-backend-to-linalg-on-tensors-backend-pipeline
```
This highlights the step that lowers to the "torch backend contract"
of cleaned up `torch` dialect ops is a critical step in the lowering.
Going forward, that is the key load-bearing contract of the torch-mlir
project, not the linalg-on-tensors backend contract.

Recommended review order:
- `TorchToTosa.cpp` / `TorchToTosa/basic.mlir`
- `python/torch_mlir_e2e_test/torchscript/configs/tosa_backend.py` and
  the new `utils.py` file there.
- `python/torch_mlir_e2e_test/tosa_backends/linalg_on_tensors.py` and
  `abc.py` in that directory for the TOSA backend e2e interface.
- other misc mechanical changes
2021-10-08 09:59:45 -07:00
..
TorchToLinalg Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
TorchToSCF Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
TorchToStd Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
TorchToTosa Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
CMakeLists.txt Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
PassDetail.h Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00
Passes.cpp Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00