[all-commits] [llvm/llvm-project] 7724be: [mlir][spirv] Do SPIR-V serialization in -test-vul...

Andrea Faulds via All-commits all-commits at lists.llvm.org
Thu Jan 9 08:59:14 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7724be972858477d9d4552f5fa2edb5222bff9e0
      https://github.com/llvm/llvm-project/commit/7724be972858477d9d4552f5fa2edb5222bff9e0
  Author: Andrea Faulds <andrea.faulds at amd.com>
  Date:   2025-01-09 (Thu, 09 Jan 2025)

  Changed paths:
    M mlir/include/mlir/Conversion/Passes.td
    M mlir/lib/Conversion/ConvertToSPIRV/ConvertToSPIRVPass.cpp
    M mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
    M mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp
    A mlir/test/Conversion/ConvertToSPIRV/convert-gpu-modules-nested.mlir
    M mlir/test/Conversion/GPUToVulkan/lower-gpu-launch-vulkan-launch.mlir
    M mlir/test/lib/Pass/TestVulkanRunnerPipeline.cpp
    M mlir/test/mlir-vulkan-runner/addui_extended.mlir
    M mlir/test/mlir-vulkan-runner/smul_extended.mlir
    M mlir/test/mlir-vulkan-runner/umul_extended.mlir

  Log Message:
  -----------
  [mlir][spirv] Do SPIR-V serialization in -test-vulkan-runner-pipeline (#121494)

This commit is a further incremental step toward moving the whole
mlir-vulkan-runner MLIR pass pipeline into mlir-opt (see #73457). The
previous step was b225b3adf7b78387c9fcb97a3ff0e0a1e26eafe2, which moved
all device passes prior to SPIR-V serialization into a new mlir-opt test
pass, `-test-vulkan-runner-pipeline`.

This commit changes how SPIR-V serialization is accomplished for Vulkan
runner tests. Until now, this was done by the Vulkan-specific
ConvertGpuLaunchFuncToVulkanLaunchFunc pass. With this commit, this
responsibility is removed from that pass, and is instead done with the
existing generic GpuModuleToBinaryPass. In addition, the SPIR-V
serialization step is no longer done inside mlir-vulkan-runner, but
rather inside mlir-opt (in the `-test-vulkan-runner-pipeline` pass).
Both of these changes represent a greater alignment between
mlir-vulkan-runner and the other GPU integration tests. Notably, the IR
shapes produced by the mlir-opt pipelines for the Vulkan and SYCL
runners are now much more similar, with both using a gpu.binary op for
the serialized SPIR-V kernel.

In order to enable this, this commit includes these supporting changes:

- ConvertToSPIRVPass is enhanced to support producing the IR shape where
a spirv.module is nested inside a gpu.module, since this is what
GpuModuleToBinaryPass expects.
- ConvertGPULaunchFuncToVulkanLaunchFunc is changed to remove its SPIR-V
serialization functionality, and instead now extracts the SPIR-V from a
gpu.binary operation (as produced by ConvertToSPIRVPass).
- `-test-vulkan-runner-pipeline` now attaches SPIR-V target information
required by GpuModuleToBinaryPass.
- The WebGPU pass option, which had been removed from mlir-vulkan-runner
in the previous commit in this series, is restored as an option to
`-test-vulkan-runner-pipeline` instead, so that the WebGPU pass
continues being inserted into the pipeline just before SPIR-V
serialization.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list