feat: GF-T 2-input on-chip trainer primitive (proven on AX7203) - #1818
Merged
Conversation
gft_train2.t27: on_comb(w0,w1,x0,x1,t,eta) -> u64 runs one full SGD step of a 2-input linear neuron y=w0*x0+w1*x1 combinationally -- forward, error e=y-t, grads g_i=e*x_i, updates w_i'=w_i-eta*g_i -- returning both updated weights packed (w0'<<32)|w1'. Reuses the verified smul/sadd/neg/mag* helpers from gft_sgd_step. With both weights in registers the whole forward+backward+update runs on-chip and the host streams only (x0,x1,t) data. Proven on a live AX7203 (uart_train2.v): streaming a hidden 2-weight function w*=(1.0,0.5), the board discovers BOTH parameters -- w0 0.25->1.03, w1 0.25->0.48. In-spec test PASS, iverilog bit-exact. docs/NOW.md updated. Refs #1764 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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.
New spec gft_train2.t27 — on_comb(w0,w1,x0,x1,t,eta) -> u64 runs one full on-chip SGD step of a 2-input linear neuron y=w0x0+w1x1 (forward, error, grads g_i=ex_i, updates w_i-etag_i), returning both updated weights packed (w0'<<32)|w1'. Reuses gft_sgd_step helpers. In-spec PASS, iverilog bit-exact. Proven on a live AX7203 (uart_train2.v): with both weights in registers the whole forward+backward+update runs on-chip; streaming a hidden function w*=(1.0,0.5) the board discovers BOTH params (w0 0.25->1.03, w1 0.25->0.48). docs/NOW.md updated. Refs #1764