intel / intel/torch-xpu-ops

[DLE 2026.1 / XPU] `expandable_segments:True` regresses on BMG — `DEVICE_LOST` in xccl collectives (and a matching FSDP2 hang); clean on DLE 2025.3

Open
#4,427 2 comments 0 reactions 1 assignee Assigned to @newtdms View on GitHub
module: distributed
Dominant language
Python
Stars
113
Forks
128
Avg merge
5d 9h
Merged PRs (30d)
112

Description

### 🐛 Describe the bug

Hi,

We hit a reproducible regression on Intel Arc Pro B70 (BMG, 2-GPU, PCIe) that
appears when the PyTorch XPU caching allocator runs in **`expandable_segments`**
mode. It is **new in the DLE 2026.1 runtime** — the identical repro passes on
DLE 2025.3. There are two surface symptoms that we've traced to the same trigger.

Setting `PYTORCH_ALLOC_CONF=expandable_segments:True` (the shared alloc-conf; the
CUDA-named `PYTORCH_CUDA_ALLOC_CONF` alias also reaches the XPU allocator) makes
the allocator hand out virtual-memory (VMM/USM) blocks. On DLE 2026.1, downstream
use of those blocks fails:

1. **Collective path → crash.** A 256 MiB `all_reduce` (the log prints `268MB`
decimal) on such a buffer dies at the next `torch.xpu.synchronize()` with
`RuntimeError: level_zero backend failed with error: 20 (UR_RESULT_ERROR_DEVICE_LOST)`.
Minimal (~40-line repro, no model/FSDP).
2. **Local FSDP2 path → hang.** A real 2-GPU FSDP2 step-1 forward hangs (no
collective involved) at a single-scalar device→host copy
(`_can_skip_causal_mask_xpu` → `.item()` → `appendUSMMemcpy`, L0-v2 adapter).
Both ranks ~97% CPU, no error.

