Skip to content

feat(neural): export int8 lstm.bin (+ parity fixture)#34

Open
mkpoli wants to merge 1 commit into
masterfrom
feat/neural-export
Open

feat(neural): export int8 lstm.bin (+ parity fixture)#34
mkpoli wants to merge 1 commit into
masterfrom
feat/neural-export

Conversation

@mkpoli

@mkpoli mkpoli commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Serializes the trained LSTM to a compact lstm.bin for the Rust DLL (no ONNX runtime). Big matrices → per-tensor symmetric int8 + f32 scale; biases f32.

int8 is free: the dequantized model scores the SAME KSR as fp32 — 38.9 (in-vocab 44.9), at 4.37 MB, max dequant error 0.054.

  • --emit-checkpoint writes a dequantized model.pt so eval_ksr.py measures the as-shipped KSR (it did: 38.9, unchanged).
  • --emit-parity writes a JSON fixture for the Rust module's parity test.

Stack: thisfeat/neural-rs (module) → feat/neural-wire (wiring). lstm.bin/fixtures are git-ignored (corpus-derived).

Serializes the trained LSTM to a compact `lstm.bin` the Rust DLL will load and
run with a hand-rolled forward pass (no ONNX runtime). The four big matrices
(embedding, the two LSTM weights, the output projection) are per-tensor
symmetric int8 + an f32 scale; biases stay f32.

Result: **4.37 MB**, and int8 is *free* — the dequantized model scores the SAME
KSR as fp32 (38.9, in-vocab 44.9), max dequant error 0.054. So we ship int8.

- --emit-checkpoint writes a dequantized model.pt so eval_ksr.py can measure the
  as-shipped KSR (it did: 38.9, unchanged).
- --emit-parity writes a JSON fixture (explicit-math forward on the exported
  weights) for the upcoming Rust module's parity test.

Binary layout documented in the module header. lstm.bin / fixtures are
git-ignored (corpus-derived); regenerate with this script.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 143e48c8-7963-49f8-9b12-12ac409c18bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/neural-export

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mkpoli mkpoli force-pushed the feat/neural-predictor-experiment branch from 6d89903 to c3e9296 Compare June 27, 2026 07:22
@mkpoli mkpoli force-pushed the feat/neural-export branch from a3bb3af to 13f8f82 Compare June 27, 2026 07:22
@mkpoli mkpoli force-pushed the feat/neural-predictor-experiment branch from e8242ef to db94c4c Compare June 27, 2026 10:20
@mkpoli mkpoli force-pushed the feat/neural-export branch from 13f8f82 to 37a31f3 Compare June 27, 2026 10:20
@mkpoli mkpoli changed the base branch from feat/neural-predictor-experiment to master June 27, 2026 11:15
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