Repository navigation
Model L coefficient step: pack12 store form (l_coef_pack12), lossless against l_coef - #131
Merged
Merged
Conversation
…dec0 pack12 layout), proven lossless against l_coef on the GPU 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:49
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> # Conflicts: # clean/l/FORMATS.md
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.
Refs #89
l_coef_pack12is the pack12 store form of Model L's coefficient step. It writes the same values asl_coefinModel M's dec0 "pack12" layout (
clean/kernels/decoder.hipWG_DEC_PACK12), which the output stage's_p12kernels read:
l_coef.Only the padding bytes of the base form are left out (A byte 3, B byte 3 and C's fourth FP16, all zero), so the
form is lossless. One template switch on
l_coef's store gives both kernels from the same body, with the samearguments (B unused, may be null). This gives native D3D12 a reader for Model L's coefficients through the existing
pack12 path.
clean/l/FORMATS.mdhas the new row.Tested
GPU record: RX 9070 XT, locked GPU slot, 2 seeds, synthetic data, head 1417f35.
clean/l/runner/l_ops_check.py, new casecoef_pack12: 6 cases, 13,478 pixels, including odd render sizes insidepadded grids.
of sentinel slack.
l_coef's A, B and C words and latent bytes byte for byte, in every case.the sentinel.
l_coefitself is unchanged in values: A, B and latent codes 0 differ from the oracle; 1 of 40,434 C valuesdiffers by 1 FP16 ulp, as before. The other kernels of the check also give their earlier results.
CPU:
python -m unittest discover -s clean/l/tests -t .passes.Not tested
l_coef_pack12(next, kern2) and the frame that reads it (param's D3D12 frame).