fix: Skippy Nemotron MTP loading - #1245
Conversation
|
This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review. |
📝 WalkthroughWalkthroughThe patch adds disabled, integrated, and external MTP source selection to the Skippy ABI and runtime configuration. Server loading paths propagate the selection, llama.cpp enforces it during model loading, and tests cover all three modes. ChangesMTP source selection
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant BinaryStage
participant RuntimeLoader
participant NativeModelLoader
participant DraftAttacher
BinaryStage->>BinaryStage: resolve MTP source
BinaryStage->>RuntimeLoader: load runtime with override
RuntimeLoader->>NativeModelLoader: apply selected MTP source
NativeModelLoader->>DraftAttacher: load or attach MTP tensors
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
i386
left a comment
There was a problem hiding this comment.
Sol high-effort review found one actionable P1. The patch queue applies cleanly to the pinned llama.cpp revision, and the submitted integrated Nemotron MTP smoke test does not cover the configuration paths below.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/skippy-quantize/src/mtp_attach.rs (1)
199-205: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the new MTP source contract in the test.
runtime_confignow accepts and storesmtp_source, but this test does not inspectconfig.mtp_source. A regression that drops the new argument would still pass. AssertMtpSource::Disabledhere, and add a focused case forMtpSource::External, which is used by the attached draft path on Lines 80-86.Suggested assertion
assert!(config.include_output); + assert!(matches!(config.mtp_source, MtpSource::Disabled));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/skippy-quantize/src/mtp_attach.rs` around lines 199 - 205, Extend the test around runtime_config to assert that config.mtp_source preserves MtpSource::Disabled. Add a focused test case covering MtpSource::External, including the attached draft configuration path referenced by the existing test setup, and verify the stored source value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/skippy-quantize/src/mtp_attach.rs`:
- Around line 199-205: Extend the test around runtime_config to assert that
config.mtp_source preserves MtpSource::Disabled. Add a focused test case
covering MtpSource::External, including the attached draft configuration path
referenced by the existing test setup, and verify the stored source value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b60fff82-0e73-4b5f-b46d-034ab01f0adc
📒 Files selected for processing (4)
crates/skippy-prompt/src/prompt_cli/binary_repl.rscrates/skippy-prompt/src/prompt_cli/draft.rscrates/skippy-prompt/src/prompt_cli/mod.rscrates/skippy-quantize/src/mtp_attach.rs
29a95b3 to
6c58c1d
Compare
Summary
Root cause
llama_model_params.load_mtpdefaults to false, so Skippy omitted Nemotron’s NextN tensors before creating its native MTP context. Once enabled, the hybrid cache path also excluded the appended MTP layer, causing MTP execution to access an invalid KV-cache index.A terminal stage’s
include_outputflag only identifies output ownership; it does not select an MTP mode. Inferring MTP from that flag loaded NextN tensors and created an integrated context even when native MTP was disabled. It also blocked an explicitly configured external MTP sidecar from attaching.Impact
NVIDIA Nemotron 3.5 Lightning can load and execute native MTP speculation through Skippy. Disabled MTP now retains no optional MTP tensors or KV context, while an external sidecar can attach to a target that contains integrated MTP tensors.
Skippy ABI change
ABI version: 0.1.37 → 0.1.38.
enum skippy_mtp_source { DISABLED, INTEGRATED, EXTERNAL }.enum skippy_mtp_source mtp_sourcetostruct skippy_runtime_config.Validation
0001–0018throughscripts/prepare-llama.sh pinnedscripts/build-llama.shcargo check -p skippy-servercargo test -p skippy-runtime --lib(71 tests)cargo test -p skippy-server --lib(398 tests; model-backed GLM MTP fixtures remain opt-in)just buildNVIDIA-Nemotron-3.5-Lightning-30B-A3B-Q4_K_Mand completed a native-MTP request: 12 drafted, 3 accepted, 0 rejected; 5 generated tokens at 42.38 tok/sSummary by CodeRabbit