Repository navigation
Model L: D3D12 port of the pack12 coefficient store (l_coef_pack12), byte for byte against its HIP kernel - #134
Merged
Conversation
…byte for byte against its HIP kernel Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 03:13
This was referenced Nov 14, 2026
Merged
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
…encoder and decoder Model L on backend 3 (native D3D12) runs Model M's native frame with Model L's encoder (step 2) and decoder (step 4). Its coefficients go through the pack12 store l_coef_pack12 (lossless, #131 / #134) into Model M's pack12 post path, the only post path ported to D3D12. dec1 runs its own block (Model M fuses it into its pack12 decoder there; Model L's decoder reads dec1's map), so the xe / xo / xd fusions, which need that fused decoder, are off for Model L; pm, mb and rv apply as for Model M. - clean/runtime/runtime.cpp: - Model L is accepted on backend 3 (builds with WG_MODEL_L); - at create, every D3D12 port Model L needs that <build>/dx12/manifest.json lacks is refused by name, "not yet ported to D3D12": its encoder (the _direct form on the direct-resource route), linears, clamp-free blocks, projections, l_coef_pack12, and dec1's own block swin_block_c64_add_ex_nc. Weights that need a clamped block are refused too (only the _nc forms are ported); - pack12 is Model L's default on backend 3 and required there; on HIP it stays refused (l_coef, base format); - the encoder launches lev/input_encoder_direct on the direct-resource route; the decoder launches l_coef_pack12 on pack12 frames; - the direct-resource checks accept Model L without the fused pack12 decoder. - clean/tests/runtime_frame_trace.cpp: --backend=<n>; l_coef_pack12's arguments decoded. - test_l_runtime_frame.py, class D3D12: the manifest is built from the repository's own @wg-kernel declarations. The missing ports are named, and each one alone is named; with every port present, the frame passes #111's checks on backend 3 (map chain, extents, offsets, parameters, every argument against named buffers and blobs, history, sizes, resets, a failed launch), with the pack12 images' extents, dec1's own block and Model M's pack12 post after the store. Model M on backend 3 traces the same with and without Model L in the build. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
…encoder and decoder Model L on backend 3 (native D3D12) runs Model M's native frame with Model L's encoder (step 2) and decoder (step 4). Its coefficients go through the pack12 store l_coef_pack12 (lossless, #131 / #134) into Model M's pack12 post path, the only post path ported to D3D12. dec1 runs its own block (Model M fuses it into its pack12 decoder there; Model L's decoder reads dec1's map), so the xe / xo / xd fusions, which need that fused decoder, are off for Model L; pm, mb and rv apply as for Model M. - clean/runtime/runtime.cpp: - Model L is accepted on backend 3 (builds with WG_MODEL_L); - at create, every D3D12 port Model L needs that <build>/dx12/manifest.json lacks is refused by name, "not yet ported to D3D12": its encoder (the _direct form on the direct-resource route), linears, clamp-free blocks, projections, l_coef_pack12, and dec1's own block swin_block_c64_add_ex_nc. Weights that need a clamped block are refused too (only the _nc forms are ported); - pack12 is Model L's default on backend 3 and required there; on HIP it stays refused (l_coef, base format); - the encoder launches lev/input_encoder_direct on the direct-resource route; the decoder launches l_coef_pack12 on pack12 frames; - the direct-resource checks accept Model L without the fused pack12 decoder. - clean/tests/runtime_frame_trace.cpp: --backend=<n>; l_coef_pack12's arguments decoded. - test_l_runtime_frame.py, class D3D12: the manifest is built from the repository's own @wg-kernel declarations. The missing ports are named, and each one alone is named; with every port present, the frame passes #111's checks on backend 3 (map chain, extents, offsets, parameters, every argument against named buffers and blobs, history, sizes, resets, a failed launch), with the pack12 images' extents, dec1's own block and Model M's pack12 post after the store. Model M on backend 3 traces the same with and without Model L in the build. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
…encoder and decoder Model L on backend 3 (native D3D12) runs Model M's native frame with Model L's encoder (step 2) and decoder (step 4). Its coefficients go through the pack12 store l_coef_pack12 (lossless, #131 / #134) into Model M's pack12 post path, the only post path ported to D3D12. dec1 runs its own block (Model M fuses it into its pack12 decoder there; Model L's decoder reads dec1's map), so the xe / xo / xd fusions, which need that fused decoder, are off for Model L; pm, mb and rv apply as for Model M. - clean/runtime/runtime.cpp: - Model L is accepted on backend 3 (builds with WG_MODEL_L); - at create, every D3D12 port Model L needs that <build>/dx12/manifest.json lacks is refused by name, "not yet ported to D3D12": its encoder (the _direct form on the direct-resource route), linears, clamp-free blocks, projections, l_coef_pack12, and dec1's own block swin_block_c64_add_ex_nc. Weights that need a clamped block are refused too (only the _nc forms are ported); - pack12 is Model L's default on backend 3 and required there; on HIP it stays refused (l_coef, base format); - the encoder launches lev/input_encoder_direct on the direct-resource route; the decoder launches l_coef_pack12 on pack12 frames; - the direct-resource checks accept Model L without the fused pack12 decoder. - clean/tests/runtime_frame_trace.cpp: --backend=<n>; l_coef_pack12's arguments decoded. - test_l_runtime_frame.py, class D3D12: the manifest is built from the repository's own @wg-kernel declarations. The missing ports are named, and each one alone is named; with every port present, the frame passes #111's checks on backend 3 (map chain, extents, offsets, parameters, every argument against named buffers and blobs, history, sizes, resets, a failed launch), with the pack12 images' extents, dec1's own block and Model M's pack12 post after the store. Model M on backend 3 traces the same with and without Model L in the build. 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 (#89): the D3D12 port of the pack12 coefficient store,
l_coef_pack12ofl_ops.co(
clean/l/kernels/l_ops.hip, merged in #131), byte for byte against its HIP kernel. With it, the native D3D12 framecan read Model L's coefficients through the existing pack12 read side (the
_p12post kernels).Targets main. CI needs no GPU: nothing here runs without one.
clean/dx12/kernels/l_ops_coef.hlsl: the second kernel from the same source (COEF_PACK12, as HIP'sl_coef_body<PACK12>). Every value isl_coef's; only the stores differ:A | B << 24, thenB >> 8 | C2 << 16;C0 | C1 << 16;l_coef; B is unused (null in the cases).The
l_coefkernel keeps its exact text: its DXIL is identical to main's.clean/l/runner/l_d3d12_ops_check.py:l_coef_pack12cases. They arel_coef's six frames with the samerandom inputs (the same draws); only the output buffers follow the pack12 layout.
Refs #89
Tested
Local, Windows, Radeon RX 9000 series card, against
l_ops.cobuilt from #131 (main'sl_ops.hipis #131's):l_d3d12_ops_check.py --run --seeds 6 --kernels l_coef_pack12,l_coef:l_coef_pack12: 36 of 36 cases identical (6 seeds x 6 frames; 3 outputs per case, 928,320 output bytes);l_coef(Model L: D3D12 port of the coefficient step (l_coef), byte for byte against its HIP kernel #126): still 36 of 36 identical (1,160,400 bytes);swin_block_c96_nc: 36 of 36 identical (3,167,424 bytes);(HIP 0xA5, D3D12 0x5A).
l_coef's outputs repacked(A | B << 24, B >> 8 | C2 << 16, C0 | C1 << 16, latent equal). So the pack12 form loses nothing.
build_dx12.py --isa(RGA):l_coef_pack12has 2buffer_store_b64+ 4buffer_store_b32(A8, then C4 and thelatent, per pixel x 2), as HIP's 2
global_store_b64+ 4global_store_b32.l_coef's DXIL is byte-identical tomain's (SHA-256).
python tools/ci/check_line_endings.py: 0 problems. Public gates (secrets, personal data, licence, chunks) pass.Not tested