Repository navigation
Model L: weight packing of Model L's own launches (Python) - #99
Merged
Merged
Conversation
clean/l/runner/l_pack.py derives the encoder's launch list from the structure table (a select is folded into the linear it feeds as zero weights) and packs one blob per launch, each in a format Model M already uses: - enc0.values: Model M's enc0 blob with a zero projection (dither table and the two scalars only); - enc0.<w> per linear: the merge / expand section format (bias tile vector, fragments with rows R_L(C_out) and K order K_L(C_in)); - enc0.<block>, dec0.<block>: packing.pack_block at the block's width; - enc0.project: bias, then fragments in groups of 32 input channels (dec0's K order over every group); - dec0: Model M's dec0 blob. The ten shared Swin stages keep packing.pack_stage. Decoders for the blobs are included for the tests. Tests (synthetic): round trips of every format, the block packer against Model M's stage blobs byte for byte, and the weights decoded from the blobs applied the kernels' way (whole input maps, zero weights outside a select) against the oracle's maps, byte for byte. 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.
Python weight packing for Model L's own launches (step P7, Python part). Refs #89
clean/l/runner/l_pack.pyderives the encoder's launch list from the structure table (clean/l/reference/table.py) and packs one blob per launch. Each blob uses a format Model M already has (clean/FORMATS.md), so the kernels can be built from Model M's building blocks:enc0.valuesenc0.<w>per linearR_L(C_out), K orderK_L(C_in); aselectfeeding the linear is folded in as zero weightsenc0.<block>,dec0.<block>packing.pack_blockat the block's width, padded to 256enc0.projectdec0The ten shared Swin stages keep
packing.pack_stage. No existing file changes exceptclean/l/README.md.The C++ port for the runtime follows in its own PR, once
clean/runtime/model.cpp's block packer and fragment helpers are exposed (requested from the runtime tables PR series).Tested
python -m unittest discover -s clean/l/tests -t . -p "test_l_[pr]*.py": all pass (10 new tests, plus the existing reference tests). Covered:python -m unittest discover -s clean/tests -t . -p test_model_tables.py: passes.python tools/ci/check_line_endings.py: 0 problems.Not tested