Skip to content

tools: device check that drafted output equals plain under seeded sampling - #5249

Merged
ashhart merged 6 commits into
mainfrom
lead/draft-parity-check
Nov 27, 2026
Merged

ashhart merged 6 commits into
mainfrom
lead/draft-parity-check

Conversation

@ashhart

@ashhart ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Drafts must never change output. Until now nothing checked that on a device under sampling, and #5223 showed the gap: a checkpoint without MTP weights starts with no drafts, so a drafted run can pass while testing nothing.

tools/draft_parity.py starts the same native server binary twice on one local checkpoint, first with its default drafts and then with --no-drafts, and sends identical requests: two prompts (or your own via --prompts), seeds 0, 1 and 1234 at temperature 1.0 / top_p 0.95, plus a greedy cell each. Generated token-id arrays must match exactly. The check refuses to report a pass when the drafted run accepted no drafts, and --require-mtp also requires the startup MTP label. report.json and the exit status are the result: 0 pass, 1 a divergence, 2 setup or evidence problems. It binds loopback only and prints no local paths or names.

A registered entry exists (zig build device-draft-parity -- MODEL --binary BIN --output DIR), plus zig build test-draft-parity-host for the comparison and refusal logic, with startup and request timeout regressions. Engine code is untouched.

First use, on an M3 Ultra with TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit at d9d758fb (MTP + copies, about 1,100 of 1,700 drafted tokens accepted): current main passes every cell, including a German summary prompt. That is evidence for #5223 on that chip only, not a fix.

  • Synthena

@ashhart
ashhart force-pushed the lead/draft-parity-check branch from 2d02c16 to 859d860 Compare November 27, 2026 13:00
@ashhart
ashhart merged commit f40f648 into main Nov 27, 2026
1 check failed
@ashhart
ashhart deleted the lead/draft-parity-check branch November 27, 2026 13:00
ashhart added a commit that referenced this pull request Nov 27, 2026
ashhart added a commit that referenced this pull request Nov 27, 2026
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