Repository navigation
Conversation
Owner
Author
|
Upstream PR xcl-dev#944 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.
In split-wave64 mode (two hardware wave32 halves per console wave64), consecutive independent
v_readfirstlane_b32andv_readlane_b32instructions (for example, 4-dword V# or 8-dword T# descriptor waterfalls in wave64 mesh and compute shaders) previously each emitted a separatexcl_x_rla_uniformcall — inlining a full cross-halfxcl_x_meet()barrier/spin-wait exchange per instruction.PRELUDE_X64already supports multi-word exchanges (xcl_x_put(i, ...)/xcl_x_meet()/xcl_x_get(i), as used by coherents_load_dwordx4andds_bpermute). This batches consecutive dependency-freev_readfirstlane_b32/v_readlane_b32instructions inside each basic block into a single multi-wordxcl_x_meet()(sharing onefirst_lane(exec_lo, exec_hi)call across the batch), reducing DXIL size, DXC compile time, and NVIDIA driver (nvgpucomp64.dll) pipeline compile time. Native wave64 and wave32 HLSL are unchanged, and this is orthogonal to xcl-dev#917 (v_writelane_b32spill shadows).What is in it
crates/xcl/src/gpu/recomp/emit.rs: addEm::emit_instsand split-wave64 batching for consecutive plainv_readfirstlane_b32/v_readlane_b32instructions within a basic block. Splits on any SGPR/EXEC read-after-write dependency, skips reads already resolved byupper_lanes, and caps batch width at(64 / waves).clamp(2, 8)so per-wave exchange storage stays<= 256dwords (1 KiB).crates/xcl/src/gpu/recomp/mod.rs: route the three basic-block emission loops (emit_block,emit_range, and straight-linebranches == 0) throughem.emit_insts(...).crates/xcl/src/gpu/recomp/tests.rs: addsplit_wave64_readlane_batching_rules(unit test covering 4-word batching, SGPR andEXECdependency splits, jump-target splits, 64- and 1024-thread slot caps, and native wave64 invariance) andgpu_split_wave64_batched_readlanes(GPU test verifying upper-half active lanes, mixed lower/upper lane batches, SGPR dependency split, andEXEC-modifying split).Across 10,447 wave64 CS/MS programs in a retail shader pack, this removes 19,334
xcl_x_meet()exchanges (18,049 from consecutivev_readfirstlane_b32and 1,281 from consecutivev_readlane_b32).Measured on four retail wave64 shaders on
origin/main(09940bb) → this commit (e7199ca) (RTX 3060 Ti, DXC 1.9.2609.5):75 → 25(-66.7%), DXIL345.6 → 332.2 KB(-3.9%), DXC4549 → 3853 ms(-15.3%), cold PSO7149 → 6191 ms(-13.4%)258 → 101(-60.9%), DXIL328.4 → 279.7 KB(-14.8%), DXC7865 → 5366 ms(-31.8%), PSO5551 → 5409 ms(4481 ms first cold run)310 → 131(-57.7%), DXIL426.7 → 382.3 KB(-10.4%), DXC10468 → 8867 ms(-15.3%), PSO9406 → 8077 ms(-14.1%)505 → 361(-28.5%), DXIL1028.9 → 994.8 KB(-3.3%), DXC25564 → 22523 ms(-11.9%), PSO24487 → 21444 ms(-12.4%)Tested
x86_64-pc-windows-msvc), debug + release.cargo test --workspace -- --test-threads=1: 718 passed, 0 failed, 41 ignored (2 SKIPPED GPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)). Both new tests (split_wave64_readlane_batching_rules,gpu_split_wave64_batched_readlanes) ran and passed.Regression run
(local folder name redacted to
retail-titlein both blocks; all metrics are exact output of the 60 s runs withXCL_NETWORK=0)main:
PR:
Not tested
split_wave64is false there so emitted HLSL is unchanged).CreateComputePipelineState).AI use
Mirror of xcl-dev#944 (auto-synced, do not edit).