[DNR][BACKEND] Reduce layout conversions at memory boundaries - #11161
Draft
jeffniu-openai wants to merge 4 commits into
Draft
[DNR][BACKEND] Reduce layout conversions at memory boundaries#11161jeffniu-openai wants to merge 4 commits into
jeffniu-openai wants to merge 4 commits into
Conversation
Rebuild scalar-rooted join and reshape expressions directly in the fixed store layout instead of exchanging packed values through shared memory. Across 31,693 frozen production cases, remove 30 layout conversions from five kernels without increasing conversions or changing observable memory or reduction counts. Add MLIR coverage and eight GB300 correctness variants.
Keep matching store pointers and predicates in their existing layout and convert only the reduced payload. Remove two conversions from all 490 production top-k corpus cases without increasing conversions in the 31,693-case corpus. Add focused MLIR and GPU coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR description written by Codex
Improve legacy layout-conversion removal by rematerializing packed store expressions in their final layout, preserving native pointer and mask layouts, keeping narrowing computations in their input layout, and sharing exchanges across selected value/index outputs and floating-point validity predicates.
Validated with all 148 TritonGPU/TritonNvidiaGPU lit tests, 17 GPU correctness tests, and a 31,693-kernel production replay: 1,329 improved, 2,543 fewer layout conversions, and no regressions. Representative packed downcasts reduce shared memory from 16 KiB to 4 KiB; top-k reduces barriers from 9 to 3 and PTX instructions from 675 to 526.
Stack
Merge bottom-up: