feat: GF-T on-chip trainer primitive (forward+grad+update, proven on AX7203) - #1817
Merged
Conversation
gft_train1.t27: on_comb(w,x,t,eta) runs one full SGD step of a 1-weight linear neuron combinationally -- forward y=w*x, error e=y-t, gradient g=e*x, update w'=w-eta*g -- reusing the verified smul/sadd/neg/mag* helpers from gft_sgd_step. The on-device training primitive: with the weight in a register, the whole forward+backward+update runs on-chip and the host streams only (x,t) data. Proven on a live AX7203 (uart_train1.v): streaming (x, t=1.5*x) with varying x, the board's weight converges 0.25 -> ~1.42 toward the hidden w*=1.5. In-spec tests 3/3 (learn/optimum/ascend), 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.
Single-commit replacement for #1816 (that branch had docs commits without issue refs → L1 traceability). New spec gft_train1.t27 — on-device training primitive: on_comb(w,x,t,eta) runs one full SGD step (forward y=wx, error e=y-t, gradient g=ex, update w-etag) combinationally, reusing gft_sgd_step helpers. In-spec 3/3, iverilog bit-exact. Proven on a live AX7203 (uart_train1.v): with the weight in a register the whole forward+backward+update runs on-chip; streaming (x, t=1.5x) the board converges 0.25->~1.42 toward hidden w*=1.5. docs/NOW.md updated. Refs #1764