Skip unsupervised teacher projections in pruned EAGLE3 targets - #15
Open
julyanghar wants to merge 1 commit into
Open
julyanghar wants to merge 1 commit into
julyanghar wants to merge 1 commit into
Conversation
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.
With vocabulary pruning and sparse supervision,
compute_target_p_paddedcurrently projects every teacher row into the draft vocabulary and softmaxes the full sequence, even though TTT loss only reads supervised rows. This change projects supervised hidden rows in the existing chunks and scatters their probabilities into the original dense lookup table. Unsupervised rows are zero; shapes, padding, and position-mask semantics are preserved.When all rows are supervised, retain the dense path to avoid gather/scatter overhead. The lazy target path and draft backbone are unchanged.
Validation:
TORCH_COMPILE_DISABLE=1 python -m pytest tests/test_target_projection.py tests/test_mtp.py -k "not TestMTPServeAlignment and not TestMTPUlyssesAllToAll" -q.git diff --checkpassed for changed files.TestMTPServeAlignmentimport failures due to missing systemlibibverbs.so.1; all four also reproduce on untouched based3412be. Distributed MTP coverage was not completed and is excluded above. No full training/distributed validation is claimed.Function-only CUDA benchmark (not end-to-end training): RTX 6000 Ada, PyTorch 2.11.0+cu130, BF16, B=1, H=1024, full vocabulary=65536, draft vocabulary=32768, depth=7, chunk=4096. Identical inputs per arm, three warmup calls, four alternating AB/BA pairs with five calls per arm, synchronized host wall time and no profiler. Times below are averages in milliseconds; reduction denominator is baseline time. BF16 valid-row probabilities and position masks were also compared.
The full probability lookup allocation remains; this PR does not introduce compact target-table storage. Full training throughput and training quality were not measured.