Repository navigation
Model L: D3D12 port of dec1's block with its fused expand (swin_block_c64_add_ex_nc), byte for byte against its HIP kernel - #139
Merged
Conversation
…_c64_add_ex_nc), byte for byte against its HIP kernel Model M's D3D12 route always runs dec1 fused with the pack12 decoder; Model L's frame launches this kernel for dec1, which had no port. swin_c64ex.hlsl instantiates swin_block.hlsl unchanged (C = 64, ADD, fused expand from 96 channels). Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> # Conflicts: # clean/l/runner/l_d3d12_ops_check.py
phantoslayer21
marked this pull request as ready for review
November 14, 2026 03:32
…_post_recon cases) 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.
Model L (#89): the D3D12 port of dec1's Swin block with its fused expand,
swin_block_c64_add_ex_ncofswin.co(
clean/kernels/swin.hip,WG_FUSED_KERNEL(swin_block_c64_add_ex, 64, 2, 256, true, 0, 96)), byte for byte againstits HIP kernel.
Why: Model M's D3D12 route always runs dec1 fused with its pack12 decoder (
d1p12/swin_block_c64_add_dec0*), so dec1'sblock on its own had no port. Model L's decoder reads dec1's map, so Model L's frame refuses the fused dec1 + dec0
forms. With the default
swin_fuse_stages=dec1,dec2it then launches:swin_block_c96_add_ex_nc, already ported (the xe fusion needs the fused dec1 + dec0, so it is off);swin_block_c64_add_ex_nc, this PR.swin_block_c64_add_ncis only on the non-default unfused route (swin_fuse_stageswithout dec1, withexpand_c96)and is not ported here.
Targets main. CI needs no GPU: nothing here runs without one.
clean/dx12/kernels/swin_c64ex.hlsl(new): the kernel's@wg-kernelline and#include "swin_block.hlsl".It instantiates the template unchanged: C = 64, 2 heads, MLP 256 (its C = 64 path, as
swin_block_c64_nc), withthe block input x + xadd (
SW_ADD) and the fused expand from the 96-channel low-resolution map (SW_ECL96). Thatis the same combination
swin_block_c96_add_ex_ncuses at C = 96. 256 lanes, one window per wave, the 9 argumentsof HIP's fused kernels (aux unused).
swin_block.hlslandfused_swin.hlslare untouched.clean/dx12/vgpr_limits.json: its bound, 128. It uses 120 VGPRs, which keeps 3 workgroups per CU.clean/l/runner/l_d3d12_ops_check.py: its cases.writes 2 x 2 pixels per low-resolution token. 4 x 6 and 12 x 20 have fewer windows than a workgroup.
block then the expand section (
packing.pack_stage). Only_ncblobs, since the D3D12 port has only the_ncform.
Refs #89
Tested
Local, Windows, Radeon RX 9000 series card, against main's
swin.co:l_d3d12_ops_check.py --run --seeds 6 --kernels swin_block_c64_add_ex_nc:swin_block_c64_add_ex_nc: 84 of 84 cases identical (6 seeds x 7 maps x 2 offsets; 10,008,576 output bytes);swin_block_c96_nc: 36 of 36 identical (3,167,424 bytes);(HIP 0xA5, D3D12 0x5A).
build_dx12.py --isa(RGA): 120 VGPRs (bound 128). The D3D12 and HIP compilers roll and unroll the block's loopsdifferently, so their instruction counts differ; the outputs above are identical.
list and the check script). After merging main (Model L: D3D12 ports of the encoder and decoder blocks, byte for byte against their HIP kernels #132's template switches),
swin_block_c64_add_ex_ncrebuilds tothe byte-identical DXIL the GPU run above tested (SHA-256).
python tools/ci/check_line_endings.py: 0 problems. Public gates (secrets, personal data, licence, chunks) pass.Not tested
swin_block_c64_add_ncafterexpand_c96): not ported._nc) form: only the_ncforms are ported, as for Model M.