Repository navigation
Frame generation: CPU reference for splitting the weight blobs - #174
Merged
Merged
Conversation
clean/fg/reference/blobs.py: blob bytes to flat float16 weights (stored order) and distinct biases. net1: the zero area skipped and checked to be zero, copy 0 of each bias group taken and the other copies checked; net2: the weight and bias blob sizes checked. The in-blob axis order is OPEN, so weights stay flat. Refs #96 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.
Splitting the frame-generation weight blobs into their parts, as a CPU reference (lane h). It uses the blob layout from
clean/fg/layout.py(#148).clean/fg/reference/blobs.pysplit_net1(layer, data, *, check=True): from one net1 blob, returns the weights as flat float16 in stored order, and the distinct biases (copy 0 of each group of 8). Withcheck, it also verifies two things and raisesBlobErrorotherwise: the zero area holds only +0 or -0, and all 16 copies of every bias group are bit-identical.split_net2(layer, weight_data, bias_data): checks the sizes of a net2 layer's weight and bias blobs.split_all(blobs): splits every layer. A missing or extra blob raisesBlobError.build_net1(layer, weights, bias): the inverse ofsplit_net1, for synthetic tests.The order of the weights inside a blob is still OPEN (FORMATS.md item 2), so they stay flat; reshaping them into the reference's canonical order waits for that.
Refs #96
Tested
python -m unittest clean.fg.tests.test_fg_blobs: 4 tests pass locally, on synthetic blobs of every layer (all 67 blobs at their real sizes).check=False.clean/fgtest set passes. The line-ending check and the public gates pass, with no hits inclean/fg.Not tested