Repository navigation
Conversation
disable torch.half and torch.complex32 on XPU for some fft ops before they are implemented update dot and vdot dtypes according to latest implementation. [ghstack-poisoned]
[ghstack-poisoned]
…_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
… enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…test - enable test_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…st_ops_fwd_gradients.py and test_ops_gradients.py on Intel GPU" 1. Enable xpu with instantiate_device_type_tests() allow_xpu=True augument 2. Added backward_failure_skips and _skip_backward_failures() to skip cases failed on xpu due to known limitations, avoid too much updates in op_db. [ghstack-poisoned]
…s they are the same xfail as 'cuda' or other devices, use device list like ('cuda', 'xpu') in DecorateInfo device_type.
[ghstack-poisoned]
|
@pytorchbot merge |
Merge failedReason: PR 178849 is out of sync with the corresponding revision 4a3b320 on branch gh/daisyden/13/orig that would be merged into main. This usually happens because there is a non ghstack change in the PR. Please sync them and try again (ex. make the changes on origin/gh/daisyden/13/orig and run ghstack). Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge failedReason: PR 178849 is out of sync with the corresponding revision 4a3b320 on branch gh/daisyden/13/orig that would be merged into main. This usually happens because there is a non ghstack change in the PR. Please sync them and try again (ex. make the changes on origin/gh/daisyden/13/orig and run ghstack). Details for Dev Infra teamRaised by workflow job |
[ghstack-poisoned]
|
@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 |
…t_ops.py on Intel GPU (pytorch#178849) Add more cases in test_ops.py 1. Generalize TestCommon, TestCompositeCompliance, TestMathBits, TestFakeTensor, TestForwardADWithScalars with onlyAccelerator 2. Enable xpu test with instantiate_device_type_tests() allow_xpu=True augment 3. skip cases or ops with limitations in xpu. 4. remove skipIfXpu according to current status. Pull Request resolved: pytorch#178849 Approved by: https://github.com/jansel, https://github.com/guangyey (cherry picked from commit 02dbce8)
…t_ops.py on Intel GPU (pytorch#178849) Add more cases in test_ops.py 1. Generalize TestCommon, TestCompositeCompliance, TestMathBits, TestFakeTensor, TestForwardADWithScalars with onlyAccelerator 2. Enable xpu test with instantiate_device_type_tests() allow_xpu=True augment 3. skip cases or ops with limitations in xpu. 4. remove skipIfXpu according to current status. Pull Request resolved: pytorch#178849 Approved by: https://github.com/jansel, https://github.com/guangyey
oneMKL provides no half-precision DFT, so torch-xpu-ops emulates one: it upcasts Half to Float, runs both the transform and the normalization in float32, and rounds to complex32 once at the end. Separately, pytorch#171231 added "xpu" to maybe_support_half in torch/_refs/fft.py, which tells the reference implementation that XPU supports half natively. The ref consequently stays in float16 and rounds at every prim boundary, while the eager path it is compared against quietly computed in float32. test_python_ref, test_python_ref_torch_fallback and test_python_ref_executor assert ref_distance <= torch_distance against a float64 baseline with no tolerance, so the ref loses that comparison: 1.18x worse for ihfftn and 1.02x for ihfft2, on 1 of 10 OpInfo samples. The XPU kernel is not wrong here; it is more accurate than true float16 would be. No user-visible path is affected, because inductor promotes float16 FFT to float32 (pytorch#180766) rather than lowering through these refs, and compiled output is bit-identical to eager. This adds five xpu-scoped, float16-only skips beside the existing cuda ones for _refs.fft.ihfft2 and _refs.fft.ihfftn. It is a pure addition and leaves CUDA behaviour untouched. Three routes were available. Widening the existing decorators to device_type=("cuda", "xpu") is terser, but it would attach comments describing CUDA's native-float16 rounding to a structurally different XPU cause, so the skips are added as separate entries carrying their own reason - which also matches the pattern established by pytorch#176688 and pytorch#178849. Adding a tolerance to the assertion itself would treat the cause and let CUDA, ROCm and XPU all drop skips, but that single assertion guards every test_python_ref case on every backend and dtype, so it needs primTorch ownership rather than an XPU change. Making the refs compute in float32 and cast back to complex32 is the only route that preserves coverage, but it puts device-conditional numerics inside a deliberately device-agnostic reference library; that is left for discussion on the linked issue. These three tests are currently unreachable on XPU because of the @skipXPU decorators on them in test/test_ops.py, which are being removed incrementally (pytorch#159944 introduced them, pytorch#176688 and pytorch#178849 have removed most). Declaring the skips here is the prerequisite for removing the remaining ones without turning XPU CI red. Test Plan Verified on Intel Arc B570 Graphics (Battlemage). With both skip sources disabled, exactly five cases fail; with this change they are skipped and the rest of the selection still passes. ``` cd third_party/torch-xpu-ops python -m pytest test/xpu/test_ops_xpu.py \ -k "python_ref and (ihfft2 or ihfftn)" -v --timeout=600 ``` ``` before (both skip sources disabled): 5 failed, 11 passed after (this change): 0 failed, 68 passed, 14 skipped ``` The skip set was additionally cross-checked by evaluating DecorateInfo.is_active over both ops, all three tests and all ten instantiated dtypes for device_type in (cuda, xpu): it matches the five measured failures exactly, and CUDA's set is unchanged. ``` lintrunner -a torch/testing/_internal/opinfo/definitions/fft.py ok No lint issues. ``` Authored with the assistance of an AI coding agent; the change and the test output above come from a run on Intel GPU hardware and were reviewed by a human before submission. AI-Assisted: Claude Code (xpu-workspace ai_assisted agent, issue pytorch#174) Co-Authored-By: Claude Opus 5 <[email protected]>
Add more cases in test_ops.py
1. Generalize TestCommon, TestCompositeCompliance, TestMathBits, TestFakeTensor, TestForwardADWithScalars with onlyAccelerator
2. Enable xpu test with instantiate_device_type_tests() allow_xpu=True augment
3. skip cases or ops with limitations in xpu.
4. remove skipIfXpu according to current status.
Stack from ghstack (oldest at bottom):