Skip to content
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

support gmm as a custom op for dynamo #7672

Merged
merged 6 commits into from
Jul 12, 2024
Merged

Conversation

JackCaoG
Copy link
Collaborator

@JackCaoG JackCaoG commented Jul 12, 2024

PyTorch actually will not run functionization inside a custom op. This means we should avoid using the in place ops for all of the custom op implementation. For this op I made gmm functional.

From @bdhirsh

short answer is that functionalization runs on every "primitive" op (both in aten and custom) directly. so if it sees a custom op that is marked as not-mutating-its-inputs, it will assume that op is functional

@JackCaoG JackCaoG requested a review from alanwaketan July 12, 2024 01:35
@JackCaoG JackCaoG marked this pull request as ready for review July 12, 2024 01:35
@JackCaoG JackCaoG requested a review from wonjoolee95 July 12, 2024 01:35
@JackCaoG JackCaoG merged commit 1651e76 into master Jul 12, 2024
23 checks passed
@JackCaoG JackCaoG deleted the JackCaoG/gmm_custom_op branch July 12, 2024 17:26
Copy link
Collaborator

@alanwaketan alanwaketan left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -7,6 +7,7 @@
import torch_xla
import torch_xla.core.xla_model as xm
import torch_xla.distributed.spmd as xs
import torch_xla.debug.metrics as met
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you add this in accident?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lol forgot to delete

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