perf: share vocab-parallel top-k logits for target and draft - #1534
Open
sufubao wants to merge 8 commits into
Open
perf: share vocab-parallel top-k logits for target and draft#1534sufubao wants to merge 8 commits into
sufubao wants to merge 8 commits 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.
Summary
Reduce full-vocabulary all-gather traffic by sharing a vocabulary-parallel top-k output path between target and draft models, following the approach in #1512.
Sparse probabilities are normalized over the candidate set and are intentionally approximate, including draft probabilities used by dynamic MTP.
Configuration
LIGHTLLM_VOCAB_PARALLEL_TOPK=1: enable target-model sparse output (disabled by default).LIGHTLLM_VOCAB_PARALLEL_TOPK_SIZE: positive local candidate count, default128, capped at the smallest TP vocabulary shard. Set the same value on every rank before startup.Validation
git diff --checkpassed.Reproduce the related tests with two available GPUs:
Performance scope
The following H200 BF16 microbenchmarks compare local candidate collection against the previous PR head (
f99737d1). They use CUDA Graph median latency and exclude model execution and communication. Runs and the benchmark source were archived throughexp.Deterministic tie handling adds a local argmax pass for k > 1. The k = 1 path now uses max directly. End-to-end throughput and model accuracy have not been measured in this update; these local timings do not establish an overall serving speedup.
CPU overlap input preparation was also compared against
f9c3443b, using identical current per-microbatch preparation in both versions and alternating nine timing rounds. At batch 128, median prefill preparation decreased from 442.28 to 393.56 µs, and decode from 281.67 to 233.05 µs by reusing eligibility flags instead of rescanning requests. These are CPU microbenchmarks, not end-to-end throughput measurements. Recorded withexpas260907-113027-python-tmp-lightllm-ponytail-k6a9iY-bench-py.