support symbolic shape transpose, contiguous, as_shape#4823
Open
shivadbhavsar wants to merge 94 commits intoto_symbolic_helperfrom
Open
support symbolic shape transpose, contiguous, as_shape#4823shivadbhavsar wants to merge 94 commits intoto_symbolic_helperfrom
shivadbhavsar wants to merge 94 commits intoto_symbolic_helperfrom
Conversation
…aphX into sym_dim_integration
…and explicitly throw when they are violated
…duplication of the interval struct in sym and dynamic_dimension
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## to_symbolic_helper #4823 +/- ##
======================================================
+ Coverage 92.52% 92.52% +0.01%
======================================================
Files 583 583
Lines 29967 29975 +8
======================================================
+ Hits 27724 27734 +10
+ Misses 2243 2241 -2
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds symbolic-shape support so shape propagation can pass through transpose, contiguous, and as_shape without dropping symbolic dimension/stride information, by extending shape with a symbolic element-count helper.
Changes:
- Add
shape::sym_elements()to compute element count as asym::exprfor static/symbolic shapes. - Update
transposeandcontiguousshape inference to correctly handle symbolic shapes (including symbolic strides). - Update
as_shapeto accept symbolic shapes and usedyn_outputincompute.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/op_shape_test.cpp | Adds new shape-propagation tests for symbolic transpose, contiguous, and as_shape. |
| src/shape.cpp | Implements shape_impl::sym_elements() and shape::sym_elements(). |
| src/include/migraphx/shape.hpp | Declares shape::sym_elements() API. |
| src/include/migraphx/sym.hpp | Adds <type_traits> include for sym utilities. |
| src/include/migraphx/op/transpose.hpp | Preserves symbolic dims/strides through transpose; keeps range-only dynamic as dims-only permutation. |
| src/include/migraphx/op/contiguous.hpp | Ensures dynamic (incl. symbolic) outputs are returned as standard/packed shapes. |
| src/include/migraphx/op/as_shape.hpp | Allows symbolic shapes, adds explicit rejection for range-only dynamic shapes, and switches compute to dyn_output. |
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.
Motivation
Propagate symbolic shapes through transpose, contiguous and as_shape
Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable