Commit 4ea86a6
authored
[Nvidia][TritonGPU] Add phases to RemoveLayoutConversions (#763)
* [Nvidia][TritonGPU] Add phases to RemoveLayoutConversions
* [Nvidia][TritonGPU] Gate RLC phases behind a single CMake master switch
* [Nvidia][TritonGPU] Gate RLC phases via compiler.py env switches
* [Sunrise] Inherit pass constructors in RemoveLayoutConversions spec override
* [Nvidia][TritonGPU] Gate RLC enhancement via env switch and compile-time macro
Move the four RemoveLayoutConversions phases behind a runtime master switch
FLAGTREE_RLC_ENHANCE (compiler.py, NVIDIA only, on by default) and wrap all
enhancement code in the __FLAGTREE_RLC_ENHANCE__ compile-time macro (enabled
via CMake for the default/NVIDIA build). Undefining the macro removes the
enhancement and reverts the pass byte-for-byte to the upstream implementation.
Revert the Passes.td pass options and the sunrise spec override back to
upstream; the per-phase switches now live as file-local constexpr flags for
internal debugging only.
* [Nvidia][TritonGPU] Move RLC master switch to knobs; tidy macro guards
Address review feedback on the RemoveLayoutConversions enhancement:
- Drive the runtime master switch through the idiomatic knobs mechanism:
add nvidia_knobs.rlc_enhance (FLAGTREE_RLC_ENHANCE, on by default) and read
it in compiler.py, dropping the ad-hoc env-var helper.
- Normalize the __FLAGTREE_RLC_ENHANCE__ / __TLE__ conditional blocks:
annotate #endif/#else with their controlling macro, restore normal blank-line
separation between functions, and fix include grouping.
Comment/whitespace/structure only; the macro-on expansion is code-identical to
the previous commit and macro-off still reverts to upstream behavior.
* [Nvidia][TritonGPU] Make resolveConflicts #ifdef branches self-contained
The conflict-resolution loop interleaved the __FLAGTREE_RLC_ENHANCE__ #ifdef
with nested if/for bodies, so the shared closing braces meant different things
in each branch and were hard to follow. Split the loop body into two fully
self-contained #ifdef/#else branches (each with matched braces), duplicating
only the two trivial common lines.
No behavior change: macro-on expansion is code-identical and macro-off still
matches upstream byte-for-byte in this region.1 parent ced1983 commit 4ea86a6
5 files changed
Lines changed: 2940 additions & 47 deletions
File tree
- lib/Dialect/TritonGPU/Transforms
- python
- src
- triton
- third_party/nvidia/backend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments