AMD's Unified AI Software Stack Might Be A Boon For Other Vulkan/SPIR-V Hardware Too
([AMD] 5 Hours Ago
Unified AI Software Stack + SPIR-V)
- Reference: 0001481211
- News link: https://www.phoronix.com/news/Unified-AI-Software-MLIR-SPIR-V
- Source link:
Earlier this month AMD talked more about [1]their Unified AI Software Stack plans for debuting in the coming months to provide a unified software view where AI work can be seamlessly offloaded to Ryzen processors, AMD graphics, or AMD Ryzen AI NPU hardware. Another possible and exciting prospect came to mind when going through [2]the LLVM/Clang 19 changes this week.
As talked about in the prior article on the AMD Unified AI Software Stack, the center piece of it is using LLVM's MLIR intermediate representation before this unified software decides which device to offload the AI work to. It makes sense given the robust capabilities of MLIR, it being more suited for AI than other IRs, [3]their acquired MLIR talent , etc.
AMD has talked up this Unified AI Software Stack just in the context of AMD's different hardware devices. But then what struck me this week was remembering that for LLVM/Clang 19 an AMD AI compiler engineer [4]began landing a generic MLIR to SPIR-V pass . That member of AMD's AI compiler team began upstreaming work to allow converting the Multi-Level Intermediate Representation into SPIR-V, as the IR that can be consumed by Vulkan drivers along with modern OpenGL and OpenCL drivers.
There has been continued work since on the generic "convert-to-spirv" pass for MLIR. Just yesterday for example was a merge request opened for LLVM to [5]support vector unrolling with the pass. And again it comes from an AMD AI compiler engineer.
It remains to be seen if this MLIR to SPIR-V pass being worked on by AMD AI compiler engineers is indeed for the Unified AI Software Stack, but the timing is interesting and it would fit rather well with AMD's "unified" software plans. Once this pass is full-featured enough, in theory the generic MLIR-to-SPIR-V pass could be used for targeting other Vulkan and OpenCL/OpenGL supported graphics cards / devices. SPIR-V is a common IR and not specific to AMD. So if this convert-to-spirv pass becomes viable enough, it could potentially open the door to the AMD Unified AI Software Stack working for other non-AMD GPUs. This would be convenient if it becomes a reality but there may be some limitations around other AI support libraries and the like making up the rest of AMD's AI compute stack.
This might also be useful in cases of Radeon GPUs of having their Vulkan/SPIR-V support but not having ROCm compute libraries installed or available to instead go through SPIR-V. There's also routes to [6]execute SPIR-V on the CPU and other possibilities once the MLIR is transitioned to the Khronos Group backed IR.
In any event after the recent Unified AI Software Stack talk from the AMD Tech Day and then remembering AMD AI compiler engineers have recently been working on the generic MLIR to SPIR-V pass for upstream LLVM, very interesting and innovative software times for AMD may be ahead.
[1] https://www.phoronix.com/news/AMD-Unified-AI-Software-Stack
[2] https://www.phoronix.com/news/LLVM-Clang-19-Feature-Freeze
[3] https://www.phoronix.com/news/AMD-Nod.ai-Completes
[4] https://www.phoronix.com/news/LLVM-19-MLIR-To-SPIR-V
[5] https://github.com/llvm/llvm-project/pull/100138
[6] https://www.phoronix.com/news/LLVM-MLIR-SPIR-V-CPU-Runner
As talked about in the prior article on the AMD Unified AI Software Stack, the center piece of it is using LLVM's MLIR intermediate representation before this unified software decides which device to offload the AI work to. It makes sense given the robust capabilities of MLIR, it being more suited for AI than other IRs, [3]their acquired MLIR talent , etc.
AMD has talked up this Unified AI Software Stack just in the context of AMD's different hardware devices. But then what struck me this week was remembering that for LLVM/Clang 19 an AMD AI compiler engineer [4]began landing a generic MLIR to SPIR-V pass . That member of AMD's AI compiler team began upstreaming work to allow converting the Multi-Level Intermediate Representation into SPIR-V, as the IR that can be consumed by Vulkan drivers along with modern OpenGL and OpenCL drivers.
There has been continued work since on the generic "convert-to-spirv" pass for MLIR. Just yesterday for example was a merge request opened for LLVM to [5]support vector unrolling with the pass. And again it comes from an AMD AI compiler engineer.
It remains to be seen if this MLIR to SPIR-V pass being worked on by AMD AI compiler engineers is indeed for the Unified AI Software Stack, but the timing is interesting and it would fit rather well with AMD's "unified" software plans. Once this pass is full-featured enough, in theory the generic MLIR-to-SPIR-V pass could be used for targeting other Vulkan and OpenCL/OpenGL supported graphics cards / devices. SPIR-V is a common IR and not specific to AMD. So if this convert-to-spirv pass becomes viable enough, it could potentially open the door to the AMD Unified AI Software Stack working for other non-AMD GPUs. This would be convenient if it becomes a reality but there may be some limitations around other AI support libraries and the like making up the rest of AMD's AI compute stack.
This might also be useful in cases of Radeon GPUs of having their Vulkan/SPIR-V support but not having ROCm compute libraries installed or available to instead go through SPIR-V. There's also routes to [6]execute SPIR-V on the CPU and other possibilities once the MLIR is transitioned to the Khronos Group backed IR.
In any event after the recent Unified AI Software Stack talk from the AMD Tech Day and then remembering AMD AI compiler engineers have recently been working on the generic MLIR to SPIR-V pass for upstream LLVM, very interesting and innovative software times for AMD may be ahead.
[1] https://www.phoronix.com/news/AMD-Unified-AI-Software-Stack
[2] https://www.phoronix.com/news/LLVM-Clang-19-Feature-Freeze
[3] https://www.phoronix.com/news/AMD-Nod.ai-Completes
[4] https://www.phoronix.com/news/LLVM-19-MLIR-To-SPIR-V
[5] https://github.com/llvm/llvm-project/pull/100138
[6] https://www.phoronix.com/news/LLVM-MLIR-SPIR-V-CPU-Runner
skeevy420