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

Add a decomposition for _weight_norm_interface. #112193

Closed
wants to merge 1 commit into from
Closed

Conversation

qihqi
Copy link
Contributor

@qihqi qihqi commented Oct 26, 2023

Fixes #112086

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 26, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/112193

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit fbf7080 with merge base 9bfebf7 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@albanD albanD requested review from ezyang and lezcano October 27, 2023 15:02
@albanD albanD added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 27, 2023
Comment on lines +888 to +899
@unittest.skipIf(TEST_WITH_ASAN, "Skipped under ASAN")
@onlyNativeDeviceTypes
@skipIfCrossRef
def test_weight_norm_interface(self, device):
g = torch.randn((3, 10, 10), device=device)
v = torch.randn((1, 1, 10), device=device)

ref = torch.ops.aten._weight_norm_interface(g, v, 2)
res = torch._decomp.decompositions._weight_norm_interface(g, v, 2)
self.assertTrue(torch.allclose(ref[0], res[0]))
self.assertTrue(torch.allclose(ref[1], res[1]))

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than a one-off test, please add relevant samples that exercise the _wegith_norm_interface path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi,

What do you mean by "relevant samples" exactly? Just more random test cases of different shapes or you have specific test cases in mind?

Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add samples to WeightNorm's OpInfo so that they exercise this path. No need to add any new test

Copy link
Collaborator

Choose a reason for hiding this comment

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

@qihqi will you do this in a follow up PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure!

@qihqi qihqi requested a review from lezcano October 27, 2023 21:21
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

i'm going to go ahead and land this for now, but the opinfo would be appreciated in follow up

@ezyang
Copy link
Contributor

ezyang commented Oct 31, 2023

test failure is legit

@qihqi
Copy link
Contributor Author

qihqi commented Oct 31, 2023

test failure is legit

Thanks, taking a look

@ezyang
Copy link
Contributor

ezyang commented Nov 1, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 1, 2023
@lezcano lezcano added the topic: not user facing topic category label Nov 1, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

qihqi added a commit to qihqi/pytorch that referenced this pull request Nov 2, 2023
qihqi added a commit to qihqi/pytorch that referenced this pull request Nov 2, 2023
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
qihqi added a commit to qihqi/pytorch that referenced this pull request Nov 10, 2023
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
andreigh pushed a commit to andreigh/pytorch that referenced this pull request Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[export] aten._weight_norm_interface doesn't have decomposition
6 participants