Remove CUDA-specific early exit from XPU test#3192
Open
Silv3S wants to merge 2 commits intointel:mainfrom
Open
Remove CUDA-specific early exit from XPU test#3192Silv3S wants to merge 2 commits intointel:mainfrom
Silv3S wants to merge 2 commits intointel:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes an XPU-specific assertion path in the GradScaler pickling test that referenced torch.xpu.amp (which doesn’t exist), aligning the XPU test behavior with the non-CUDA path and preventing AttributeError failures.
Changes:
- Drop the XPU-only
torch.xpu.amp.common.amp_definitely_not_available()check intest_pickle_gradscaler. - Let XPU follow the existing non-CUDA assertion path (
a.is_enabled()expected true).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kdrozd-dev
approved these changes
Mar 26, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2509
From amp docs:
This PR fixes
test_pickle_gradscaler_xpu, as it tries to usetorch.xpu.ampthat doesn't exist and also calls CUDA-specific early exit. We should just drop this check and proceed with the test itself (it passes).Second test from issue doesn't require any work, as
test_grad_scaler_deprecated_warning_xpuchecks if deprecation warning is raised but it doesn't make sense for XPU, as XPU doesn't have that deprecatedtorch.xpu.ampimplemented