Skip to content

Conversation

hmellor
Copy link
Member

@hmellor hmellor commented Apr 12, 2025

Follows #16332 and #16422

Notable changes:

  • Updates ParallelConfig.distributed_executor_backend to use Literal[...] instead of str
  • Rename nullable_str to optional_str (which sounds more Pythonic) and add other optional type methods
  • Make the conversion of config docstring to argparse arguments much more robust
  • The default for multi_step_stream_outputs was True in EngineArgs and False in SchedulerConfig. I chose the config from EngineArgs

hmellor added 5 commits April 12, 2025 13:22
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the frontend label Apr 12, 2025
@hmellor hmellor changed the title Improve-scheduler-config Improve configs - SchedulerConfig Apr 12, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
hmellor added 5 commits April 12, 2025 17:30
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor hmellor requested a review from DarkLight1337 April 12, 2025 17:48
@hmellor hmellor added the ready ONLY add when PR is ready to merge/full CI is needed label Apr 12, 2025
@hmellor
Copy link
Member Author

hmellor commented Apr 12, 2025

Failures are relevant, I'll look into it

hmellor added 2 commits April 13, 2025 10:59
… instantiated

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

# Maximum number of sequences to be processed in a single iteration.
max_num_seqs: int = 128
max_num_seqs: int = None # type: ignore
Copy link
Member

@DarkLight1337 DarkLight1337 Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since None is resolved inside EngineArgs or ModelConfig, I feel that we should not allow it to be None when initializing SchedulerConfig

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is None so that the default in EngineArgs is None.

We have the same problem with the max_num_batched_tokens and max_model_length. It can't be optional in the config because maths is done on them in __post_init__, but they must have None defaults so that EngineArgs can have them as optional.

Where would you change behaviour so that the defaults here are not None?

Copy link
Member

@DarkLight1337 DarkLight1337 Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a from_optional method just like the one for SamplingParams to resolve the None values

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using post init to overwrite None values leads to a bunch of issues with type checking since downstream access of these attributes will unnecessarily need to consider the None case in order to avoid type checking errors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a from_optional method just like the one for SamplingParams to resolve the None values

Would we then need to change everywhere SchedulingConfig is instantiated? And then remember to instantiate it that way?

Using post init to overwrite None values leads to a bunch of issues with type checking since downstream access of these attributes will unnecessarily need to consider the None case in order to avoid type checking errors.

I agree, but that's why there in SchedulingConfig the type is int but in EngineArgs the type is Optional[int], so that the type cheking is happy.

Copy link
Member Author

@hmellor hmellor Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth noting that prior to this PR, this is how we handled max _num_batched_tokens.

I changed the other two here so that they would no longer have arbitrary defaults that could be inherited by EngineArgs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per offline discussion, this is the cleanest way given how the configs are set up right now. We can address this later

@DarkLight1337 DarkLight1337 merged commit e51929e into vllm-project:main Apr 14, 2025
47 checks passed
@hmellor hmellor deleted the improve-scheduler-config branch April 14, 2025 09:30
yangw-dev pushed a commit to yangw-dev/vllm that referenced this pull request Apr 21, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Yang Wang <elainewy@meta.com>
jikunshang pushed a commit to jikunshang/vllm that referenced this pull request Apr 29, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Apr 29, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants