-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix the bug in THCTensor_(baddbmm) and ATen's addmm_cuda for strided views input #42425
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
💊 CI failures summary and remediationsAs of commit cfff0b4 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
| Job | Step | Action |
|---|---|---|
| Doc Build and Push | 🔁 rerun |
This comment was automatically generated by Dr. CI (expand for details).
Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.
This comment has been revised 32 times.
|
Thank you, the fix looks good! Please add the test to the test suite. There's test_baddbmm in test_torch.py, but for some reason it's enabled only on the CPU. Can you try enabling it on cuda and adding a testcase for the behavior your enabled there? |
|
Sure, I will do that. |
|
While writing tests I found that import torch
x = torch.tensor([[1., 2, 3], [4., 5, 6]], device='cuda:0')
c = torch.as_strided(x, size=[2, 2, 2], stride=[3, 1, 1])
torch.mm(c[0], c[0]) # FailsThe same problem was in |
bf007be to
aba7652
Compare
ngimel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks great! I have a small suggestion about the test.
ngimel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
|
flake8 error is real |
Is it okay to ignore E731 because of assigned lambdas instead of def in the test? |
|
Yeah, that's fine, you could also use lambdas directly as arguments, but it does not matter. Sorry to ask, but can you please rebase? We had an issue with docker images today, so CI on this PR is failing because it is against a bad base, and can't find docker images. |
ddf1e4c to
8427595
Compare
|
Alright, I did something wrong here. I've rebased onto master and pushed to branch and PR was automatically closed. I'll try to fix that. |
|
It somehow became 0-commit 0-line pull request, that's probably why it was closed. Something wrong with the rebase? |
|
I've recovered the branch. I am sorry for the inconvenience. I've re-opened the PR. |
The problem was that the wrong codepath was taken with unusual strides and not contiguous input in batched matrix multiplication.
…e compared to NumPy
31e5749 to
cfff0b4
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Thank you! |
Fixes #42418.
The problem was that the non-contiguous batched matrices were passed to
gemmStridedBatched.The following code fails on master and works with the proposed patch: