Repository navigation
Model L on D3D12: the frame blocks' GELU table with the cheaper offsets for every tile - #164
Merged
Merged
Conversation
…ts for every tile l_swin_block_c32_enc_nc and l_swin_block_c32_dec_coef12_nc read q8(GELU) from the arena table with sw_gelu_fetch8_bn's offsets for every hidden tile (swin_block.hlsl SW_GELU 3, pattern 13333) instead of wg_gelu_lut_fetch8's (SW_GELU 1): the same entries, the same bytes (HIP's transcendental chain + pack), fewer instructions. 95 / 96 VGPRs (bound 96; patterns with a transcendental-chain tile need 108 .. 112). l_swin_block_c32_dec_nc (the fallback route) keeps SW_GELU 1. - clean/l/runner/l_d3d12_check.py: every other encoder / decoder block case with large inputs and special values (FP16 NaN, +-infinity, +-65504, +-0, subnormal; FP8 NaN, +-448, +-0, subnormals). Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
force-pushed
the
model-l/c32-gelu-bn
branch
from
November 14, 2026 11:24
88c9a0e to
82aff2d
Compare
phantoslayer21
marked this pull request as ready for review
November 14, 2026 11:32
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 speed on D3D12, sixth change, from the ISA audit of the C = 32 blocks. The frame blocks
l_swin_block_c32_enc_ncandl_swin_block_c32_dec_coef12_ncread q8(GELU) from the arena table withsw_gelu_fetch8_bn's cheaper offsets for every hidden tile (swin_block.hlslSW_GELU 3, pattern 13333) instead ofwg_gelu_lut_fetch8's (SW_GELU 1). Same entries, same bytes (HIP's transcendental chain + pack); nothing isapproximated.
The audit (RGA ISA, gfx1201)
buffer_load_b64: 8 per hidden tile, 8 tiles), with their offset arithmetic;What changes
clean/dx12/kernels/l_swin.hlsl:SW_GELU=3,SW_GELU_PAT=13333on_enc_ncand_dec_coef12_nc; header comment._dec_nc(the fallback route) keepsSW_GELU 1.clean/l/runner/l_d3d12_check.py: every other encoder / decoder block case has large inputs and special values ina twentieth of them.
Refs #89
Byte identity (one GPU slot each; records in the rr-plugin build folder)
clean/l/runner/l_d3d12_check.py --kernels l_swin_block_c32_enc_nc,l_swin_block_c32_dec_nc: D3D12 against HIP, rawbytes, sentinel-filled outputs (record
records/gelu-bn-identity-blocks.json)._enc_nc28 of 28 cases identical,_dec_nc28 of 28; Model M'sswin_block_c96_nccontrol 16 of 16._enc_nc): caught, 768 bytes differ.clean/l/runner/l_fold_check.py(with Model L on D3D12: the folded decoder block's epilogue on the driver's conversions #163's special cases):_dec_coef12_ncagainst the pair on D3D12 and on HIP(record
records/gelu-bn-identity-fold.json).Frame check (
clean/l/runner/l_frame_check.py --compare-d3d12, synthetic models; recordrecords/gelu-bn-frame-check.json)byte 11 of 11; its post against Model M's post reference 11 of 11.
frames each) is byte-identical (record
records/gelu-bn-frame-vs-base.json).Timing (
l_d3d12_profile.py, 1080p Quality, synthetic models). Build A is main (with #163); build B is A with thesetwo DXILs. Two sets of 3 interleaved rounds, every run in its own GPU slot; records
records/gelubn1-ab.jsonandrecords/gelubn2-ab.json.l_swin_block_c32_enc_nc: 0.2826 / 0.2834 -> 0.2740 / 0.2764 ms (medians of the two sets: -9 / -7 us).l_swin_block_c32_dec_coef12_nc: 0.3191 / 0.3207 -> 0.3061 / 0.3056 ms (-13 / -15 us). One B round has 0.3248.lev/input_encoder(+10 us) andcolor_divide(+5 us) in thesecond set.
2.103 ms. B is faster in every round.
Tested
Not tested