[RemoveLayoutConversions] Fix backward remat conflict detection#6701
Merged
whitneywhtsang merged 2 commits intoApr 21, 2026
Merged
Conversation
Contributor
Author
|
No performance regressions detected on Grafana: |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Ports upstream Triton fix to improve backward rematerialization conflict detection by ensuring layouts are recorded even when a value already has the desired encoding, preventing undetected encoding conflicts.
Changes:
- Always record encountered value layouts for conflict detection, even when the value already has the target encoding.
- Adjust slice construction so values with matching encodings are not added to the remat slice.
- Add MLIR regression tests covering conflict scenarios across multiple paths/ops.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| third_party/intel/lib/TritonIntelGPUTransforms/Utility.cpp | Updates backward-slice logic to record layouts while avoiding unnecessary slice entries when encodings already match. |
| lib/Dialect/TritonGPU/Transforms/Utility.cpp | Mirrors the upstream fix in the core TritonGPU utility implementation. |
| test/TritonIntelGPU/RemoveLayoutConversions/backward-remat-conflict.mlir | Adds regression tests to validate conflict detection and preservation/elimination of convert_layout as appropriate. |
chengjunlu
approved these changes
Apr 21, 2026
e325533 to
911b6b5
Compare
Port upstream Triton PR #9953: when getConvertBackwardSlice encounters a value that already has the desired encoding, record the layout for conflict detection without adding it to the remat slice. Previously the layout was not recorded, so a conflicting encoding via a different path went undetected. Signed-off-by: Tiotto, Ettore <ettore.tiotto@intel.com>
911b6b5 to
4aeb866
Compare
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.
Port upstream Triton PR #9953: when getConvertBackwardSlice encounters
a value that already has the desired encoding, record the layout for
conflict detection without adding it to the remat slice. Previously the
layout was not recorded, so a conflicting encoding via a different path
went undetected.
Closes #6700