Conversation
_histc_out_xpu computed into a fresh tensor of the input dtype and then did result.copy_(ret). copy_ converts, so a float64 histogram written into an int64 out= was silently truncated. CPU rejects the same call in histogramdd_prepare_out, which the XPU out variant does not go through. Add the CPU-matching TORCH_CHECK before resize_output so a rejected call leaves the caller tensor untouched. Remove test_out_histc from the skip list. De-scope the tuple device_type xfail in align_db_decorators so the now-passing test does not report an unexpected success. Fixes intel#5237. Test Plan: ``` python -m py_compile test/regressions/test_histc.py test/xpu/xpu_test_utils.py test/xpu/skip_list_common.py git diff --check ```
164c184 to
ea4c1d7
Compare
|
@laifenxiawucha could you check this out so that I can get the CI rolling |
|
@laifenxiawucha can we start the CI on this specific commit - I do see a CI workflow has been run but idk where it ran tho.......been searching for a good 15 mins. Could we start the CI on this specific commit. I'm super sorry if its something stupid from my end |
|
Hi @N0AHZACH .No worries at all — this is likely not an issue on your side. Since the PR is from a fork, some CI jobs may need maintainer approval before they can start. That’s probably why you can see a workflow run but not the full CI for this specific commit. |
|
Thanks @laifenxiawucha. I traced the four failing checks and they are stale, not caused by this change. The
Both come from PyTorch main relocating the wheel build scripts to The change itself is already validated on hardware. In run 35050000160 (
Could you approve/start CI on |
|
can we get a CI running on this please |
There was a problem hiding this comment.
This PR will make the test_histc_out_dtype test to fail with Unexpected success - that should be fixed by removing the expectedFailureXPU from the upstream test directly, after this PR is merged - like in this PR pytorch/pytorch#199126
| elif ( | ||
| isinstance(wrapper.device_type, (list, tuple)) | ||
| and "xpu" in wrapper.device_type | ||
| and unittest.expectedFailure in wrapper.decorators | ||
| and (op_name, wrapper.test_name) in _cuda_xfail_xpu_pass | ||
| ): |
There was a problem hiding this comment.
This elif: branch is not needed anymore. I suggest to remove it. The upstream ("cuda", "xpu") tuple was removed, so it is now dead code for the failing test case we are talking about.
There was a problem hiding this comment.
ahhh okay - gotchu. will push an update shortly.
There was a problem hiding this comment.
Please correct me if I am wrong, but it looks like the upstream test test_histc_out_dtype added by you in test_reductions.py file already covers this regression scope - am I right? torch-xpu-ops repo currently imports the upstream test file and launches it, so it also launched this test_histc_out_dtype test. If my understanding above is correct, then I suggest to remove this new regression test from torch-xpu-ops and remove expectedFailureXPU from the upstream test_histc_out_dtype as a follow up PR. Because it now looks like unnecessary code duplication.
There was a problem hiding this comment.
okayyyy - I shall fix that then....
There was a problem hiding this comment.
It looks like the line:
("histc", "test_out"),should be removed in this PR also from _cuda_xfail_xpu_pass.
|
I'm actually still working on this - personal life caught up to me a lil. But I am still working on this ! |
|
No problem @N0AHZACH 😉 |
The upstream ("cuda", "xpu") xfail for (histc, test_out) was removed in
pytorch/pytorch#196100, so the tuple de-scope branch added to
align_db_decorators never matches a wrapper, and ("histc", "test_out")
in _cuda_xfail_xpu_pass no longer refers to any DecorateInfo. Remove
both, per review.
Delete test/regressions/test_histc.py: upstream test_histc_out_dtype in
test/test_reductions.py covers the same mismatched out= dtype regression
and torch-xpu-ops runs it through test_reductions_xpu.py.
The fix itself is unchanged: the CPU-matching TORCH_CHECK in
_histc_out_xpu before resize_output, plus dropping
test_out_histc_xpu_float32 from the op_ut skip list.
Test Plan:
python -m py_compile test/xpu/xpu_test_utils.py
python -m flake8 test/xpu/xpu_test_utils.py
clang-format --dry-run --Werror src/ATen/native/xpu/SummaryOps.cpp
git diff --check
|
@BBBela I pushed some new updates sooo please CI? |
The job hunts just got real. I got that insane reality check the open-source aint gonna help me keep the lights on😂. 1000+ rejections and a gizzilion more to go. |
@N0AHZACH CI launched. Don't bother if there are some failing test cases. They can be sometimes flaky. One think to do - please update the PR description as it is outdated after recent changes. |
Fixes #5237.
_histc_out_xpucomputed the histogram in the input dtype via_histc_xpuand then did
resize_output+result.copy_(ret).copy_casts silently,so a float64 histogram written into an int64
out=was truncated with noerror. CPU rejects the same call in
histogramdd_prepare_out(
aten/src/ATen/native/Histogram.cpp:132), so this was a CPU-vs-XPUargument-validation divergence.
Changes:
src/ATen/native/xpu/SummaryOps.cpp: add the CPU-matchingTORCH_CHECKbefore
resize_outputso a rejected call leaves the caller tensoruntouched. Message text matches CPU verbatim and matches upstream
Fix histc(out=) dtype validation mismatch between CPU and CUDA pytorch/pytorch#196100 for CUDA.
test/xpu/xpu_test_utils.py: de-scope tupledevice_type=("cuda", "xpu")xfails gated on
_cuda_xfail_xpu_passby dropping onlyxpufrom thescope. Without this the fixed test reports an unexpected success.
test/xpu/skip_list_common.py: removetest_out_histc_xpu_float32.test/regressions/test_histc.py: regression coverage for mismatchedout=rejection and matching-dtype success.This does not depend on pytorch/pytorch#196100 landing and does not
conflict with it.