Repository navigation
[rocdl] Create basic code structure for ROCDL CodeGen - #16342
Conversation
a513fd1 to
2470907
Compare
This commit starts the rework of LLVMGPU compiler backend for future production. Specifically it starts a subdirectory for ROCDL CodeGen. The goal is to start with a minimal working structure and gradually port over relevant pass pipelines with proper target handling and heuristics. So in this commit we only pick the warp reduction pipeline which sort of matches the criteria here. Progress towards iree-org#16341
2470907 to
cd42bfd
Compare
raikonenfnu
left a comment
There was a problem hiding this comment.
Is this is not integrated into e2e iree-compile yet?
|
No this is detached from the normal compilation flow now and will remain so until we have cleaned up and ported over all rocdl related pass pipelines. And then we switch the rocm target to use this new strategy selection and codegen pipeline. See detailed steps in #16341. This means we can better isolate the two worlds and balance short-/long-term development goals and have clear cut boundaries regarding certain cleanups (like the KernelConfig etc.) |
raikonenfnu
left a comment
There was a problem hiding this comment.
Thanks for setting this up, overall LGTM! some minor NITs.
Understood :) |
MaheshRavishankar
left a comment
There was a problem hiding this comment.
It seems like we are branching the whole LLVMGPU compiler. I am not sure if that kind of fracturing is worth it. Could we get an idea of why this fracturing is needed? Somethings I understand is
- We need to set different tile sizes, etc. But just like on the SPIR-V side for different vendors you have different tile sizes picked, same should work here
- Do we need separate lowering pipelines for ROCDL as opposed to what we've been doing in LLVMGPU.
Or is the plan that we start from clean slate for ROCDL, and deprecate LLVMGPU?
|
The goal of having ROCDL subdirectory is indeed to start from a clean state so we can port over pieces gradually. I find it super hard to untangle while maintaining functionality / perf not regressing in the current working e2e compiler path. Better to separate and avoid adding more conditions and branches in the current flow to differentiate alpha vs. beta state development further. Regarding duplication, I anticipate only duplications over policy parts, like the KernelConfig, LowerExecutableTarget pass switch statement, etc. The majority of the code like passes and pipelines should be common (with target description accepted to control the CodeGen). That is reflected with the current code change, where you see only a few passes are copied over and cleaned up. It still relies on LLVMGPU for all the concrete passes. So in the end state I won't expect to see a lot of duplication in general. Even for the policy parts, we can also unify if we, say, can find common heuristics for both. I'd like to avoid shuffling code too much or unify too early until we cleaned up ROCDL and NVVM. Then we can move passes properly to some common directory. I've listed some more detailed backgrounds / plans / steps in #16341. Let's also touch base on this in the next CodeGen sync. :) |
|
Okay as chatted offline, for now we will still keep all the source files in the same lLVMGPU directory to get started. I've revised the code to do that. |
qedawkins
left a comment
There was a problem hiding this comment.
Nice first step, new pipeline looks so clean :D
MaheshRavishankar
left a comment
There was a problem hiding this comment.
Thanks @antiagainst . This seems much better to me.
This commit starts the rework of LLVMGPU compiler backend for future production. Specifically it starts a set of new source code files for ROCDL CodeGen configuration. The goal is to start with a minimal working structure and gradually port over relevant pass pipelines with proper target handling and heuristics. So in this commit we only pick the warp reduction pipeline which sort of matches the criteria here. Also we don't shuffle the passes around yet--the new ROCDL library just depends on the existing LLVMGPU library and its passes directly to get started. This is meant to avoid churns and we can do the mechanical change once everything is sorted.
Progress towards #16341