Support broadcast strides in TensorAttr and ASM emitter#288
Merged
IanWood1 merged 2 commits intoiree-org:mainfrom Apr 6, 2026
Merged
Support broadcast strides in TensorAttr and ASM emitter#288IanWood1 merged 2 commits intoiree-org:mainfrom
IanWood1 merged 2 commits intoiree-org:mainfrom
Conversation
e22a875 to
eaf3b2e
Compare
eaf3b2e to
1892118
Compare
Broadcast strides (stride=0 on dims with size > 1) are used by frameworks like cuDNN and PyTorch to share data across dimensions via memory aliasing. This enables fusilli to accept tensors where certain dimensions read from the same physical memory location. TensorAttr changes: - Add hasBroadcastDims() and getUnexpandedDim() methods - Update hasValidPhysicalRepresentation() to accept stride=0 - Update getPhysicalDim() to return size 1 for broadcast dims - Update getLogicalToPhysicalPermuteOrder() to pin broadcast dims ASM emitter changes: - Add buildTensorTypeStr() helper for explicit dims - Rename getPermuteOpsAsm → getLayoutConversionOpsAsm which handles permute + broadcast expand internally for physical→logical conversion - Callers no longer need broadcast-specific branching Broadcast strides on output tensors are not yet supported and are rejected during graph validation with a clear error message. Fixes iree-org#276 Signed-off-by: Ian Wood <ianwood@u.northwestern.edu>
1892118 to
c199bb5
Compare
8 tasks
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.
Support broadcast strides (stride=0) in TensorAttr and ASM emitter.
TensorAttr changes:
ASM emitter changes:
Fixes #276