Skip to content

Frame generation: net2's grid level per layer in the layout table - #175

Merged
phantoslayer21 merged 1 commit into
mainfrom
fg/layout-levels
Nov 14, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
fg/layout-levels

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

Adds net2's grid level per layer to the frame-generation layout table (lane h).

clean/fg/layout.py

  • Net2Layer.level: the grid each layer runs on, as a divisor of the network grid (1, 2, 4 or 8).
    • Sub-net A: /2, /4, /8, then the eight-layer block and the 64 → 96 layer at /8.
    • Sub-net B: /2, /4, then the block and the 32 → 48 layer at /4, and the last layer at full size.
    • Sub-net A's last layer has no stated level, so it is None (OPEN).
  • Net2Layer.upscaled: marks the two layers whose output is upscaled 2× (layers 12 and 24).
  • net2_macs_per_pixel(subnet, *, used_inputs=True, open_level=None): one sub-net's multiply-adds per network-grid pixel, computed from the table (not measured). A level that is OPEN must be passed explicitly.

clean/fg/FORMATS.md notes the levels and the OPEN level.

Refs #96

Tested

  • python -m unittest clean.fg.tests.test_fg_layout: 8 tests pass locally.
    • The level and upscale columns.
    • Each upscaled 3-group output (96, 48) feeds a layer of one group (32, 16).
    • Each eight-layer block keeps one width and level.
    • The work function, including its error when the OPEN level is missing.
  • The whole clean/fg test set passes. The line-ending check and the public gates pass, with no hits in clean/fg.

Not tested

  • The network's wiring (which buffer each layer reads) is not delivered, so the levels are not exercised by a forward pass.

Net2Layer gets the grid level of each layer (divisor of the network grid) and
whether its output is upscaled 2x; sub-net A's last layer has no stated level
(OPEN). net2_macs_per_pixel computes each sub-net's work per network-grid pixel
from the table, the OPEN level passed explicitly.

Refs #96

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 16:04
@phantoslayer21
phantoslayer21 merged commit 8710cad into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the fg/layout-levels branch November 14, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant