Ternary/int8 QAT on a JAX-NNX transformer (Bonsai-style 1.58-bit)#47
Open
kmheckel wants to merge 1 commit into
Open
Ternary/int8 QAT on a JAX-NNX transformer (Bonsai-style 1.58-bit)#47kmheckel wants to merge 1 commit into
kmheckel wants to merge 1 commit into
Conversation
…8-bit) research/new/ternary_llm/ demonstrates spyx.quant generalizes beyond spiking nets: its BitNet-ternary and int8 QAT (bitnet_ternary_rules / weights_only_rules, matched by op on dot_general) apply unchanged to a tiny decoder-only transformer built from nnx.Linear — the same 1.58-bit-weight approach as PrismML's Bonsai LLMs. 3-way QAT comparison (same arch/seed/data): fp32 ppl 14.24, int8 14.31, ternary 13.46 — ternary stays competitive with fp32. Quantization verified genuinely active (forward logits differ; ternary weights take few discrete codes, not a no-op). SMOKE=1 runs the full comparison on CPU in ~a minute. Note: qwix has no true 1.58-bit qtype, so 'ternary' is an int2 (4-code) approximation — disclosed in the study. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Shows
spyx.quantgeneralizes beyond spiking nets: its BitNet-ternary and int8 QAT apply unchanged to a decoder-only transformer (rules match by op ondot_general, so anynnx.Linearqualifies) — the same 1.58-bit-weight approach as PrismML's Bonsai LLMs.research/new/ternary_llm/— a tiny NNX GPT + a fair 3-way QAT comparison:Ternary stays competitive with fp32. Quantization verified genuinely active (forward logits differ; quantized weights take few discrete codes — not a silent no-op).
SMOKE=1runs the full comparison on CPU in ~a minute; no new deps (reusesspyx.quant).Honest caveat: qwix has no true 1.58-bit qtype, so 'ternary' is an int2 (4-code) approximation — disclosed in the study README. Pairs with the LiteRT export PR as the two edge-efficiency LOEs.
🤖 Generated with Claude Code