Same trigger, same fix (don't set `expandable_segments` on XPU). Flipping only that
one env var flips each case between pass and fail.

Same box, same GPU kernel driver (26.22.38646) throughout; only the DLE runtime set
differs. Full `collect_env` for both stacks is in the repo.

| torch | oneCCL | DLE | `expandable_segments:True` + 256 MiB `all_reduce` |
|---|---|---|---|
| 2.13.0+xpu (stable) | 2022.0 | 2026.1 | ❌ DEVICE_LOST |
| 2.14 nightly | 2022.0 | 2026.1 | ❌ DEVICE_LOST |
| **2.13 nightly** | **2021.17** | **2025.3** | ✅ SURVIVED ← torch held at 2.13, only runtime changed |
| 2.12.0+xpu | 2021.17 | 2025.3 | ✅ SURVIVED |

## Ask

On DLE 2026.1, could you look at how the oneCCL / L0-v2 collective path handles
buffers from the `expandable_segments` (VMM/USM) allocator? Specifically:
- the collective that crashes at `torch.xpu.synchronize()` with `DEVICE_LOST`, and
- the immediate-in-order-queue `appendUSMMemcpy` that hangs when FSDP2 work is
pending (details + gdb/py-spy stacks in the scalar-copy-hang folder).

[repro.py](https://gist.github.com/kahlun/ea98703ef15a2f28629f3a6caf615028)

### log
for the detail log, can pm me. Because put in internal repository. But sent to panas for the log

## extra information on non docker image or proper setup steps.
--
the current native machine.

Both installed as plain pip wheels into isolated venvs. Both pull the same runtime on their own: oneCCL 2022.0 + intel-sycl-rt 2026 (libsycl.so.9), xpu_build=20260000. No DLE image anywhere.

Stack (native pip, no DLE) EXPANDABLE=1 EXPANDABLE=0

torch 2.13.0+xpu (stable) ❌ DEVICE_LOST at synchronize() (catchable RuntimeError) ✅ SURVIVED (val=2.0)

torch 2.14.0.dev20260722+xpu (nightly) ❌ SIGABRT — oneCCL send_entry.hpp:109 SEND failed / OFI Bad address(14) ✅ SURVIVED (val=2.0)

Both flip deterministically on the one env var. So yes — the bug reproduces natively, with the public wheel, on both torch versions. No DLE required.

--

The impacted libraray opensource framework, [LlamaFactory](https://github.com/hiyouga/LlamaFactory) V1, verl + vllm, but can turn off with vendor hardware design (https://github.com/verl-project/verl)

### Versions

((venv) ) (base) sdp@spr818157:~/lun$ docker run --rm intel/deep-learning-essentials:2026.1.0-devel-ubuntu24.04 wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py && python collect_env.py
--2026-07-23 05:13:05-- https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving proxy-dmz.intel.com (proxy-dmz.intel.com)... 10.7.211.16
Connecting to proxy-dmz.intel.com (proxy-dmz.intel.com)|10.7.211.16|:912... connected.
Proxy request sent, awaiting response... 200 OK
Length: 31107 (30K) [text/plain]
Saving to: ‘collect_env.py’

0K .......... .......... .......... 100% 55.0M=0.001s

2026-07-23 05:13:05 (55.0 MB/s) - ‘collect_env.py’ saved [31107/31107]

Collecting environment information...
=====================================
PyTorch version: 2.11.0+xpu
PyTorch CXX11 ABI: Yes
IPEX version: N/A
IPEX commit: N/A
Build type: N/A

OS: Ubuntu 24.04.2 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Clang version: N/A
IGC version: N/A
CMake version: version 3.28.3
Libc version: glibc-2.39

Python version: 3.12.13 | packaged by conda-forge | (main, Mar 5 2026, 16:50:00) [GCC 14.3.0] (64-bit runtime)
Python platform: Linux-7.0.0-28-generic-x86_64-with-glibc2.39
Is XPU available: N/A
DPCPP runtime: N/A
MKL version: N/A

GPU models and configuration onboard:
* Intel(R) Arc(TM) Pro B70 Graphics
* Intel(R) Arc(TM) Pro B70 Graphics

GPU models and configuration detected:
N/A

Driver version:
* intel_opencl: 26.22.38646.6-1~24.04~ppa1
* level_zero: N/A

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 57 bits virtual
Byte Order: Little Endian
CPU(s): 72
On-line CPU(s) list: 0-71
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) w9-3475X
CPU family: 6
Model: 143
Thread(s) per core: 2
Core(s) per socket: 36
Socket(s): 1
Stepping: 8
CPU(s) scaling MHz: 23%
CPU max MHz: 4800.0000
CPU min MHz: 800.0000
BogoMIPS: 4416.00
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 1.7 MiB (36 instances)
L1i cache: 1.1 MiB (36 instances)
L2 cache: 72 MiB (36 instances)
L3 cache: 82.5 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-71
Vulnerability Gather data sampling: Not affected
Vulnerability Ghostwrite: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Old microcode: Vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Versions of relevant libraries:
[conda] dpcpp-cpp-rt 2025.3.2 pypi_0 pypi
[conda] impi-rt 2021.17.2 pypi_0 pypi
[conda] intel-cmplr-lib-rt 2025.3.2 pypi_0 pypi
[conda] intel-cmplr-lib-ur 2025.3.2 pypi_0 pypi
[conda] intel-cmplr-lic-rt 2025.3.2 pypi_0 pypi
[conda] intel-opencl-rt 2025.3.2 pypi_0 pypi
[conda] intel-openmp 2025.3.2 pypi_0 pypi
[conda] intel-pti 0.16.0 pypi_0 pypi
[conda] intel-sycl-rt 2025.3.2 pypi_0 pypi
[conda] mkl 2025.3.1 pypi_0 pypi
[conda] numpy 2.4.4 pypi_0 pypi
[conda] nvidia-cuda-cupti 13.0.85 pypi_0 pypi
[conda] nvidia-nccl-cu13 2.28.9 pypi_0 pypi
[conda] oneccl 2021.17.2 pypi_0 pypi
[conda] oneccl-devel 2021.17.2 pypi_0 pypi
[conda] onemkl-license 2025.3.1 pypi_0 pypi
[conda] onemkl-sycl-blas 2025.3.1 pypi_0 pypi
[conda] onemkl-sycl-dft 2025.3.1 pypi_0 pypi
[conda] onemkl-sycl-lapack 2025.3.1 pypi_0 pypi
[conda] onemkl-sycl-rng 2025.3.1 pypi_0 pypi
[conda] onemkl-sycl-sparse 2025.3.1 pypi_0 pypi
[conda] torch 2.12.0+xpu pypi_0 pypi
[conda] torchao 0.17.0+xpu pypi_0 pypi
[conda] torchaudio 2.11.0+xpu pypi_0 pypi
[conda] torchdata 0.11.0 pypi_0 pypi
[conda] torchtitan 0.2.2 pypi_0 pypi
[conda] torchvision 0.27.0+xpu pypi_0 pypi
[conda] transformers 4.54.1 pypi_0 pypi
((venv) ) (base) sdp@spr818157:~/lun$

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.