Repository navigation
Conversation
Register MedusaDraftModel as the medusa family and connect the heads-only objective end to end: - heads-only attention/structure policies and validation backends - Plan gates: SDPA only, CP1, MBS1, non-packing, no teacher/logits slot, no compile/anchors/frozen head; objective records per-head CE - single-slot post-norm feature contract shared with native MTP, and the producer publishes the final state for medusa - MedusaTrainer over the existing optimizer/checkpoint path; topology pins head count and uniform per-head loss weights - shipped Qwen3-8B K=5 draft config, Store/TCP 4K example, docs page Adds CPU integration contracts for every gate and the producer hook.
|
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. |
5 tasks
Contributor
Author
|
Branch updated to merge the latest main (
|
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.
Summary
Second increment for #17: register the heads-only Medusa family and connect it to Plan, the feature contract, the producer and the trainer, after the model/loss core landed in #32.
MedusaDraftModelresolves to themedusafamily; heads-only attention/structure policies (no invented head geometry); checkpoint semantics include head count and depth.prediction_start=2and the full vocabulary.{mtp, medusa}; the producer publishes the final state for medusa.MedusaTrainerreuses the existing optimizer/checkpoint/ownership path; the topology pins head count and uniform per-head weights, and exact resume rejects a head-count change.docs/user-guide/medusa.md, and support/algorithms entries.tests/cpu/test_medusa_integration.pycovers registration, heads-only policies, Plan compilation plus one illegal case per gate, the producer hook, and checkpoint topology/resume.Outcome: a config can now select the medusa family and compile a Plan, and training runs through the existing path. Export, a maintained recipe, per-head held-out observations and candidate-tree acceptance remain PR-3.
Checks actually run
Environment: isolated venv, Python 3.12, torch 2.13.0+cpu, transformers 5.12.1 (CI CPU lane), merged main
e113c13.ruff check aspec tests tools setup.py— passpython -m tools.check_docs— passpython -m compileall -q aspec tests tools— passpytest -q tests/source— 7 passedCUDA_VISIBLE_DEVICES="" HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 pytest -q tests/cpu— 1047 passed (incl. 63 Medusa tests)e113c13) kept the DFlash objective fields intact; the full offline suite passes on the merged tree.configs/examples/medusa_qwen3_8b_4k_tcp.yamlagainst a local Qwen3-8B config shape: objectivenum_heads=5, single post-normhidden_states,ttt_length=5,ploss_weights=[1.0]*5GPU validation status (pending)
The 2x L20 smoke could not be scheduled: multi-GPU L20 requests stayed Pending while the user's own two-GPU jobs queued for 114+ minutes on the shared cluster, and the H200 pool is not available to this team. This PR claims no GPU training or resume result. The example uses SDPA and Store/TCP (no NVLink); the intended validation is
--dry-runplan, an 8-step run and an exact resume.Capacity note: K=5 on Qwen3-8B is about 3.2B trainable parameters (~51 GB with bf16 weights/gradients and Adam state in REPLICATE). A single 48 GB device is expected to OOM, so the smoke plan falls back to 1T+2D with
fsdp_strategy: SHARDwhen needed.Unverified scope
initial_draft_model_path), FULL_SHARD configurations beyond the documented fallback, packing/CP/FA4, multi-node.Part of #17.