Repository navigation
Model L: D3D12 port of the coefficient step (l_coef), byte for byte against its HIP kernel - #126
Merged
Merged
Conversation
…gainst its HIP kernel Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 02:04
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 Model L's coefficient step,
l_coefofl_ops.co(clean/l/kernels/l_ops.hip,merged in #115), byte for byte against its HIP kernel.
Stacked on #123 (it adds this kernel's cases to the ops harness of #122 / #123); it targets main once those merge.
CI needs no GPU: nothing here runs without one.
clean/dx12/kernels/l_ops_coef.hlsl(new): the decoder block's FP16 map -> A, B, C and the new latent, pixelsinside R only, as HIP (
clean/l/FORMATS.md,dec0.coef).l_coefwhere it differs from the source:v_fma_mixlo_f16 a, b, 0=wg_mul_f16);fma(p, t^2, +0)with an opaque zero, so the driver cannot turn it into a plainproduct;
rint((e r) 255)grouped as HIP's (opaque link);wg_uniform(). Three of the four stores go at the same per-lane offset intodifferent buffers, the shape the D3D12 README says the driver may merge. The RGA ISA has all of them (below).
clean/l/runner/l_d3d12_ops_check.py: thel_coefcases.5 x 3 in 6 x 4, 13 x 7 in 20 x 12. That gives odd R sizes, a padded grid wider than R by whole tokens, and partly
filled waves.
LDecParamsis passed by value (56 bytes).Refs #89
Tested
Local, Windows, Radeon RX 9000 series card, against the merged #115 (the
l_ops.cobuilt from main is bit-identical tothe one these records used):
l_d3d12_ops_check.py --run --seeds 6 --kernels l_coef:l_coef: 36 of 36 cases identical (6 seeds x 6 frames; 4 outputs per case, 1,160,400 output bytes);swin_block_c96_nc: 36 of 36 identical (3,167,424 bytes);(HIP 0xA5, D3D12 0x5A).
build_dx12.py --isa(RGA):buffer_store_b32+ 2buffer_store_b64: 4 stores per pixel x 2 pixels, as HIP's 8global_store;v_exp_f32and 22v_rcp_f32, as HIP;python tools/ci/check_line_endings.py: 0 problems. Public gates (secrets, personal data, licence, chunks) pass.Not tested
follows HIP's ISA but was not run.