[FDConfig]Remove max_num_batched_tokens/max_num_seqs in parallel config#4116
Merged
Jiang-Jia-Jun merged 7 commits intoPaddlePaddle:developfrom Sep 17, 2025
Merged
Conversation
|
Thanks for your contribution! |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR moves max_num_batched_tokens and max_num_seqs configuration parameters from ParallelConfig and FDConfig to a dedicated SchedulerConfig class. This refactoring improves the separation of concerns by placing scheduler-related configuration parameters in their appropriate config class.
- Introduces
SchedulerConfigimport and instantiation across test files and worker components - Updates all references to use
scheduler_config.max_num_batched_tokensandscheduler_config.max_num_seqsinstead of parallel_config equivalents - Modifies config initialization in args_utils to properly pass parameters to SchedulerConfig
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/v1/test_schedule_output.py | Updates test to use SchedulerConfig and new config structure |
| tests/v1/test_prefix_cache.py | Updates test configuration to use SchedulerConfig |
| tests/utils/test_config.py | Updates test assertions to access scheduler config properties |
| tests/utils.py | Moves max_num_seqs from parallel_config to scheduler_config |
| tests/graph_optimization/*.py | Updates multiple graph optimization tests to use SchedulerConfig |
| fastdeploy/worker/*.py | Updates worker components to access scheduler config properties |
| fastdeploy/spec_decode/base.py | Updates to use scheduler_config for max_num_seqs |
| fastdeploy/scheduler/config.py | Adds max_num_batched_tokens and max_num_seqs to SchedulerConfig |
| fastdeploy/model_executor/models/deepseek_v3.py | Updates buffer allocation to use scheduler config |
| fastdeploy/model_executor/layers/sample/sampler.py | Updates early stopper initialization |
| fastdeploy/model_executor/layers/backends/gcu/attention/*.py | Updates attention backends to use scheduler config |
| fastdeploy/model_executor/layers/attention/*.py | Updates attention components to use scheduler config |
| fastdeploy/model_executor/guided_decoding/xgrammar_backend.py | Updates batch size configuration |
| fastdeploy/engine/*.py | Updates engine components to use scheduler config |
| fastdeploy/config.py | Removes max_num_batched_tokens and max_num_seqs from ParallelConfig and FDConfig, adds SchedulerConfig integration |
fastdeploy/config.py
Outdated
| self.long_prefill_token_threshold = int(self.max_model_len * 0.04) | ||
|
|
||
| self.cache_config.postprocess(self.max_num_batched_tokens, self.max_num_seqs) | ||
| self.cache_config.postprocess(self.scheduler_config.max_num_batched_tokens, self.max_num_seqs) |
There was a problem hiding this comment.
This should use self.scheduler_config.max_num_seqs instead of self.max_num_seqs for consistency and to ensure the scheduler config values are used throughout.
Suggested change
| self.cache_config.postprocess(self.scheduler_config.max_num_batched_tokens, self.max_num_seqs) | |
| self.cache_config.postprocess(self.scheduler_config.max_num_batched_tokens, self.scheduler_config.max_num_seqs) |
Jiang-Jia-Jun
approved these changes
Sep 17, 2025
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.
移除parallel_config和FDConfig中的max_num_batched_tokens和max_num_seqs,将其放入SchedulerConfig