torch-mlir/examples
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
..
lazytensor Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00
torchfx Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00
utils Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00
__init__.py Remove frontends/pytorch directory. 2021-09-17 09:27:49 -07:00
lazytensor_tanh.py Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
resnet_inference.ipynb Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
torchfx_add_tanh_sigmoid.py Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00
torchscript_resnet18_e2e.py Add a basic TOSA E2E backend. 2021-10-08 09:59:45 -07:00