-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 several test_ops cuda dtypes tests #60922
Closed
Closed
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8561bcc
fix
xwang233 2a07f25
fix
xwang233 8251de7
Merge remote-tracking branch 'upstream/master' into cuda_dtypes_fix
xwang233 fc3426e
Merge remote-tracking branch 'upstream/master' into cuda_dtypes_fix
xwang233 93fd817
Merge remote-tracking branch 'upstream/master' into cuda_dtypes_fix
xwang233 05fca2e
SM60OrLater and CUDA11OrLater
xwang233 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
from torch.testing._internal.common_device_type import \ | ||
(skipIf, skipCUDAIfNoMagma, skipCUDAIfNoMagmaAndNoCusolver, skipCUDAIfNoCusolver, | ||
skipCPUIfNoLapack, skipCPUIfNoFFT, skipCUDAIfRocm, precisionOverride, toleranceOverride, tol) | ||
from torch.testing._internal.common_cuda import CUDA11OrLater, SM53OrLater | ||
from torch.testing._internal.common_cuda import CUDA11OrLater, SM53OrLater, SM60OrLater | ||
from torch.testing._internal.common_utils import \ | ||
(is_iterable_of_tensors, | ||
random_symmetric_matrix, random_symmetric_psd_matrix, | ||
|
@@ -6069,7 +6069,8 @@ def gradcheck_wrapper_triangular_input(op, input, *args, upper=False, **kwargs): | |
dtypesIfCPU=all_types_and_complex(), | ||
dtypesIfCUDA=floating_and_complex_types_and(torch.float16, *[torch.bfloat16] if CUDA11OrLater else []), | ||
dtypesIfROCM=floating_types_and(torch.half, torch.bfloat16), | ||
backward_dtypesIfCUDA=floating_and_complex_types_and(torch.float16), | ||
backward_dtypesIfCUDA=floating_and_complex_types_and(torch.float16, | ||
*[torch.bfloat16] if SM60OrLater else []), | ||
assert_autodiffed=True, | ||
sample_inputs_func=sample_inputs_matmul, | ||
skips=( | ||
|
@@ -6545,7 +6546,8 @@ def gradcheck_wrapper_triangular_input(op, input, *args, upper=False, **kwargs): | |
dtypesIfCPU=all_types_and_complex(), | ||
dtypesIfCUDA=floating_types_and(torch.float16, *[torch.bfloat16] if CUDA11OrLater else [], | ||
torch.complex64, torch.complex128), | ||
backward_dtypesIfCUDA=floating_types_and(torch.float16, torch.complex64, torch.complex128), | ||
backward_dtypesIfCUDA=floating_types_and(torch.float16, *[torch.bfloat16] if SM60OrLater else [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skip on line 6557 needs to be removed |
||
torch.complex64, torch.complex128), | ||
assert_autodiffed=True, | ||
sample_inputs_func=sample_inputs_matmul, | ||
supports_out=False, | ||
|
@@ -6904,7 +6906,7 @@ def gradcheck_wrapper_triangular_input(op, input, *args, upper=False, **kwargs): | |
op=lambda tensors, equation: torch.einsum(equation, tensors), | ||
dtypes=all_types_and_complex_and(torch.half, torch.bfloat16), | ||
dtypesIfCUDA=floating_and_complex_types_and(torch.half, *[torch.bfloat16] if CUDA11OrLater else []), | ||
backward_dtypesIfCUDA=floating_and_complex_types_and(torch.half), | ||
backward_dtypesIfCUDA=floating_and_complex_types_and(torch.half, *[torch.bfloat16] if SM60OrLater else []), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skip on line 6915 needs to be removed |
||
supports_out=False, | ||
sample_inputs_func=sample_inputs_einsum, | ||
skips=( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think the sm_60 check would be sufficient, as
bfloat16
should have been introduced in CUDA11 (https://docs.nvidia.com/cuda/archive/11.0/cuda-toolkit-release-notes/index.html#cuda-general-new-features), so this could fail on 10 and previous releases. Wouldn'tif CUDA11OrLater
as done for the forward pass also work here?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.
It unfortunately failed in my previous commit which was using
CUDA11OrLater
, see https://app.circleci.com/pipelines/github/pytorch/pytorch/343601/workflows/695dad4b-86d7-49f4-b4c5-e2aa7b1d0bfa/jobs/14465553There 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.
We may use something like
(CUDA11OrLater and SM60OrLater)
.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.
Did you want to try that change, @xwang233?
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.
The skip on line 6079 should be removed once the dtypes are corrected