Skip to content

✨[Improvement] Unified + Selective Decomposition System for Dynamo #2160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gs-olive opened this issue Aug 1, 2023 · 0 comments · Fixed by #2173
Closed

✨[Improvement] Unified + Selective Decomposition System for Dynamo #2160

gs-olive opened this issue Aug 1, 2023 · 0 comments · Fixed by #2173
Assignees
Labels
component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths feature request New feature or request Story: Export/Compile Unification Issues relating to unification of Dynamo compile/export paths

Comments

@gs-olive
Copy link
Collaborator

gs-olive commented Aug 1, 2023

Context

Currently, the decomposition system in compile, soon to be integrated into export, is based on the core_aten_decompositions set, as here:

DECOMPOSITIONS = {**core_aten_decompositions()}

This set of decompositions, while exhaustive, decomposes certain operations which we would like to preserve, including aten.cudnn_batch_norm and other batch norm implementations. Such implementations, when combined with utilities for freezing, such as those discussed in #2124, #2128, can greatly improve performance on networks with these operators.

As a bonus, the pre-aot decompositions, as here, may be more easily removed/reduced, since it is difficult to integrate these into export currently.

Proposal

Introduce a new decomposition dictionary which does one of two things:

1. Selectively remove operators from the core_aten_decompositions dictionary, to ensure these operators are not decomposed and will stay in their initial state. This allows us to continue using the most up-to-date decompositions dictionary while selectively removing the operators which are preferable to stay as-is.
2. Selectively keep operators in the core_aten_decompositions dictionary, to ensure the set of decompositions is fully defined and does not depend on the state of PyTorch's dictionary. This gives more control over the set of decompositions allowed, but requires that modifications are made to the decompositions library more often, since PyTorch may introduce new desirable decompositions often.

@gs-olive gs-olive added feature request New feature or request component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths Story: Export/Compile Unification Issues relating to unification of Dynamo compile/export paths labels Aug 1, 2023
@gs-olive gs-olive self-assigned this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths feature request New feature or request Story: Export/Compile Unification Issues relating to unification of Dynamo compile/export paths
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant