fix(peagle): refuse a reduced draft vocabulary without a t2d/d2t mapping - #66
Conversation
The EAGLE-3 backend refuses draft_vocab_size != vocab_size unless the draft checkpoint supplies valid t2d/d2t buffers, then validates them. P-EAGLE overrides build_model entirely and does neither. Setting peagle_draft_vocab_size below the target vocabulary therefore falls through to the model constructor's default, t2d[:draft_vocab_size] = True, which means "the draft vocabulary is target token ids 0..N-1". On any real tokenizer that is an arbitrary slice with no relation to token frequency, and the draft can never emit anything outside it. Training reports nothing unusual because the loss restricts the target logits to the same slice. Give P-EAGLE the same guard, loading the checkpoint with output_loading_info so a supplied mapping is detected the way EAGLE-3 detects it. The shared _validate_vocab_mapping is inherited by every EAGLE-family backend, so its messages now name the algorithm that failed instead of always saying EAGLE3. Signed-off-by: khazic <khazzz1c@gmail.com>
|
The
#68 and #70 are the clearest: neither touches the dspark or the dflash code path, yet those are the jobs that failed. Within a single run the three example jobs are serialized (on #63 they ran 11:25:05 to 11:42:21, 11:42:46 to 12:01:01, 12:01:27 to 12:19:55), so the contention comes from runs of different PRs overlapping. The failures cluster in the window where three PRs had example jobs in flight at once, and every job that started after that queue drained passed. The failed jobs also died in about 12 minutes against roughly 17 for a successful one, consistent with dying at engine init rather than during real work.
Could a maintainer re-run the failed job? I do not have the permission to ( |
Problem
Eagle3TrainerBackend.build_modelrefuses a reduced draft vocabulary that has no real mapping behind it:PEagleTrainerBackendoverridesbuild_modelentirely and has neither the guard nor the validation call.Setting
peagle_draft_vocab_sizebelow the target vocabulary therefore falls through to the model constructor's default:That means "the draft vocabulary is target token ids
0..N-1". On any real tokenizer that is an arbitrary slice with no relation to token frequency, and the draft can never emit anything outside it. Nothing in training complains, becausecompute_lossrestricts the target logits to the very same slice viaselected_token_ids(), so the loss and the accuracy metric both look healthy while the draft is structurally incapable of proposing most of the vocabulary.Fix
Give P-EAGLE the same guard, loading the checkpoint with
output_loading_info=Trueso a supplied mapping is detected exactly the way EAGLE-3 detects it, and run_validate_vocab_mappingafterwards.The full-vocabulary default (
draft_vocab_size == vocab_size, which is what you get whenpeagle_draft_vocab_sizeis unset) is unaffected and still needs no mapping file._validate_vocab_mappingis inherited by every EAGLE-family backend, so its messages now name the algorithm that actually failed instead of always sayingEAGLE3. The label comes frommodel_type, so it matches thespeculative_algorithmvalue the user configured.Validation
Ran a before/after repro on both
mainand this branch. It configures a reduced draft vocabulary (16 of the target's 32 tokens) with not2d/d2tsupplied, prints the fallback mapping the model constructs, and reports whether the backend refuses the configuration.Before/after repro output
On
mainthe misconfiguration only surfaces as an unrelated failure much later (here, the placeholder target path used by the repro). With a real target path it does not surface at all.Tests
Three new tests in
tests/integration/test_peagle_backend_contract.py:test_peagle_rejects_reduced_draft_vocab_without_mappingcovers the guard and its message.test_peagle_identity_vocab_mapping_passes_validationpins that the full-vocabulary default still needs no mapping.test_vocab_mapping_validation_names_the_failing_algorithmcovers the label on both EAGLE-3 and P-EAGLE.Full CPU suite (
tests/integration tests/compat tests/config tests/examples) run on both sides:Test suite before/after
The same 9 tests fail on
mainand on this branch. They need optional dependencies (VeOmni, the NPU vLLM stack) that are absent in this environment, so they are pre-existing and unrelated. The+3on this branch are the new tests above.