Repository navigation
Model L D3D12: dec1 block with two windows per wave (byte-identical, -7/-17 us at 1080p/1440p) - #171
Merged
Merged
Conversation
…ws per wave (the same bytes) swin_c64w2.hlsl (Model M's enc1 block in 128-lane workgroups, two windows per wave) takes the block input x + xadd (SW_ADD) and the fused expand (SW_ECL) under a kernel name switch (SW_W2_NAME); swin_block.hlsl's fused_expand runs with the workgroup's wave count (8, or 4 here). dec1's declaration (swin_c64ex.hlsl) moves to that form; its VGPR bound is 192 (4 workgroups of 4 waves per CU). Model M's DXILs are unchanged; the one-window line rebuilds main's dec1 byte for byte. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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.
Refs #89
Model L's dec1 block
swin_block_c64_add_ex_ncnow runs in the launch shape of Model M's enc1 block (swin_c64w2.hlsl): two windows per wave in 128-lane workgroups. Each window's arithmetic is unchanged and so are the bytes it writes. Oversight approved this form on condition that it is byte-identical, recorded, and leaves Model M untouched.What changes
swin_c64w2.hlsl:SW_ADD), with the fused expand (SW_ECL). The expand writes the 8 windows' records into the second staging buffer, asswin_block.hlsldoes, and each wave reads back its two windows' records.SW_W2_NAME, defaultswin_block_c64_nc).swin_block.hlsl:fused_expandruns with the workgroup's wave countTHREADS / 32, which is 8, or 4 in the 128-lane form. It used to be a literal 8.fused_swin.hlslis its generated copy.swin_c64ex.hlsl: dec1's declaration moves to the two-window form. The header documents the switch back: the one-window line rebuilds main's DXIL byte for byte (checked).vgpr_limits.json: dec1's bound goes from 128 to 192, which allows 4 workgroups of 4 waves per CU. It builds at 192 VGPRs, 0 spills, 16 KB LDS.group/gscalealready drive the launch, as for enc1.Timing
1080p and 1440p Quality, synthetic models. Main's dec1 DXIL and this branch's were swapped into one runtime build, interleaved, 3 rounds, each run in its own GPU slot. Values are medians in ms. Records:
k-<shape>-{dkbase,w2a}-r<n>.jsonand the summarydec1w2-time.txt.Every PR round beat every main round at both shapes.
Tested
build_dx12.py --model-lbuilds of this branch and of main (f0fd94c), all 64 DXILs compared.swin_block_c64_add_ex_nc.dxildiffers.swin_block_c64_nc(the two-window enc1 block),swin_block_c96_add_ex_ncand the fused c96 kernels, which sharefused_expand.l_d3d12_ops_check.py --kernels swin_block_c64_add_ex_nc --seeds 3, raw bytes against HIP with per-backend sentinels. Recorddec1w2-identity.json.swin_block_c96_nc: 18/18.l_frame_check.py --run --backend d3d12 / d3d12-stagesthen--compare-d3d12, both models, 11 frames, pass. It ran on a build with this branch's dec1 kernel swapped in. Recorddec1w2-framecheck-raw-d3d12.json.dec1w2-frames-vs-main.json.test_kernel_sets.py.public_gates.pypasses; the LOOK lines are at baseline.Not tested