Repository navigation
Converter: preset FG (frame generation) and the FG weight layout - #148
Merged
Merged
Conversation
…ces; the FG weight layout A version-1 map may name "preset": "FG": its sources are the frame-generation library's weight blobs, each its own block source; the preset requires no source by name (M and L keep W, D and K). The key's source missing gives FG's own message (exit 12), any other blob exit 13. --preset FG reads a map without the field as FG. clean/fg/layout.py: both networks' layers and blob sizes as structure only, checked against the spec side's totals. A synthetic end-to-end case converts our own random blobs in that layout with a stand-in map. Refs #96 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 05:21
This was referenced Nov 14, 2026
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.
Groundwork for converting the frame-generation library's weights (lane h). The spec side's map file is not delivered yet. This PR makes the converter ready to read it, and tests that with synthetic data only.
Converter
FG(map version 1 only,"preset": "FG"). Its sources are the frame-generation weight blobs, each its own block source with its own name, length and hashes. The tensors use preset M's record kinds.PresetInfo::required_sources). M and L still need W, D and K; FG names none."preset"field, loaded with--preset FG, is now read as FG before its sources are checked. Without--presetit is still read as preset M, so the other maps load exactly as before.Frame-generation layout (
clean/fg/layout.py): the layers of both networks and the size and inner layout of each blob, as structure only. net1 is 17 blobs of[weights][zero area][bias x 16]; net2 is 25 layers, each a weight blob and a bias blob. Tested against the spec side's totals.clean/fg/FORMATS.mdlists what is still OPEN: the map file, the axis order inside each blob, the launch order, net1 blob 2 (1x1 or 2x2) and the grid sizes.Refs #96
Tested
run_tests.py, including the newtest_fg) and synthetic5 all pass.test_fg: our own random blobs at the real blob sizes, all 67, in shuffled order at 16-aligned, even and odd offsets, with a decoy. The stand-in map converts, and every tensor and digest matches the independent Python reference. net1's zero area and bias copies 1..15 hold NaN; a map that reads them fails with exit 22, which shows the real conversion skips them. Also tested:--preset FGon a map without the field; FG with--preset L/Mand in a version-4 map (both "damaged"); the key's blob missing (exit 12, FG message); another blob missing (exit 13).python -m unittest clean.fg.tests.test_fg_layout(6 tests).Not tested
build.sh(GCC/Clang) was not run.