Devotd Github
NewInference & serving

1bit-monster/engine — Add routing evaluation and encoder dump commands

Commands were added to 1bit-monster/engine to measure the accuracy of model-selection routing and to dump the decision head inputs.

Repository1bit-monster/engine ↗

Commands were added to 1bit-monster/engine to measure the accuracy of model-selection routing and to dump the decision head inputs.

GitHub description: 1bit engine: local LLM inference for AMD Ryzen AI (Strix Halo) inside Lemonade. HRX with our Loom kernels on the Radeon iGPU, plus the XDNA 2 NPU; OpenAI-compatible API. Runs Qwen3.8, Zyphra ZAYA1, ternary Bonsai.

stars
★ 5
Forks
2
Language
C++
License
Apache-2.0
Read original source ↗View on GitHub ↗

The latest commit of 1bit-monster/engine (2026-11-07, 0f45221), which runs local LLM inference on AMD Ryzen AI (Strix Halo), added a command that measures model-selection routing. In the engine, which uses the Radeon iGPU's HRX and XDNA 2 NPU together and provides an OpenAI-compatible API, `--eval` and `--dump-encoder` were added to `1bit route --laya-models`.

Both options reproduce exactly the path the server actually takes (the Laya decision after the size gate). `--eval` reads a labeled state list (CASES.jsonl) and computes accuracy, per-class recall and precision, a confusion matrix, confidence, ECE (expected calibration error), log loss, and decision time. The computation code was split out into `laya/eval.cpp`, and a unit test (`laya_eval_test`) that can be validated without a checkpoint along with `laya_eval_e2e.sh`, which confirms actual execution, were added.

`--dump-encoder` saves the inputs that the decision head receives, per state. The encoder output right after the final normalization (h.f32), marker positions, qtype, and the logits and probabilities computed by the engine come out as cases.jsonl, so fine-tuning only the head requires neither the encoder nor a second tokenizer. The new path requires turning on the scorer's `RawOutput::keep_encoder`, and the default path is unchanged.

That said, this commit adds a feature; it is not evidence that routing quality improved. The commit message only states that the evaluation arithmetic was tested without a checkpoint and presents no actual figures. The size of the change is 740 lines added and 3 lines deleted, and the new files carry an Apache-2.0 header. If you want to re-measure the path with your own data, running this evaluation command first is the closer route.