Skip to content

Conversation

@stellaraccident
Copy link
Collaborator

When importing dynamic shaped programs from Dynamo, via torch.compile or torch.export, we can assume that strict symbolic shape checks have been done prior to generating torch IR. Among other shape checking, this eliminates the case where an unknown dimension can be dynamically '1' in a way that signals a broadcast.

Adds a isAssumingStrictSymbolicShapes utility which consults a torch.assume_strict_symbolic_shapes attribute on an enclosing scope and returns true if present.

In the linalg pipeline, many runtime checks are elided when this returns true.

When importing dynamic shaped programs from Dynamo, via torch.compile or torch.export, we can assume that strict symbolic shape checks have been done prior to generating torch IR. Among other shape checking, this eliminates the case where an unknown dimension can be dynamically '1' in a way that signals a broadcast.

Adds a `isAssumingStrictSymbolicShapes` utility which consults a `torch.assume_strict_symbolic_shapes` attribute on an enclosing scope and returns true if present.

In the linalg pipeline, many runtime checks are elided when this returns true.
@stellaraccident
Copy link
Collaborator Author

(still working on some unit test updates)

Copy link
Collaborator

@ramiro050 ramiro050 left a comment

Choose a reason for hiding this comment

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

Nice!

@stellaraccident stellaraccident merged commit 860be09 into main Sep 29, 2023
@stellaraccident stellaraccident deleted the strict_symbolic_shapes branch September 29, 2023 23:45
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.

3 participants