[upstream_ut] MetadataMismatchError in TestFakeTensor of test_ops.py#14
Draft
Stonepia wants to merge 1 commit into
Draft
[upstream_ut] MetadataMismatchError in TestFakeTensor of test_ops.py#14Stonepia wants to merge 1 commit into
Stonepia wants to merge 1 commit into
Conversation
[upstream_ut] MetadataMismatchError in TestFakeTensor of test_ops.py
7 tasks
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.
[upstream_ut] MetadataMismatchError in TestFakeTensor of test_ops.py
Fixes intel/torch-xpu-ops#1963
Root Cause: linalg_pinv and pinverse are not registered in any XPU autocast policy in aten/src/ATen/autocast_mode.cpp. For CUDA, these ops are handled via fp32 policy but the equivalent XPU registration is missing. Without an explicit XPU autocast registration, the real kernel respects the active autocast dtype (float16) while the fake tensor dispatch falls through without dtype casting, producing a dtype mismatch (float32 vs float16). The bilinear failure likely follows the same pattern where the promote policy for XPU is not being observed by FakeTensor.
Failed Tests:
test_ops.py::TestFakeTensorXPU::test_fake_autocast_linalg_pinv_xpu_float32test_ops.py::TestFakeTensorXPU::test_fake_autocast_pinverse_xpu_float32test_ops.py::TestFakeTensorXPU::test_fake_crossref_backward_amp_nn_functional_bilinear_xpu_float32Diff stat: