- [mlir][spirv] Update dependencies for #100138
- [mlir][spirv] Support vector.step in vector to spirv conversion
- Address comments
- Build dependencies
- CI jobs
- Add a one workgroup argmax benchmark
- Address comments
- [mlir][spirv] Add tests for scf.while and scf.for in convert-to-spirv pass
- Address comments
This PR implements a MVP version of an MLIR lowering pipeline to SPIR-V. The goal 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
.
Relevant links:
Future plans:
- Add conversion patterns for other dialects, e.g.
gpu
,tensor
, etc. - Include vector transformation to unroll vectors to 1-D, and handle those with illegal sizes.
- Implement multiple-return. SPIR-V does not support multiple return values since a
spirv.func
can only return zero or one values. It might be possible to wrap the return values in aspirv.struct
.
- Created new pass
- Moved most of the parts from IREE's
ConvertToSPIRVPass
Upstream unrolling patterns + canonicalization
- Vectorizing
tensor.pad
- Apply vectorization to generate vectors of the original tensor shape for
tensor.pad
ops. - https://github.com/iree-org/iree/blob/main/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVInitialVectorLowering.cpp#L306
- Apply vectorization to generate vectors of the original tensor shape for
- A generic pass to convert to LLVM, using the
ConvertToLLVMPatternInterface
to delegate to dialects the injection of conversion patterns