torch-mlir/projects/ltc/csrc/base_lazy_backend
Rob Suderman dc37616d67
[torch][quant] Support quantize and dequantize for torch (#2731)
Handle both `torch.dequantize` and `torch.quantize_per_tensor` including
the op based quantization parameter tracking. This includes adding
`qint32` to torch types as it was missing during the initial type
inclusion.

For testing we only have `torch.int8` and `torch.float` types on
function boundaries as the `qint8` types require passing the scale
and zero point quantization information which is not supported yet.
2024-01-12 19:11:14 -08:00
..
ops Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
utils Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
CMakeLists.txt Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
README.md Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
backend_impl.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
backend_impl.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
dynamic_ir.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
dynamic_ir.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
ir_builder.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_lowering_context.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_lowering_context.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_native_functions.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_node.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_node.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_node_lowering.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
mlir_node_lowering.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
shape_inference.cpp [torch][quant] Support quantize and dequantize for torch (#2731) 2024-01-12 19:11:14 -08:00
tensor.cpp Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00
tensor.h Breakup python pytorch deps (#2582) 2023-11-19 12:10:19 -08:00

README.md

Torch-MLIR Lazy Tensor Core Backend

Detailed Documentation

Detailed documentation about the architecture of this LTC backend is available here.

Summary

Contained within this directory are the components that implements the Torch-MLIR LTC backend. Note that the code style for LTC components is consistent with that of LTC itself, rather than the rest of Torch-MLIR.

The components are subclasses of the backend API interface classes found under torch/csrc/lazy/backend.

Importantly, the subclasses are still abstract classes. Pure virtual methods such as Compile were purposefully not overridden as Torch-MLIR does not know how to compile the model for the target hardware.

The intent is that vendor hardware specific plugins will subclass the Torch-MLIR backend classes and override the remaining pure virtual functions to complete the backend.

The Torch-MLIR LTC backend's job is to perform the lowering from ATen to MLIR. A hardware vendor's backend job is to take care of the actual compile and execution of the lowered MLIR.