Repository navigation
Description
This is the tracking issue for a collections of tasks to rework various GPU compiler backends to be more consistent.
Background
In IREE we have LLVMGPU for CUDA/ROCm, SPIR-V for Vulkan/Metal/WebGPU/etc. Due to historical reasons and different cycles of development focus, these backends are in quite irregular support situation. We were taking on efforts to clean up in order to productionize both the CUDA and ROCm HAL driver impl. Here similarly we want to clean up various technical debts for better future production.
High-level goals and tasks
Overall the goal is to make the LLVMGPU and SPIR-V backends to be more consistent, by sharing similar mechanisms (target description, passes, pipelines, etc. whenever reasonable) while maintaining their flexiblity for targeting special hardware features. Specifically, we'd want to achieve the following high-level goals:
High-level goals
- Use common GPU target description for LLVMGPU and SPIR-V
- Plumb through multi-target CodeGen for both LLVMGPU and SPIR-V
- Decouple CUDA and ROCm in LLVMGPU
- Use simple heuristics to replace hardcoded configuration in LLVMGPU
- Migrate more compiler heuristics to runtime probing
Note that the above items focus more on the overall structure and scaffolding of those GPU backends. We also want to modernize and consolidate various LLVMGPU and SPIR-V pipelines. But that's disjoint with the items listed above.
Detailed steps
Right now we have separate ways to specify GPU targets for LLVMGPU and SPIR-V. SPIR-V side it's also too coupled with Vulkan. The goal is to use one unified #iree_gpu.target for all of them, and the delete the Vulkan-specific target management.
Use common GPU target description
- [GPU] Thread through a common target description #17217
- [GPU] Support specifying LLVMGPU backend target features #17451
- [spirv] Switch to use common target description #17623
- [compiler] Make cuda/hip/vulkan target cl options consistent #17710
- [spirv] Push GPU target conversion to before SPIR-V conversion #17816
- Avoid requiring explicit information for opaque layout
Support GPU multi-targeting
- Change SPIR-V default target to null and do multi-targeting
- Plumb multi-targeting support for HIP
- Plumb multi-targeting support for CUDA
- Change HIP default target to null and do multi-targeting
- Change CUDA default target to null and do multi-targeting
- Avoid using a fixed subgroup size for SPIR-V default target
CUDA and ROCm support in LLVMGPU is highly connected in the current LLVMGPU backend. It's hard to decouple working on the codebase while making sure everything works fine / does not regress greatly. So we start with a base ROCDL CodeGen subdirectory along side. And gradually port over existing functionalities over. During the porting, we make sure stuff are cleaned up, target description is threaded, basic heuristics are used for configuration deduction to avoid hardcoded knobs, etc. Once everything is up to speed, we then delete the ROCm cases in LLVMGPU subdirectory and rename LLVMGPU subdirectory to NVVM and cleanup accordingly.
Decouple CUDA and ROCm
- [rocdl] Create basic code structure for ROCDL CodeGen #16342
- Port over various pipelines related to ROCDL
- Switch ROCm target to use the new pipelines
- Rename LLVMGPU configurations to NVVM and cleanup
Activity
[rocdl] Create basic code structure for ROCDL CodeGen
[rocdl] Create basic code structure for ROCDL CodeGen
[rocdl] Create basic code structure for ROCDL CodeGen
raikonenfnu commentedon Feb 7, 2024
@antiagainst Just curious, where can I read up on these new pipelines? :)
antiagainst commentedon Feb 7, 2024
This is future steps. They don't exist yet. :)
[rocdl] Create basic code structure for ROCDL CodeGen (#16342)
[GPU] Thread through a common target description (#17217)
[GPU] Support specifying LLVMGPU backend target features (#17451)
[GPU] Thread through a common target description (iree-org#17217)
[GPU] Support specifying LLVMGPU backend target features (iree-org#17451
[GPU] Thread through a common target description (iree-org#17217)
[GPU] Support specifying LLVMGPU backend target features (iree-org#17451
[GPU] Thread through a common target description (iree-org#17217)
[GPU] Support specifying LLVMGPU backend target features (iree-org#17451
[spirv] Switch to use common target description (#17623)
Raland "[spirv] Switch to use common target description"
Raland "[spirv] Switch to use common target description"
Reland "[spirv] Switch to use common target description" (#17699)
[spirv] Switch to use common target description (iree-org#17623)
[spirv] Push GPU target conversion to before SPIR-V conversion (#17816)
[GPU] Thread through a common target description (iree-org#17217)
[GPU] Support specifying LLVMGPU backend target features (iree-org#17451
[spirv] Switch to use common target description (iree-org#17623)
Reland "[spirv] Switch to use common target description" (iree-org#17699
[spirv] Push GPU target conversion to before SPIR-V conversion (iree-…
[compiler] Make cuda/hip/vulkan target cl options consistent (#17710)