Skip to content

[upstream #2779] Accuracy failures in logspace op#18

Draft
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-191
Draft

[upstream #2779] Accuracy failures in logspace op#18
Stonepia wants to merge 1 commit into
mainfrom
agent/issue-191

Conversation

@Stonepia

Copy link
Copy Markdown
Collaborator

[upstream pytorch#2779] Accuracy failures in logspace op

Fixes https://github.com/intel-sandbox/torch-xpu-ops-exp/issues/191

Root Cause: The logspace decomposition in torch/_refs/init.py computes pow(base, linspace(...)) in float64 then truncates to integer dtype via _maybe_convert_to_dtype. For integer dtypes, floating-point precision errors in pow() produce values like 99.99999999 which truncate to 99 instead of 100, causing one-off accuracy failures.

Failed Tests:

  • test_decomp_xpu.py::TestDecompXPU::test_comprehensive_logspace_tensor_overload_xpu_int16
  • test_decomp_xpu.py::TestDecompXPU::test_comprehensive_logspace_tensor_overload_xpu_int32
  • test_decomp_xpu.py::TestDecompXPU::test_comprehensive_logspace_tensor_overload_xpu_int64
  • test_decomp_xpu.py::TestDecompXPU::test_comprehensive_logspace_xpu_int16
  • test_decomp_xpu.py::TestDecompXPU::test_comprehensive_logspace_xpu_int32
  • test_decomp_xpu.py::TestDecompXPU::test_comprehensive_logspace_xpu_int64
  • test_decomp_xpu.py::TestDecompXPU::test_quick_logspace_tensor_overload_xpu_int16
  • test_decomp_xpu.py::TestDecompXPU::test_quick_logspace_tensor_overload_xpu_int32
  • test_decomp_xpu.py::TestDecomXPU::test_quick_logspace_tensor_overload_xpu_int64
  • test_decomp_xpu.py::TestDecompXPU::test_quick_logspace_xpu_int16
  • test_decomp_xpu.py::TestDecompXPU::test_quick_logspace_xpu_int32
  • test_decomp_xpu.py::TestDecompXPU::test_quick_logspace_xpu_int64

Diff stat:

torch/_refs/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

[upstream pytorch#2779] Accuracy failures in logspace op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant