-
Notifications
You must be signed in to change notification settings - Fork 651
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
Fix sddmm2 when nnz=0 #300
Conversation
Also add cudaGetLastError which was missing
@@ -158,14 +158,14 @@ def test_sddmm_sputnik(device): | |||
|
|||
|
|||
@cuda_only | |||
@pytest.mark.parametrize("prob", [0.5, 1]) |
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.
thanks for adding this, nice catch
@@ -539,6 +546,7 @@ torch::Tensor sddmm_cuda_csr( | |||
D2.data_ptr<float>(), | |||
out.data_ptr<float>()); | |||
} | |||
AT_CUDA_CHECK(cudaGetLastError()); |
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.
ok, makes sense :)
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.
LGTM, thanks a lot @fmassa for diving in and the very quick fix
the mypy error is fixed on main, will be fine on landing |
One of the internal implementations of sampled dense dense matrix multiplication (sddmm) that we have had two issues:
cudaGetLastError
call in the end of the functions. So errors in this kernel would only be reported at the next function invocation, misleading the true location of the issue.The PR fixes this by returning early when
nnz=0
(which is fine as there is no data in the tensor anyway), and also add cudaGetLastError which was missing.Should fix the errors present in #263