This is an open-source, online tutorial that provides an end-to-end introduction to MLIR, demonstrating how deep learning models can be lowered from a machine learning framework to executable binaries. Aimed at newcomers and university students, the tutorial focuses on conveying the core concepts of the MLIR compilation flow rather than on performance optimization. Using torch-mlir, upstream MLIR passes, and a custom lowering pass targeting OpenBLAS, the talk illustrates how to build and extend a practical ML compilation pipeline targeting both CPU and NVIDIA GPU backends. The tutorial is designed to lower the barrier to entry and broaden participation in the MLIR community. From a newcomer to other newcomers, so to speak.
The repo provides some PyTorch models (small sample models and real world models) and provides the following:
Additionally, I created a pass that converts linalg.matmul's to OpenBLAS matrix-multiplication function calls. Further, I target an Nvidia GPU (sm_90) to launch specific kenrels on the GPU (This currently only works for sample and the mnist model).
Warning: Some instructions are RWTH cluster specific, e.g. paths.
Appendix: An overview of IREE
See Chapter 2 in the docs.
54 commits
2 commits
C++
45.4%
Python
38.7%
Shell
13.9%
CMake
1.7%
This is an open-source, online tutorial that provides an end-to-end introduction to MLIR, demonstrating how deep learning models can be lowered from a machine learning framework to executable binaries. Aimed at newcomers and university students, the tutorial focuses on conveying the core concepts of the MLIR compilation flow rather than on performance optimization. Using torch-mlir, upstream MLIR passes, and a custom lowering pass targeting OpenBLAS, the talk illustrates how to build and extend a practical ML compilation pipeline targeting both CPU and NVIDIA GPU backends. The tutorial is designed to lower the barrier to entry and broaden participation in the MLIR community. From a newcomer to other newcomers, so to speak.
The repo provides some PyTorch models (small sample models and real world models) and provides the following:
Additionally, I created a pass that converts linalg.matmul's to OpenBLAS matrix-multiplication function calls. Further, I target an Nvidia GPU (sm_90) to launch specific kenrels on the GPU (This currently only works for sample and the mnist model).
Warning: Some instructions are RWTH cluster specific, e.g. paths.
Appendix: An overview of IREE
See Chapter 2 in the docs.
54 commits
2 commits
C++
45.4%
Python
38.7%
Shell
13.9%
CMake
1.7%