fix(shape): share gather and tensor contracts - #644
Draft
fhanuman wants to merge 1 commit into
Draft
Conversation
|
Thanks for opening a PR! This project follows LLVM's incremental-development and AI-tool-use Before requesting review, please check that:
Reviewers are assigned through |
L2 Accuracy Results (EP vs CPU)
Threshold: 0.01 | Run: 4473 - Commit: |
MorphiZen EP Performance Results
EPContext Export Performance
EPContext Import Performance
OGA Benchmark Results
OGA Wheel Smoke (Python benchmark_e2e.py)
Run: 4473 - Commit: |
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 5, 2026 21:56
deb0a3f to
8db3876
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 6, 2026 21:00
8db3876 to
9f06ab6
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 7, 2026 19:51
9f06ab6 to
0858247
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
2 times, most recently
from
August 10, 2026 21:59
a0455ce to
e337608
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 10, 2026 22:29
e337608 to
af6a5a5
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 10, 2026 23:33
af6a5a5 to
2cb9720
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
2 times, most recently
from
August 11, 2026 13:29
9dd4ecb to
ffffe50
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 11, 2026 14:19
ffffe50 to
2e812f6
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 11, 2026 16:25
2e812f6 to
943bf82
Compare
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 11, 2026 21:22
943bf82 to
78bddcb
Compare
This was referenced Aug 16, 2026
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 16, 2026 20:06
920abc2 to
3b6b773
Compare
Unify Gather, GatherND, GatherElements, Transpose, Resize, and Size destination construction, reification, and verification around shared shape rules. Co-Authored-By: GPT-5.6 Sol <noreply@openai.com> Made-with: Cursor
This was referenced Aug 16, 2026
fhanuman
force-pushed
the
pr/shape-stack-06-gather-tensor
branch
from
August 17, 2026 01:09
3b6b773 to
323ec31
Compare
fhanuman
changed the base branch from
pr/shape-stack-05-conv-pool
to
pr/shape-stack-06c-causal-conv-contracts
August 17, 2026 01:31
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.
Why
Gather-family and tensor-shape operations previously constructed and checked result shapes through separate converter, reifier, and verifier logic. That made dimension splicing, permutation validation, packed-int4 interpretation, and imported result-template handling easy to apply inconsistently.
This PR gives those operations shared semantic shape rules while retaining the GatherND DPS-init fallback when runtime tuple width prevents static output-rank inference.
Shape example
The added GatherBlockQuantized reification test records the physical-to-logical packed-int4 shape rule directly in HIP IR:
The surviving packed axis has physical byte extent 96 and logical output extent 192; the same test suite covers the dynamic form by emitting
arith.mulifor that doubling.What changes
indicesoperand through the named same-shape contract.Stack
Full 31-PR order:
AI assistance
AI tools assisted with the shape-contract refactoring and stack reconstruction. The contributor reviewed and validated the resulting code.
Made-with: Cursor