Repository navigation
[FEAT] Add speculative decoding optimization support - #40
Merged
Merged
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
Add optional
speculative_decodingstudy configuration so Optuna can tune vLLM speculative decoding (EAGLE3, MTP, dflash, etc.) with synthetic rejection sampling, alongside existing target-model parameters.Why
Speculative decoding is a major throughput lever for vLLM serving, but the search space is conditional (on/off toggle, method choice, k slicing, draft vs target settings). Users had no way to optimize these settings within auto-tuning-vllm studies.
What changed
auto_tune_vllm/core/speculative.py— new module: config validation, Optunasuggest(), JSON assembly for--speculative-configauto_tune_vllm/core/config.py— parsespeculative_decodingYAML block; rejectsampler: gridwhen enabledauto_tune_vllm/core/study_controller.py— vLLM >= 0.20 version gate at study start; injectspeculative_configinto trial parametersauto_tune_vllm/cli/main.py— skip auto grid-mode when speculative search is active;validateshows speculative status and adjusted cardinalityauto_tune_vllm/utils/vllm_cli_parser.py— more robust vLLM version detection (importlib + fallbacks)docs/configuration.md— full speculative decoding section (methods, synthetic modes, limitations)examples/study_config_speculative_decoding.yaml— EAGLE3 + synthetic acceptance example (Qwen3-8B)README.md— move speculative decoding from future work to completedHow tested
ruff check .pytest -v tests/(108 passed)auto-tune-vllm optimize --config examples/study_config_speculative_decoding.yamlon vLLM >= 0.20 with GPURisks / limitations
speculative.py/ config parsing yet — validation logic is exercised only indirectly via existing suitesampler: gridspec_method,spec_num_speculative_tokens); only composedspeculative_configJSON is in trial paramscompleted_trials/n_trials(pre-existing behavior; unchanged by this PR)Links