Repository navigation
Model L's C = 32 blocks on D3D12: q8(GELU) from the arena table (-31 / -33 us); per-kernel profile - #157
Merged
Conversation
…kernel profile - clean/dx12/kernels/l_swin.hlsl: l_swin_block_c32_enc_nc and _dec_nc (the frame's blocks) take q8(GELU) from the 16 KB arena table (SW_GELU 1) instead of HIP's transcendental chain (SW_GELU 0). swin_block.hlsl's tables are bit-identical to that chain plus its FP8 pack, as Model M's blocks use them; the ports stay byte for byte against their HIP kernels. The groupshared table (SW_GELU 2) takes both to 112 VGPRs, over their bound of 96, and is not used. l_swin_block_c32_nc keeps the chain. - clean/l/runner/l_d3d12_profile.py (new): per-kernel GPU time of the native D3D12 frame by the runtime's operation profile (WG_D3D12_PROFILE), Model L or Model M, grouped by frame step, at 1080p Quality (1280 x 720 -> 1920 x 1080) or 1440p Quality; the record as JSON. Refs #89 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 speed on D3D12, first change: the frame's two C = 32 blocks (
l_swin_block_c32_enc_nc,_dec_nc) takeq8(GELU) from the 16 KB arena table (
SW_GELU 1) instead of HIP's transcendental chain (SW_GELU 0). Model M'sblocks use the same tables, which
swin_block.hlslkeeps bit-identical to HIP's chain plus its FP8 pack. The portsstay byte for byte against their HIP kernels; nothing is approximated. This PR also adds the per-kernel profiler.
What changes
clean/dx12/kernels/l_swin.hlsl:SW_GELU=1on_enc_nc/_dec_nc. The groupshared table (SW_GELU 2) takesboth to 112 VGPRs, over their bound of 96 (
vgpr_limits.json; the build refuses it), so it is not used.l_swin_block_c32_nc(not in the frame) keeps the chain.clean/l/runner/l_d3d12_profile.py(new): per-kernel GPU time of the native D3D12 frame from the runtime'soperation profile (
WG_D3D12_PROFILE, asclean/dx12/profile_frames.py).Refs #89
Where Model L's time goes (main, 1080p Quality, synthetic models, instrumented D3D12 timestamps, ms per frame;
records
records/l-d3d12-kernels-1080pq-L.jsonand-M.jsonin the rr-plugin build folder)These match the game's timing (encoder 0.761 vs 0.110, decoder 0.685 vs 0.189). Model L's encoder and decoder by
kernel:
l_swin_block_c32_dec_ncl_swin_block_c32_enc_ncl_dec_projectl_coef_pack12l_project_gatherlev/input_encoderl_linear_32_32_relul_linear_32_32_f16Byte identity (
clean/l/runner/l_d3d12_check.py --kernels l_swin_block_c32_enc_nc,l_swin_block_c32_dec_nc, oneGPU slot; record
records/c32-gelu1-identity.json)_enc_nc28 of 28 cases identical,_dec_nc28 of 28.swin_block_c96_nccontrol: 16 of 16.Timing (
l_d3d12_profile.py, main's build A against this change's build B, which differ only in these twoDXILs; interleaved, 3 rounds each, every run its own GPU slot; record
records/c32-gelu1-ab.json; medians)l_swin_block_c32_enc_nc: 0.299 -> 0.268 ms (-31 us).l_swin_block_c32_dec_nc: 0.341 -> 0.308 ms (-33 us).wg_rt_frame_timed, after the profiled phase): A 2.664 / 2.675 / 2.657 ms, B 2.605 / 2.599 /2.608 ms.
Tested
Not tested