Repository navigation
Frame generation: converter map revision v1.1 (natural order); the CPU reference on natural weights - #180
Merged
Conversation
…U reference on natural weights data/fg.v1.map.json is now the spec side's revision v1.1: every weight tensor W in natural order ([out, in, 3, 3] / [out, in]) by explicit offsets, channel_order natural; digest pinned again in the converter tests and clean/fg/tests/test_fg_map.py. clean/fg/reference/natural.py takes the natural order from the map's own offsets (stored blob weights to natural, natural to canonical). The forward reference now uses natural weights: weight_view and blob2 are no longer arguments (blob 2 is a 1x1 convolution; net2's first layer reads 10 of its 16 stored inputs). FORMATS.md closes the weight-order and blob-2 items. Refs #96 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 17:50
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.
Moves frame generation to the spec side's converter map revision v1.1, which gives the weights in natural order, and moves the CPU reference onto natural weights (lane h).
Map
data/fg.v1.map.jsonnow holds revision v1.1, byte for byte, keeping its name aspreset-L.v1.map.jsondid for its v1.1.Wis now in natural order:[out, in, 3, 3]for 3×3 layers and[out, in]for 1×1 layers, with every axis given by explicit offsets."channel_order": "natural".b32d9195…c7ad5) is pinned in the converter tests and inclean/fg/tests/test_fg_map.py."channel_order": "storage"(v1's form) is still accepted for preset FG and stays tested.CPU reference
clean/fg/reference/natural.py: takes the natural order from the map's own offsets. It turns stored blob weights into natural ones and natural into the reference's canonical[out, k, k, in]. The storage order is never restated in code.forward.pyuses natural weights.params_from_blobsputs stored weights in natural order through the map, andparams_from_rawreads the converter'sW/b.weight_viewandblob2are no longer arguments.[32, 10, 3, 3].wiring,pad,fold_order.layout.py(blob 2: 1×1),ops.weight_shape(the used input count) andFORMATS.md(the weight-order and blob-2 items closed) are updated to match.Refs #96
Tested
clean/fgunit tests all pass locally (55+). Newtest_fg_natural:blobs.split_alland the natural view, for every layer.test_fg_forward(every layer against a direct NumPy convolution, stand-in wirings, raw parameters) runs on natural weights.storageform, missing blobs and malformed offsets. The converter source is unchanged.clean/fg/tools/real_check.py(execute-only, the same player library as before) and passed. The record holds digests only and stays private.Not tested