Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159944
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6f27e20 with merge base ebfc87e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
guangyey
left a comment
There was a problem hiding this comment.
Just one nit: clarify the reason why we skip a few cases.
Otherwise, LGTM.
|
@EikanWang, which Meta maintainer should we request review from? |
| skipCUDAIf(not PLATFORM_SUPPORTS_MEM_EFF_ATTENTION, "This platform doesn't support efficient attention"), | ||
| skipCUDAIf(TEST_WITH_ROCM, "Efficient attention on ROCM doesn't support custom_mask_type==2")], | ||
| skipCUDAIf(TEST_WITH_ROCM, "Efficient attention on ROCM doesn't support custom_mask_type==2"), | ||
| skipXPU, ], |
There was a problem hiding this comment.
| skipXPU, ], | |
| skipXPU], |
There was a problem hiding this comment.
Hi, @EikanWang, seems most of the 'decorators' augment in op_db has ',' followed the last item of the list. See link1 and link2.
| "cusparseSDDMM was added in 11.2.1"), | ||
| skipCPUIfNoMklSparse, ], | ||
| skipCPUIfNoMklSparse, | ||
| skipXPU, ], |
There was a problem hiding this comment.
| skipXPU, ], | |
| skipXPU], |
There was a problem hiding this comment.
Hi, @EikanWang, seems most of the 'decorators' augment in op_db has ',' followed the last item of the list. See link1 and link2.
| torch_to_numpy_dtype_dict, numpy_to_torch_dtype, TEST_WITH_ASAN, | ||
| GRADCHECK_NONDET_TOL, slowTest, TEST_WITH_SLOW, | ||
| TEST_WITH_TORCHINDUCTOR, MACOS_VERSION | ||
| TEST_WITH_TORCHINDUCTOR, MACOS_VERSION, skipIfXpu, |
There was a problem hiding this comment.
| TEST_WITH_TORCHINDUCTOR, MACOS_VERSION, skipIfXpu, | |
| TEST_WITH_TORCHINDUCTOR, MACOS_VERSION, skipIfXpu |
There was a problem hiding this comment.
@EikanWang seems a lot of imports in this file with ',' added after the last one, link1 and link2
| skipCUDAIfNoCusolver, skipCPUIfNoLapack, skipCPUIfNoFFT, skipCUDAIf, precisionOverride, | ||
| skipCPUIfNoMklSparse, | ||
| toleranceOverride, tol) | ||
| toleranceOverride, tol, skipXPU, ) |
There was a problem hiding this comment.
| toleranceOverride, tol, skipXPU, ) | |
| toleranceOverride, tol, skipXPU) |
There was a problem hiding this comment.
@EikanWang seems a lot of imports in this file with ',' added after the last one, link1 and link2
There was a problem hiding this comment.
@daisyden , I don't believe the example can convince me, although I think it is a nit change.
There was a problem hiding this comment.
Updated, thanks!
|
@daisyden , has this PR been ready for the community review? If so, pls. refine the title by removing |
|
@EikanWang Yes, the PR is ready for community review. Please help to involve reviewers. Thanks. |
|
@daisyden, please address Eikan‘s suggestions. |
|
@jeffdaily @malfet , please help to review this PR. Thanks. |
Replied, thanks. |
|
@pytorchbot rebase |
|
@daisyden please rebase this PR before land it. |
52d408e to
2fa71d4
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
2fa71d4 to
6f27e20
Compare
|
@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: 1 jobs have failed, first few of them are: linux-aarch64 / linux-jammy-aarch64-py3.10 / test (default, 1, 3, linux.arm64.m8g.4xlarge) Details for Dev Infra teamRaised by workflow job |
|
@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 |
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]>
For #114850, we will port aten unit tests to Intel GPU. This PR will work on some test case of test/test_ops.py. We could enable Intel GPU with following methods and try the best to keep the original code styles:
cc @gujinghui @EikanWang @fengyuan14 @guangyey