Remove deprecated expectedFailurePropagateRealTensors decorator from FakeTensorOperatorInvariants test#3199
Open
tszulist-hbn wants to merge 1 commit intointel:mainfrom
Open
Conversation
…FakeTensorOperatorInvariants test
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the deprecated expectedFailurePropagateRealTensors marking on FakeTensorOperatorInvariants.test_module_to so the test runs (and passes) under the propagate-real-tensors configuration, aligning with upstream PyTorch changes and fixing the XPU weakref swap failure.
Changes:
- Dropped the
expectedFailurePropagateRealTensorsdecorator fromtest_module_toin the XPU FakeTensor test suite.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #2712 together with the corresponding change to PyTorch: pytorch/pytorch#178584
Fix test_module_to failure with weakref error on XPU
Fixes #2712
Summary
Fixes
RuntimeError: Cannot swap t2 because it has weakref associated with itinFakeTensorOperatorInvariants.test_module_towhen running on XPU. The error occurs when callingModule.to()underFakeTensorModebecauseswap_tensorsfails due to weakrefs held on the applied parameter tensor.The upstream fix is tracked in pytorch/pytorch#171856.
Changes
test/xpu/test_fake_tensor_xpu.pyto align with the upstream PyTorch test changes that maketest_module_toand related FakeTensor tests device-generic (supporting both CUDA and XPU).