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 |
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.