Skip to content

Model L: structure table settled to the confirmed layout - #109

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/table-2a
Nov 13, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/table-2a

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

The structure table, the oracle and the packers now follow the confirmed layout of Model L's encoder and decoder. Refs #89

  • Encoder (per pixel of the padded grid):
    • the quantized values;
    • linear 20 -> 32 (FP16 sum, ReLU, FP8);
    • linear 32 -> 32 (FP16 sum, FP8);
    • a width-32 block;
    • the 2 x 2 gather of each token into 128 values, and the projection to the 64 features (FP16 running sum per group of 32, clamp, FP8).
  • Decoder:
    • projection of dec1's 64 channels to 4 x 32 per token (Model M's dec0 rounding, over all rows);
    • depth_to_space to a pixel map;
    • a width-32 block;
    • the value positions of the coefficient functions, which then run as Model M's.
  • Parameters are grouped by the converter map's stages (enc0, enc0_block, dec0_block, dec0, post) with its tensor names.
  • Provisional entries. The remaining ones stay table entries (PROVISIONAL in clean/l/reference/table.py): quantization mode, rounding of the linears and of the decoder projection, clamp, value positions, window offsets, block constants, and the reconstruction. Model L's own output reconstruction is not written yet.
  • Packers. The encoder and decoder launch lists come from the table. Two new blobs: dec0.project (expand section format at C = 32, two groups of 32 input channels) and dec0.coef (Model M's dec0 blob without the projection).
  • Work per frame at 1440p Quality (computed from the layer shapes, not measured): Model M 103.1 G multiply-adds, Model L 163.1 G.

This replaces the earlier F/2 reading of the encoder's extra network. The HIP chain kernels in #104 implemented that earlier reading and are being reworked to this layout. The C = 32 block kernel (#102) is unchanged: the blocks now run on pixel maps.

Tested

  • python -m unittest discover -s clean/l/tests -t .: 30 tests pass. Byte for byte against Model M's oracle:

    • the encoder with Model M's op list;
    • the decoder with Model M's projection rows and no block (new);
    • the whole chain with both.

    Also: the default layout recomputed step by step, and the weights decoded from the blobs (all formats) reproducing the oracle's maps byte for byte.

  • python tools/ci/check_line_endings.py: 0 problems.

Not tested

  • No GPU in this PR (oracle, table and packers only).

… decoder blocks per render pixel)

The structure table, the oracle and the packers follow the confirmed layout of
Model L's encoder and decoder:

- encoder, per pixel of the padded grid: the quantized values, linear 20 -> 32
  (FP16 sum, ReLU, FP8), linear 32 -> 32 (FP16 sum, FP8), a width-32 block,
  then the 2 x 2 gather of each token into 128 values and the projection to the
  64 features (FP16 running sum per group of 32, clamp, FP8);
- decoder: the projection of dec1's 64 channels to 4 x 32 per token (Model M's
  dec0 rounding over all rows), depth_to_space to a pixel map, a width-32
  block, then the value positions of the coefficient functions, which run as
  Model M's.

Parameters are grouped by the converter map's stages (enc0, enc0_block,
dec0_block, dec0, post) with its tensor names. The remaining provisional
entries (quantization mode, rounding of the linears and of the decoder
projection, clamp, value positions, window offsets, block constants, the
reconstruction) stay table entries.

Packers: the encoder and decoder launch lists come from the table; new blobs
dec0.project (expand section format at C = 32, groups of 32 input channels)
and dec0.coef (Model M's dec0 blob without the projection).

Tests (synthetic): the encoder with Model M's op list, the decoder with Model
M's projection rows and no block, and the whole chain equal Model M's oracle
byte for byte; the default layout recomputed step by step; the unpacked blobs
reproduce the oracle's maps byte for byte. Matrix work per frame at 1440p
Quality (computed, not measured): Model M 103.1 G, Model L 163.1 G.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 13, 2026 23:25
@phantoslayer21
phantoslayer21 merged commit f7f27ae into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/table-2a branch November 13, 2026 23:25
phantoslayer21 added a commit that referenced this pull request Nov 13, 2026
…e_load on main

#110 merged after #109 changed the structure table: the runtime's Model L tensor list still had the earlier layout and its test called table.encoder_shapes, which #109 removed. Now the map's stages (enc0, enc0_block, the ten shared stages, dec0_block, dec0, post), names and shapes; the test checks them against data/preset-L.v1.map.json and table.param_shapes.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 13, 2026
wgrt::l::encoder_launches / decoder_launches mirror l_pack's launch lists for the default table (#109's layout, the map's stage and tensor names); pack_model packs every blob of pack_model_l: enc0.values, enc0.Win1, enc0.Win2, enc0_block, enc0.project, dec0.project, dec0_block, dec0.coef. model.h pack_parts gains rows_expand (the expand rows of dec0.project). Byte-identical to the Python packer (test_l_runtime_pack.py).

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
j0nsh1n pushed a commit to j0nsh1n/wronggpu that referenced this pull request Nov 14, 2026
… test_l_runtime_load on main

phantoslayer21#110 merged after phantoslayer21#109 changed the structure table: the runtime's Model L tensor list still had the earlier layout and its test called table.encoder_shapes, which phantoslayer21#109 removed. Now the map's stages (enc0, enc0_block, the ten shared stages, dec0_block, dec0, post), names and shapes; the test checks them against data/preset-L.v1.map.json and table.param_shapes.

Refs phantoslayer21#89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant