Support Bonsai-27B affine Q1 - #212
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughBonsai Q1 support now handles symmetric affine checkpoints through sentinel bias representation, specialized Metal kernels, Qwen3.5 loader and execution paths, and related tests and documentation. Qwen3.5 Q1 metadata also enables prefill cache clearing. ChangesBonsai Q1 support
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
What
bias = -scale / 2in Metal instead of retaining redundant bias tensorsWhy
prism-ml/Bonsai-27B-mlx-1bitdeclaresmodel_type = "qwen3_5", so it loads throughqwen3_next, not the Qwen3-shaped Bonsai engine. Its generic affine paths previously called upstream MLX withbits = 1, but the pinned MLX revision has no affine Q1 kernels.The initial working path exposed three additional costs:
VPT=64made the decode shader register-pressure limited on a base M4.Measured impact
Measured with the exact checkpoint on a 10-GPU-core base M4:
VPT=64 -> 32, +32%)A temporary, evaluation-only Q4 MTP sidecar adapter (not included here) confirmed the narrow-M bottleneck with nonzero acceptance telemetry: depth-1 MTP improved from 0.99 to 10.11 tok/s after packed Q1 verification at the same 53.7% acceptance. A longer 256-token run was still slower than greedy (11.03 vs 18.82 tok/s) because rejected drafts require recurrent-cache replay. This PR therefore does not enable or claim a speculative-decoding speedup.
Validation
[2,4,K]leading dimensionscargo test -p higgs-models --lib -- --test-threads=1(430 passed, 26 ignored)cargo clippy -p higgs-models --lib -- -D warningscargo check -p higgs-modelscargo fmt --allLimitations / non-goals
HIGGS_BONSAI_QMM_MAX_ROWScontrols the threshold.Summary by CodeRabbit
New Features
Bug Fixes
Documentation