Compute TG_SIZE: a partial last wave counts #134
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/136"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-23T14:48:41Z.
From #105's "also noticed": "
Mode::Computetg_sizeuses truncating division instead ofdiv_ceil".TG_SIZE (the SGPR after the group ids, wave count | wave index << 6) was emitted as
threads / lanes, truncated. A group that is not a multiple of the wave size has a last, partial wave, so:A program that uses the count (to size a cross-wave reduction, or to know how many waves reach an LDS slot) skipped the last wave. The count is now the ceiling, computed when the HLSL is made (a constant, as before).
The retail pack never enables TG_SIZE (
CsInterface::tg_sizedoc), so no translated pack program changes. Only compute programs that enable it get different HLSL.Test:
gpu_compute_tg_size_counts_a_partial_last_wave. Every thread stores TG_SIZE, for 96 / 64 / 128 threads in wave64 and 96 / 40 in wave32 (split wave64 on 32-lane GPUs). Before:96 threads, wave64: thread 0 – left: 1, right: 2. After: all pass.Run: RTX 5070 Ti, driver 32.0.16.1742.
cargo test --workspace --no-fail-fast -- --test-threads=4onmain95bda11: 549 passed, 0 failed, 37 ignored.AI-assisted.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-23T14:48:52Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ivall/xcl. Originally posted by WarmMilkCodes on 2026-11-23T18:55:08Z.
Tested #136
1058c0bmerged onto main956a476on AMD Radeon RX 6600 XT (RDNA2), driver 32.0.21045.29003, Windows 11 23H2 (22631.6199): passcargo test --workspace --no-fail-fast -- --test-threads=4, noXCL_SAMPLE_*data:No new failures vs main. The PR's new test passes on RDNA2. The one failure on both,
gpu_wave64_ps_whole_wave_reductions, is the 32-lane PS case on this card (#155).Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T20:52:42Z.
Merged (main
2abc562). Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main38b05b7:cargo build --workspace && cargo test --workspace -- --test-threads=4- 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
upstream-sync referenced this pull request2026-11-24 21:29:08 +00:00