Repository navigation
Conversation
In the split wave64 form (wave64 compute / mesh / ES+GS programs on GPUs with 32-lane waves only, e.g. NVIDIA) the half, the console wave and the other half's size were computed per lane from xcl_tid, which comes from WavePrefixCountBits. The values are the same in every lane of a hardware wave, but the GPU compiler cannot prove it, so everything derived from them was per-lane in its eyes: every exchanged mask (EXEC, VCC), every SGPR computed from one, and every branch on them (s_cbranch_execz / vccz / scc, loop exits). The native forms have none of that: there EXEC comes straight from WaveActiveBallot. The three values now come from the hardware wave's first console thread, WaveReadLaneFirst(xcl_tid) & ~31 (its console threads are 32-aligned), and the compute TG_SIZE wave index and the mesh s3 wave index use the console wave xcl_cw (= gi / 64 there). Same values; only the split HLSL changes, the native and wave32 HLSL is byte-identical (checked on 70 translations). Measured with a flow-insensitive divergence model of the generated main() (7 programs: ALU, memory, branchy, the bench_split_wave64 loop, the two gpu_split_wave64 test programs; kernel, CS 64 / 256 / 8x8x4 and MS 128 modes), assuming a groupshared load from a wave-uniform address is uniform: scalar registers the compiler must keep per lane 242/440 -> 0/440 (native: 2/440), divergent branches 108/129 -> 59/129 (native 66/131, the rest are per-lane store guards). If the driver treats every groupshared load as per-lane, 242 -> 226 only (a WaveReadLaneFirst on the exchanged word would close that; it is exchange code, left alone). CPU translation time unchanged (median 104.7 -> 102.2 us per program, noise). Not run on a GPU. Assisted-by: Claude Code (Claude Opus 5.5)
Owner
Author
|
Upstream PR xcl-dev#900 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speeds up split wave64 console shaders on 32-lane GPUs (NVIDIA):
xcl_tid, forcing the GPU compiler to treat exchangedEXEC/VCCvalues, derived SGPRs, and branches on them as per-lane and divergent.WaveReadLaneFirst(xcl_tid) & ~31uso scalar state stays wave-uniform across each 32-lane hardware wave.242/440 -> 0/440, divergent branches108/129 -> 59/129.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC debug, DXC Windows SDK10.0.26100.0,d3d12SDKLayers.dllinstalled6b75595ae9113814289e0ab2e6a2915672b75431(HEAD2817c7c6ee17ba22453da5cd1a7f75cc0f3d0150has an identical tree; only commit author metadata was updated after GitHub account rename)cargo build --workspace: clean (no new warnings; only pre-existingfetch_updatedeprecation warning)cargo test --workspace -- --test-threads=4: 717 passed, 0 failed, 41 ignoredSKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Not tested
scripts/smoke.ps1) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run.AI use
Mirror of xcl-dev#900 (auto-synced, do not edit).