-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[BE] Test CrossEntropyLoss for torch.half
#116681
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/116681
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 46cf278 with merge base 3fe437b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot drci |
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 fixing the skip --> expected failure, will submit a follow up PR to fix some other skips in the file to expected failure
DecorateInfo(unittest.expectedFailure, "TestModule", "test_pickle", dtypes=[torch.float16], device_type='cpu'), | ||
DecorateInfo(unittest.expectedFailure, "TestModule", "test_non_contiguous_tensors", dtypes=[torch.float16], | ||
device_type='cpu'), | ||
DecorateInfo(unittest.expectedFailure, "TestModule", "test_cpu_gpu_parity", dtypes=[torch.float16], |
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.
For this case, this isn't that relevant since CPU does not have a float16 implementation for CrossEntropyLoss, but I wanted to note that test_cpu_gpu_parity
is not tested for MPS as the test is decorated with @onlyCUDA
,
Lines 512 to 517 in 2ae55e9
@onlyCUDA | |
@with_tf32_off # Turn off TF32 to compute at full precision https://github.com/pytorch/pytorch/issues/86798 | |
@toleranceOverride({torch.float32: tol(5e-2, 0), | |
torch.float64: tol(4e-4, 0)}) | |
@modules(module_db) | |
def test_cpu_gpu_parity(self, device, dtype, module_info, training): |
In general, do we want to enable this test for MPS as well? (I can do so in a followup if we should)
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.
Sure, let me submit a followup PR (as I guess it will require few more suppressions on MPS side)
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 2 mandatory check(s) failed. The first few are:
Dig deeper by viewing the failures on hud |
@pytorchbot merge |
Merge startedYour 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 |
To test it on MPS and CUDA devices
Also, move some float64 skip-tests for MPS to xfail, same as CPU tests for torch.half