Skip to content

Commit 4ea86a6

Browse files
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

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ endif()
3535
if(NOT FLAGTREE_BACKEND)
3636
add_definitions(-D__NVIDIA__)
3737
add_definitions(-D__AMD__)
38+
add_definitions(-D__FLAGTREE_RLC_ENHANCE__)
3839
elseif(FLAGTREE_BACKEND STREQUAL "iluvatar")
3940
add_definitions(-D__ILUVATAR__)
4041
set(FLAGTREE_TLE OFF)

0 commit comments

Comments
 (0)