Repository navigation
Model L D3D12: scheduling knobs on the two C32 frame blocks (byte-identical, -9/-12/-10 us) - #192
Merged
Merged
Conversation
… bytes) l_swin_block_c32_enc_lin_nc: SW_HEAD_PAIRS, SW_SMAX_STAGED, SW_NORM1_EARLY; l_swin_block_c32_dec_coef12_nc: SW_SMAX_ADDST, SW_SMAX_STAGED (swin_block.hlsl's same-value knobs). 95 / 96 VGPRs: 4 workgroups per CU kept. Only these two DXILs change. 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
This sets swin_block.hlsl's same-value scheduling knobs on Model L's two full-resolution C32 blocks. These knobs reorder and stage the work without changing any value. Both kernels stay within their 96-VGPR bound (4 workgroups per CU), and only their two declaration lines in
l_swin.hlslchange.l_swin_block_c32_enc_lin_nc:SW_HEAD_PAIRS=1(the head loop in pairs),SW_SMAX_STAGED=1(the softmax's staged form),SW_NORM1_EARLY=1(norm1's gamma/beta loads before the first barrier). 95 VGPRs.l_swin_block_c32_dec_coef12_nc:SW_SMAX_ADDST=1,SW_SMAX_STAGED=1. 96 VGPRs.Found by an ISA audit and a timed sweep of the template's knobs.
Timing
Synthetic models. Main against main with this branch's two DXILs, interleaved, 3 rounds, each run in its own GPU slot. Values are medians in ms. Records:
c32knobs-timing.jsonand its per-run recordsc32knobs-{elrt,skrt}-<shape>-r1..3.json.Every PR run of the encoder block beat every main run, at all three shapes.
Tested
l_enclin_check.py --seeds 2. Recordc32knobs-enc-identity.json.l_linear_32_32_fused→l_swin_block_c32_enc_nc) and the HIP sequence (relu → f16 → block), with special FP8 codes in q.l_fold_check.py --seeds 2. Recordc32knobs-dec-identity.json.l_swin_block_c32_dec_nc→l_coef_pack12).l_frame_check.py --run --backend d3d12 / d3d12-stages, then--compare-d3d12), both models, pass, with all negative controls caught. Recordc32knobs-framecheck-raw-d3d12.json.c32knobs-frames-vs-main.json.l_swin.hlslrebuilt and compared with main's: only the two edited kernels differ. No other source file changes, so every other DXIL, Model M's included, is built from unchanged source.public_gates.pypasses. The LOOK lines carry no hit in this branch's file.Not tested