Repository navigation
Description
On nvidia-dev, the direct translator meets the two halves of a one-wave split compute group (33–64 threads) through the counter exchange instead of a group barrier, and that costs one retail program 2.6x its GPU time (8.4 → 3.3 ms a frame on an RTX 3090). The reason given for the counters is #1727's GPU hangs, but #1727 was later bisected to the sparse VRAM test (#614), and in 16 parallel test runs here barrier meets did not hang.
Where it comes from
1be95b1b"Direct DXIL: one split console wave of a compute or mesh group exchanges by counters" (innvidia-devthrough aworld-mainmerge, not a PR; its message says "Not run on a GPU"). It applies Direct DXIL: bound single-wave split exchanges #1741 by hand, for Direct DXIL: split wave64 uses a group barrier for 1-wave groups – GPU hangs in parallel test runs on NVIDIA (RTX 5070) #1727. The comment is incrates/xcl/src/gpu/dxil/kernel.rs(thelw.partner = match tinLw::new).- On Direct DXIL: split wave64 uses a group barrier for 1-wave groups – GPU hangs in parallel test runs on NVIDIA (RTX 5070) #1727, IgorAntunes66 bisected the hangs to
gpu_sparse_vram_descriptors_buffers_and_xmemrunning beside the other GPU tests: a local patch with the counter exchange for one-wave groups hung exactly as often (9/15 vs 9/15), and Tests: the sparse VRAM test no longer depends on what ran before it #614 removed the hangs. @upipibi (RTX 3070) and @PHeitor1 (RTX 5060 Ti) confirmed 0 hangs with Tests: the sparse VRAM test no longer depends on what ran before it #614, which is innvidia-dev. - The HLSL path on
nvidia-devmeets these groups at a group barrier by design (x64_spin_forinrecomp/emit.rs: "the barrier costs a fraction of the counters", Recompiler: split wave64 spin loops poll with a compare-exchange, not an add of 0 (#847) #1244).
Measured (RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, release; tree nvidia-dev 54225f58 + #609 + #2551 + local profiling hooks)
A local switch gives a compute group of one console wave Partner::Present (group barrier) again. It also keeps such a group's lanes past a thread limit in, with their EXEC bits clear (compute_gate without leave), so neither half can leave before an exchange. The per-lane bridge form (recomp::lower_dxil) keeps the counters, since one half can be in a block alone there. Mesh programs are not changed.
- Hangs:
cargo test --release -p xcl --lib -- gpu --test-threads=4withXCL_DIRECT_DXIL=1, the two arms interleaved, 16 runs each: 0 hangs or device removals in either arm. With barriers, the same 7 tests fail in every run, all of them assertions of the counter form (a_single_split_wave_of_a_compute_group_exchanges_without_a_group_barrier,split_lds_reads_meet_after_writes,a_split_wave64_compute_program_stays_whole, threedispatch_chain_*"stays whole" checks) and a cache test the switch bypasses. All other GPU tests passed, includinggpu_compute_thread_limits_leave_the_lanes_past_them_out. (A separate abort, "coherent window could not be restored … error 487", hit both arms in some runs of a first batch; it is not related to this.) - Retail title, 700 s each, no crash or device removal,
XCL_GPU_TIMES=16,420(16 frames from 420 s), same inputs:
b78fa10b425b8e54 (CS_DepthProcessingHBO, 160x90 groups, split in halves) |
all programs | split-halves programs | frame (wall) | |
|---|---|---|---|---|
counters (nvidia-dev today) |
8.4 ms | 159.1 ms | 51.7 ms | 144.7 ms |
| group barrier | 3.3 ms | 155.9 ms | 45.6 ms | 147.3 ms |
| HLSL form (for reference) | 3.2 ms | 145.9 ms |
The program's direct DXIL with counters has 137 spin exchanges (an atomic add, a wait loop of atomics and two fences each); with the barrier it has 269 group barriers, and its DXIL shrinks from 126 KB to 89 KB. The frame time does not move: on this tree other work bounds the frame, so this is GPU time freed, not frames gained yet. The remaining ~46 ms in split programs are mostly groups of several console waves, which need the counters (C22 on #3011 is about those).
Suggestion: give one-wave split compute groups the group barrier again on the direct path, as the HLSL path has, with the early-leave guard above and the counter-form tests changed to match. I have not opened a PR; I can, if this direction is wanted. The direct exchange also meets twice per exchange where the HLSL one meets once (double-buffered slots), which could halve the barriers again.
Not tested: Blackwell (#1727's hangs were on RTX 5070 / 5060 Ti) and other NVIDIA cards; AMD with the split form forced; output equality in play (the picture is black on this tree); mesh programs; the retail driver time-out 1be95b1b's message also mentions (I saw none in this run).
AI use: Claude Code (Claude Opus 5.5) wrote the local switch, ran the tests and the runs, and drafted this issue; I checked the numbers against the logs.
Activity