Improve detection precision of detect_unfused_reshapes by implementing physical layout verification and first-party attribution filtering: - #3339
Open
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_975584585
branch
from
September 4, 2026 08:31
37dec4f to
509fe95
Compare
…ing physical layout verification and first-party attribution filtering: 1. Physical Relayout Gate (_is_real_relayout): Drop zero-cost logical bitcast reshapes/transposes that preserve physical linearized memory ordering under identical minor-to-major layouts. 2. FLOPs == 0 filter: Exclude misclassified compute operations reporting non-zero FLOPs. 3. Tightened Compute Opcodes: Restrict downstream fold targets to genuinely foldable compute (dot, convolution, einsum, non-collective custom-call). 4. Collective Custom-Call Filter: Exclude collective communications (all-gather, all-to-all, reduce-scatter) which require collective schedule optimization rather than GEMM folding. 5. Fusion-Body Peek: Look inside consumer fusion bodies to verify presence of compute ops (dot/conv) while rejecting pure elementwise fusions. 6. First-Party Attribution Walk: Resolve leaf framework wrapper attributions (flax, jax, etc.) via HLO stack frames to true user model code, dropping orphaned framework wrappers. 7. Source Line Verification: Check source code on disk when available to filter passthrough statements. 8. Deduplication and Ranking: Group duplicate operations by source callsite and result shape, sorting findings by total self-time descending with bytes accessed reported alongside. PiperOrigin-RevId: 975584585
copybara-service
Bot
force-pushed
the
test_975584585
branch
from
September 4, 2026 09:21
509fe95 to
656aef1
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.
Improve detection precision of
detect_unfused_reshapesby implementing physical layout verification and first-party attribution filtering: