-
Notifications
You must be signed in to change notification settings - Fork 348
Replace torch.norm
with torch.linalg.vector_norm
#2660
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2660
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ae39cc4 with merge base 66384a9 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
thanks, according to the linked doc, it looks like there is three functions: Use torch.linalg.vector_norm() when computing vector norms and torch.linalg.matrix_norm() when computing matrix norms. For a function with a similar behavior as this one see torch.linalg.norm(). and the closest one is |
@jerryzh168 In my last experience, |
torch.norm
with torch.linalg.vector_norm
for PyTorch future updatetorch.norm
with torch.linalg.vector_norm
does it work for matrix? or just vector? |
@jerryzh168 torch.linalg.vector_norm only works for the vector norm as we discussed. We can use torch.linalg.norm for both (matrix & vector) uses, but in my las experience,
|
I don't quite get it, if it only works for vector norm, what happens for matrix inputs? or we expect all callsites to only have vector inputs? |
oh sorry, after reading the doc more closely, I think I'm a mistaken about what "vector" describes, it is referring to output instead of input |
@jerryzh168 it seems that CI failure ( Therefore, we might face troubleshooting about this; feel free to close this PR if you think issue is too chained. This PR addresses deprecated functions in the foreseeable future, but I am fine to close it if it breaks CI. |
@namgyu-youn I think you can use
|
Sorry I didn't make it clear. What I wanted to ask was, "should I add SkipTest to pass (Int1 support) CI?". Wondered why this CI broken for this PR, but I haven't found true reason. (maybe its related to other PRs) |
@namgyu-youn maybe rebase? generally we should already skip the int1 tests for lower torch versions |
@jerryzh168 Rebase was right; the reason was an old CI run. Since 2.5.0 check was dropped at #2720, we don't have to investigate into it; CI fail seems unrelated, I think. |
rebased PR for sync
Summary:
Based on https://docs.pytorch.org/docs/stable/generated/torch.norm.html,
torch.norm
will be deprecated. To prevent foreseeable issues, this PR updates the vector norm function. Following is warning message in docs.Test plan: CI