intel / intel/torch-xpu-ops

[Bug Skip]: test_ops_xpu.py python_ref ihfft2/ihfftn float16 reference farther than torch result

Open
#5,271 1 comment 0 reactions 1 assignee Claimed by @astachowiczhabana View on GitHub
skipped test: ut
Dominant language
Python
Stars
113
Forks
128
Avg merge
5d 13h
Merged PRs (30d)
107

Description

## Description

Three `test_ops_xpu.py` python-reference cases for `fft.ihfft2`/`fft.ihfftn` fail on XPU with `float16` because the `_refs` reference result is farther from the precise (double-precision) computation than the eager torch result.

This is an accuracy gap (not the empty-batch oneMKL config error tracked in #4980, and not `hfft2` in #3796). The `float16` variants of these specific tests were excluded from the #4980 child-issue series.

## Affected Test Cases

```
test_ops_xpu.py::TestCommonXPU::test_python_ref__refs_fft_ihfft2_xpu_float16
test_ops_xpu.py::TestCommonXPU::test_python_ref__refs_fft_ihfftn_xpu_float16
test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallback__refs_fft_ihfftn_xpu_float16
```

## Error Message

```
AssertionError: tensor(False, device='xpu:0') is not true : Reference result was farther (0.0648.../0.0541...) from the precise computation than the torch result was (0.0549.../0.0531...)!

Caused by reference input at index 0:
SampleInput(input=Tensor[size=(2, 8, 16), device="xpu:0", dtype=torch.float16], args=(), kwargs={'s': (4,8), 'dim': (1,2), 'norm': 'ortho'})
```

## Repro

```
PYTORCH_OPINFO_SAMPLE_INPUT_INDEX=0 PYTORCH_TEST_WITH_SLOW=1 \
python test/test_ops.py TestCommonXPU::test_python_ref__refs_fft_ihfft2_xpu_float16
```

## Related

- #4980 (empty-batch oneMKL FFT error, different root cause)
- #3796 (same symptom class for hfft2, CLOSED/skipped)

---
_Issue drafted with the assistance of an AI agent and reviewed/approved before filing._

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.