Tier-0: partition on dynamic shapes; materialize passthrough graph outputs - #88
Open
KenLagos wants to merge 1 commit into
Open
Tier-0: partition on dynamic shapes; materialize passthrough graph outputs#88KenLagos wants to merge 1 commit into
KenLagos wants to merge 1 commit into
Conversation
…tputs
Restructure Tier-0 fusion so shape-static islands inside dynamic-shape
graphs get fused, matching how ORT partitions detection/NMS models.
Refactor GetCapability into three phases:
1. Resolve shapes to a fixpoint (graph-wide TryTranslateNodes forward
propagation) before any claiming, so grouping can see recovered shapes.
2. Shape-aware grouping in a single pass: dynamic shape is now a partition
boundary alongside CPU-preferred / unsupported / no-translator, using
the existing HasDynamicShape.
3. Claim each resulting static group once.
Materialize a shape-only passthrough (Reshape/Squeeze/Unsqueeze/Flatten) as
a real ELEMENT_WISE_IDENTITY in both Compile and TryCompilePartition when its
output is a partition output, since an elided alias has no DML node to source
its output edge. Mirrors ORT's DmlOperatorCopy.
Preserve true tensor rank through the fused-graph shape-reporting path so a
scalar output is reported as [] rather than the 4D-padded [1,1,1,1], which
changed downstream ONNX broadcast semantics. Three sites:
- TranslateShapeOnly carries original_rank onto its output tensor.
- Compile output_dims distinguishes a reported rank (incl. 0/scalar) from
missing shape info via a rank_known flag.
- ExportDims writes unpadded dims into resolved_shapes so a scalar does not
round-trip back as rank 4.
Regression suite passes; small net perf gain overall.
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.
Restructure Tier-0 fusion so shape-static islands inside dynamic-shape graphs get fused, matching how ORT partitions detection/NMS models.
Refactor GetCapability into three phases:
Materialize a shape-only passthrough (Reshape/Squeeze/Unsqueeze/Flatten) as a real ELEMENT_WISE_IDENTITY in both Compile and TryCompilePartition when its output is a partition output, since an elided alias has no DML node to source its output edge. Mirrors ORT's DmlOperatorCopy.
Preserve true tensor rank through the fused-graph shape-reporting path so a scalar output is reported as [] rather than the 4D-padded [1,1,1,1], which changed downstream ONNX broadcast semantics. Three sites: