AMD AI Compiler Engineer Lands A Generic MLIR To SPIR-V Pass In LLVM 19
Merged on Friday to LLVM 19 Git is a generic MLIR to SPIR-V pass for lowering the Multi-Level Intermediate Representation down into SPIR-V as the intermediate representation consumed by OpenGL / OpenCL / Vulkan drivers.
This generic MLIR to SPIR-V pass for LLVM is intended to yield better coverage of upstream compilation to SPIR-V and enables writing simple kernels by hand. The MLIR hybrid IR continues seeing much industry interest and adoption for this intermediate representation. AMD and others have worked on MLIR to SPIR-V conversion while now there is a generic upstream pass within LLVM. Once capable enough, MLIR to SPIR-V can open up some interesting possibilities around Vulkan compute and machine learning.
Angel Zhang of AMD who is currently serving as an AI compiler engineer submitted this generic MLIR to SPIR-V pass for upstream:
Future plans call for adding conversion patterns for other dialects like GPU and tensor, among other improvements.
It will be interesting to see where this upstream MLIR to SPIR-V work leads.
This generic MLIR to SPIR-V pass for LLVM is intended to yield better coverage of upstream compilation to SPIR-V and enables writing simple kernels by hand. The MLIR hybrid IR continues seeing much industry interest and adoption for this intermediate representation. AMD and others have worked on MLIR to SPIR-V conversion while now there is a generic upstream pass within LLVM. Once capable enough, MLIR to SPIR-V can open up some interesting possibilities around Vulkan compute and machine learning.
Angel Zhang of AMD who is currently serving as an AI compiler engineer submitted this generic MLIR to SPIR-V pass for upstream:
"This PR implements a MVP version of an MLIR lowering pipeline to SPIR-V. The goal of adding this pipeline is to have a better test coverage of SPIR-V compilation upstream, and enable writing simple kernels by hand. The dialects supported in this version include arith, vector (only 1-D vectors with size 2,3,4,8 or 16), scf, ub, index, func and math. New test cases for the pass are also included in this PR."
Future plans call for adding conversion patterns for other dialects like GPU and tensor, among other improvements.
It will be interesting to see where this upstream MLIR to SPIR-V work leads.
8 Comments