Skip to content

Runtime: model.wgcm loading for Model L (the preset-L map's names) - #114

Merged
phantoslayer21 merged 2 commits into
mainfrom
model-l/l-wgcm
Nov 14, 2026
Merged

phantoslayer21 merged 2 commits into
mainfrom
model-l/l-wgcm

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

The runtime can load Model L's model.wgcm, the converter's output with the preset-L map. The map is the source of
truth for Model L's names: the runtime's tensor list (#112) is the map's stages, names and shapes, so no translation is
needed. Nothing changes for Model M.

#112 has merged; this branch now holds only its own commit (plus a merge of main).

What changes

  • clean/runtime/model.h/.cpp: new load_wgcm_stages(path, map_path, stages, out, err, other_map) with all of
    load_wgcm_model's checks (whole-file hash, header, every stage's keyed digest against the map's list, names,
    types, shapes, values, the optional group). It applies them to a given stage list. load_wgcm_model is Model M's
    list through it.
  • clean/l/runtime/l_model.h/.cpp: wgrt::l::load_wgcm_model(path, map_path, ...) with Model L's list.
  • clean/runner/synthetic_model.py: write_wgcm(..., order=None). Another model's stage order is used for the file
    and its synthetic map (test aid). Without it, the output is unchanged.
  • clean/l/runtime/tests/: l_load_dump wgcm and two tests in test_l_runtime_load.py.

The runtime frame for Model L (#111) uses this loader when it is rebased on the confirmed layout.

Refs #89

Tested

  • test_l_runtime_load.py: 7 tests, OK (clang++):
    • a synthetic Model L model.wgcm in the map's stage order loads with every tensor's SHA-256 unchanged, the same as
      the same tensors from the raw layout;
    • refused: a tensor not in the map's shape (dec0 W 8 x 16 x 64); a Model M file ("tensor enc0/W has the wrong shape
      or type"); a synthetic Model L file checked against the shipped data/preset-L.v1.map.json ("converted with a
      different map": the shipped map's digests are checked).
  • Model M unchanged:
    • synthetic_model.write_wgcm for four Model M sets (plain, output taps, filter variant 0 of 3, version-1 map):
      model.wgcm and map SHA-256 identical before and after;
    • clean.tests.test_model_filter (the wgcm loader's tests), test_model_select,
      clean.k.tests.test_k_runtime_tables, clean/rr_f/runtime/tests/test_model_bounds.py: OK.
  • Line endings: 0 problems.

Not tested

  • No real model.wgcm for Model L (no converted file here; the synthetic file uses a synthetic map's digests).
  • No GPU run (loading only).

…loader

load_wgcm_stages checks a model.wgcm against a map for a given stage list (load_wgcm_model is Model M's list through it, unchanged); wgrt::l::load_wgcm_model uses Model L's list, which is the preset-L map's stages, names and shapes. synthetic_model.write_wgcm takes another model's stage order (Model M's output unchanged).

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 00:25
@phantoslayer21
phantoslayer21 merged commit cdee313 into main Nov 14, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/l-wgcm branch November 14, 2026 00:51
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