Repository navigation
Conversation
Port the reference tree buffers, candidate construction and greedy acceptance, and add a standalone Hugging Face Target evaluator that reports acceptance length, greedy decode equality and repeat stability. Tree buffers match the pinned Medusa revision exactly; the evaluator is a reference component, not a serving runtime.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Extend the consumer beyond greedy: deterministic typical acceptance and seeded nucleus sampling, with verifier logits, CLI flags, docs and tests. Decode equality stays greedy-only; sampling reports acceptance and repeat stability only.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR status: not ready for review
This is the inference-side increment for #17 (Track A).
Summary
aspec/inference/medusa_consumer.pyports the reference Medusa tree buffers (indices, positions, retrieval paths, ancestor mask), candidate construction from one Target post-norm hidden state, batched teacher-forced path verification, and acceptance accounting (accept_length + 1per verifier call). Policies: greedy, deterministic typical, and seeded nucleus sampling.python -m tools.evaluate_medusa_acceptancemeasures acceptance length, greedy decode equality and repeat stability against a Hugging Face Target (--sampling greedy|typical|nucleus, temperature/top-p/posterior thresholds/seed), recording the draft manifest, Target path, tree-config hash and hardware. Decode equality is only reported for greedy.generate_candidates.This component is not a serving runtime: the caller owns the Target verifier and cache policy. No throughput claim is made.
GPU validation
The consumer was exercised end-to-end on the existing K=2 smoke draft with Qwen3-8B on one L20:
decode_equal=true,repeat_stable=true.--temperature 0.7) and seeded nucleus sampling (--temperature 0.7 --top-p 0.8 --seed 0) on 2 prompts x 16 tokens: acceptance length 1.1852 each,repeat_stable=true; decode equality is not applicable to sampling.This validates the consumer/evaluator path. K=5 training, recipe and held-out evidence are tracked
outside this PR.
Checks actually run
pytest -q tests/cpu tests/source— 1271 passedruff check aspec tests tools setup.py— passpython -m tools.check_docs— passpython -m compileall -q aspec tests tools— passNot in scope
Part of #17.