Skip to content

feat: arbitrary-depth trainer (>2 layers), proven bit-exact + synthesizable - #1872

Merged
gHashTag merged 1 commit into
masterfrom
feat/deep-trainer
Aug 7, 2026
Merged

feat: arbitrary-depth trainer (>2 layers), proven bit-exact + synthesizable#1872
gHashTag merged 1 commit into
masterfrom
feat/deep-trainer

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Removes the generator's last structural restriction (was exactly 2 layers). gen_deep(sizes) + emit_verilog_deep(sizes) produce full backprop for an L-layer net of any depth (sizes=[n_in,h1,...,n_out]): hidden layers ReLU, linear output, deltas propagated back-to-front through every hidden layer.

Refactored the shared emitter into _emit_module (no duplication; emit_verilog output unchanged; gen_deep([n_in,n_hid,n_out]) matches gen() step-for-step). Same one-smul/one-sadd datapath: depth costs microcode steps (time), not area — [2,4,3,1] → 17672 cells vs 2-layer (2,4,2)'s 17468. Self-test [2,4,3,1] (3-layer) learns the nonlinear task (held-out 59/60); bit-exact gate extended with [2,4,3,1], [2,5,3,2] (deep+multi-out), [3,4,4,2,1] (4-layer) — all bit-exact over 80 steps + synth-checked. No structural restrictions remain. Refs #1764

…izable

Removes the generator's last structural restriction (exactly 2 layers). gen_deep(sizes)
+ emit_verilog_deep(sizes) produce full backprop for an L-layer net of any depth
(sizes=[n_in,h1,...,n_out]): hidden layers ReLU, linear output, deltas propagated
back-to-front through every hidden layer; naming stays emit-compatible (x/t/y).

Refactored the shared Verilog emitter into _emit_module so the 2-layer and deep
paths do not duplicate; emit_verilog output unchanged; gen_deep([n_in,n_hid,n_out])
matches gen() step-for-step. Same one-smul/one-sadd datapath: depth costs microcode
steps (time), not area -- [2,4,3,1] synthesizes to 17672 cells vs the 2-layer
(2,4,2)'s 17468. Self-test [2,4,3,1] (3-layer) learns the nonlinear task (held-out
59/60); bit-exact gate extended with [2,4,3,1], [2,5,3,2] (deep+multi-out), and
[3,4,4,2,1] (4-layer) -- all RTL == model bit-exact over 80 steps, [2,4,3,1] added
to the synth gate. No structural restrictions remain.

Refs #1764

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-07 13:51:55 UTC

Summary

Status Count
Total Open PRs 12
PRs with Failing Checks 0
PRs with All Checks Green 12
READY 5
FAILING 0
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=4c1aaad5309a != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 0710db0 into master Aug 7, 2026
18 checks passed
@gHashTag
gHashTag deleted the feat/deep-trainer branch August 7, 2026 13:57
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