torchbench hf_T5_large train float32 RuntimeError: Trying to create tensor with negative dimension
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 107
Description
### 🐛 Describe the bug
There is `RuntimeError: Trying to create tensor with negative dimension -32: [-32]` for torchbench **hf_T5_large** train float32 on Windows with Intel XPU (Arc B580).
```
loading model: 0it [00:00, ?it/s]W0711 14:56:34.424000 7912 site-packages\torch\utils\_pytree.py:630] is an Enum subclass and is now natively supported by torch.compile as an opaque value type. Calling register_constant() on Enum subclasses is deprecated and will be an error in a future release.
W0711 14:56:34.584000 7912 site-packages\torch\utils\_pytree.py:630] is an Enum subclass and is now natively supported by torch.compile as an opaque value type. Calling register_constant() on Enum subclasses is deprecated and will be an error in a future release.
loading model: 0it [00:23, ?it/s]
xpu train hf_T5_large
Traceback (most recent call last):
File "C:\Users\gta\repositories\pytorch\pytorch\benchmarks\dynamo\common.py", line 2079, in validate_model
self.model_iter_fn(model, example_inputs)
File "C:\Users\gta\repositories\pytorch\pytorch\benchmarks\dynamo\torchbench.py", line 488, in forward_and_backward_pass
self.grad_scaler.scale(loss).backward()
File "C:\Users\gta\miniforge3\envs\202607091418_140e4d58_32.0.101.8826_2026.0.0.644\Lib\site-packages\torch\_tensor.py", line 623, in backward
torch.autograd.backward(
File "C:\Users\gta\miniforge3\envs\202607091418_140e4d58_32.0.101.8826_2026.0.0.644\Lib\site-packages\torch\autograd\__init__.py", line 395, in backward
_engine_run_backward(
File "C:\Users\gta\miniforge3\envs\202607091418_140e4d58_32.0.101.8826_2026.0.0.644\Lib\site-packages\torch\autograd\graph.py", line 979, in _engine_run_backward
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Trying to create tensor with negative dimension -32: [-32]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\gta\repositories\pytorch\pytorch\benchmarks\dynamo\common.py", line 4799, in run
) = runner.load_model(
^^^^^^^^^^^^^^^^^^
File "C:\Users\gta\repositories\pytorch\pytorch\benchmarks\dynamo\torchbench.py", line 384, in load_model
self.validate_model(benchmark.name, model, example_inputs)
File "C:\Users\gta\repositories\pytorch\pytorch\benchmarks\dynamo\common.py", line 2081, in validate_model
raise RuntimeError("Eager run failed") from e
RuntimeError: Eager run failed
eager_fail_to_run
```
### Versions
Click to expand traceback
PyTorch version: 2.14.0a0+git140e4d5
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: Microsoft Windows 11 Pro (10.0.26100 64-bit)
GCC version: Could not collect
Clang version: Could not collect
CMake version: version 3.31.6
Libc version: N/A
Python version: 3.12.13 | packaged by conda-forge | (main, Mar 5 2026, 16:36:12) [MSC v.1944 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-11-10.0.26100-SP0
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: True
XPU used to build PyTorch: 20260000
Intel GPU driver version:
* 32.0.101.8826 (20260529000000.******+***)
Intel GPU models onboard:
* Intel(R) Arc(TM) B580 Graphics
Intel GPU models detected:
* [0] _XpuDeviceProperties(name='Intel(R) Arc(TM) B580 Graphics', platform_name='Intel(R) oneAPI Unified Runtime over Level-Zero V2', type='gpu', device_id=0xE20B, uuid=86800be2-0000-0000-0400-000000000000, driver_version='1.15.37858', total_memory=11875MB, local_mem_size=128KB, last_level_cache_size=18432KB, max_compute_units=160, memory_clock_rate=0MHz, memory_bus_width=64-bit, gpu_eu_count=160, gpu_subslice_count=20, max_work_group_size=1024, max_num_sub_groups=64, sub_group_sizes=[16 32], has_fp16=1, has_fp64=1, has_atomic64=1, is_integrated_gpu=0)
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False
Caching allocator config: N/A
CPU:
Name: Intel(R) Core(TM) Ultra 5 245K
Manufacturer: GenuineIntel
Family: 773
Architecture: 9
ProcessorType: 3
DeviceID: CPU0
CurrentClockSpeed: 3071
MaxClockSpeed: 4200
L2CacheSize: 26624
L2CacheSpeed: None
Revision: None
Versions of relevant libraries:
[pip3] bert_pytorch==0.0.1a4
[pip3] functorch==1.14.0a0+b71aa0b
[pip3] intel-openmp==2026.1.0
[pip3] mkl-include==2026.0.0
[pip3] mkl-static==2026.0.0
[pip3] mypy==2.2.0
[pip3] mypy_extensions==1.1.0
[pip3] numpy==2.3.2
[pip3] onemkl-license==2026.0.0
[pip3] onnx==1.21.0
[pip3] onnx-ir==0.1.16
[pip3] onnxscript==0.6.2
[pip3] optree==0.13.0
[pip3] pytorch-labs-segment-anything-fast==0.2
[pip3] tbb==2023.0.0
[pip3] tbb-devel==2023.0.0
[pip3] tcmlib==1.5.0
[pip3] torch==2.14.0a0+git140e4d5
[pip3] torch_geometric==2.4.0
[pip3] torchao==0.17.0
[pip3] torchaudio==2.11.0a0+c0cbdb9
[pip3] torchbench==0.1
[pip3] torchmetrics==1.9.0
[pip3] torchmultimodal==0.1.0b0
[pip3] torchrec-nightly==2022.4.26
[pip3] torchvision==0.29.0a0+0bc41e6
[pip3] torchx-nightly==2026.7.9
[pip3] triton-xpu==3.7.2+git5fcc14d9
[conda] bert-pytorch 0.0.1a4 dev_0
[conda] functorch 1.14.0a0+b71aa0b pypi_0 pypi
[conda] intel-openmp 2026.1.0 pypi_0 pypi
[conda] mkl-include 2026.0.0 pypi_0 pypi
[conda] mkl-static 2026.0.0 pypi_0 pypi
[conda] numpy 2.3.2 pypi_0 pypi
[conda] onemkl-license 2026.0.0 pypi_0 pypi
[conda] optree 0.13.0 pypi_0 pypi
[conda] pytorch-labs-segment-anything-fast 0.2 pypi_0 pypi
[conda] tbb 2023.0.0 pypi_0 pypi
[conda] tbb-devel 2023.0.0 pypi_0 pypi
[conda] tcmlib 1.5.0 pypi_0 pypi
[conda] torch 2.14.0a0+git140e4d5 pypi_0 pypi
[conda] torch-geometric 2.4.0 pypi_0 pypi
[conda] torchao 0.17.0 pypi_0 pypi
[conda] torchaudio 2.11.0a0+c0cbdb9 pypi_0 pypi
[conda] torchbench 0.1 pypi_0 pypi
[conda] torchmetrics 1.9.0 pypi_0 pypi
[conda] torchmultimodal 0.1.0b0 pypi_0 pypi
[conda] torchrec-nightly 2022.4.26 pypi_0 pypi
[conda] torchvision 0.29.0a0+0bc41e6 pypi_0 pypi
[conda] torchx-nightly 2026.7.9 pypi_0 pypi
[conda] triton-xpu 3.7.2+git5fcc14d9 pypi_0 pypi
Contributor guide
Research direction
Reproduce the torchbench hf_T5_large train float32 run on Windows with Intel XPU, then trace the failure from benchmarks/dynamo/torchbench.py:488 through benchmarks/dynamo/common.py:2079. Investigate where backward creates the negative dimension and compare the eager validation path. Done means the model completes eager validation without the negative-dimension error, with a regression check if an appropriate test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100