Skip to content

[Feat]: support marking static shapes along with dynamic shapes in magi_compile - #2

Merged
jiahy0825 merged 1 commit into
SandAI-org:mainfrom
wtr0504:feat/static_shape
Mar 24, 2026
Merged

jiahy0825 merged 1 commit into
SandAI-org:mainfrom
wtr0504:feat/static_shape

Conversation

@wtr0504

@wtr0504 wtr0504 commented Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator
  • Introduce _apply_shape_marks as the main entry point to apply both dynamic and static shapes before Dynamo tracing.
  • Refactor _mark_dynamic_shapes to mark args dynamic and return records of marked dynamic dimensions.
  • Add _mark_static_shapes to recursively traverse function arguments and explicitly mark all remaining un-marked tensor dimensions as static using torch._dynamo.mark_static.

@jiahy0825 jiahy0825 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jiahy0825
jiahy0825 merged commit 04cd1bc into SandAI-org:main Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants