Repository navigation
Reference and packers: model-keyed stage tables (Model M unchanged) - #92
Merged
Merged
Conversation
The CPU reference's Swin stage table and window offsets, the packers' bneck and mid stage lists and the pipeline's Swin order are now tables keyed by model, Model M the default everywhere (the existing objects are Model M's rows). The functions that use them take model="M"; an unknown model is refused by name. Model M's tables, packed bytes, reference outputs and error texts are unchanged. test_model_tables.py checks Model M's rows against the previous literals and plugs in a synthetic second model built from Model M's own stages. 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.
The CPU reference's Swin stage table and the packers' stage lists are now keyed by model, with Model M as the default
everywhere. A second model of the same family can add its rows next to Model M's without editing any M code path.
Nothing changes for Model M: same tables, same packed bytes, same reference outputs, same error texts.
What is model-keyed now
clean/reference/swin.py:MODEL_STAGES("M"is the existingSTAGESobject),WINDOW_OFFSETS(Model M'swindow-offset rule as data), and the accessors
stage_table(model)andwindow_offset(stage, parity, model).run_stage,random_paramsandrandom_inputstakemodel="M".clean/runner/packing.py:MODEL_BNECK_STAGES,MODEL_MID_STAGES,bneck_stages(model)andmid_stages(model).stage_sections,check_tensors,pack_stage,stage_blob_size,pack_bneck,split_bneck,pack_midandsplit_midtakemodel="M". The error texts are built from the model's lists, which gives exactly the old wordingfor Model M.
clean/runner/pipeline.py:MODEL_SWIN_ORDERandswin_order(model)("M"is the existingSWIN_ORDER).clean/runner/stage_runner.py:MODELScomes from the models with a reference stage table, plus K (still("M", "K")). The Runner passes its model to the table lookups and packers of the non-K path.The Model M kernel-specific paths (the
bneckmegakernel andswin_midlaunch setup in the stage runner) are left asthey are: they drive Model M's kernels.
Refs #89
Tested
(d9c697e) and on this branch. The two outputs are byte for byte identical. They cover the stage table, the window
offsets of every stage and parity, the bneck / mid stage lists, every stage's section offsets and blob size, the
Swin order, the synthetic parameters,
pack_stagefor every stage in both D-row layouts (gfx12, gfx11), the bneckand mid blobs and the mid split, the synthetic inputs, and
run_stageoutputs for every stage at both parities.clean/tests/test_model_tables.py(6 tests, CI runs it):the Swin order,
MODELS;same reference outputs as Model M's stages, and leaves Model M's offsets untouched.
python tools/ci/run_python_tests.py --jobs 2(the CI Python test set): 642 tests ran, 105 skipped (the modules state their reasons: emulator needs Linux, GPU opt-ins), 0 modules failed.Not tested