[vllm] Fix CLI argument serialization for list types #4869
Merged
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.
What does this PR do?
Fixes CLI argument serialization for list-type config values in async vLLM server. Lists like
cudagraph_capture_sizes=[1, 2, 4, 8]are now correctly expanded to separate CLI arguments.Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI)Test
Added CPU unit tests in
tests/workers/rollout/test_vllm_cli_args_on_cpu.pycovering:['--key', 'value']['--key'], Bool False → skipped['--key', '1', '2', '3']nargs="+"requires at least one value)API and Usage Example
No API changes.
Design & Code Changes
Problem:
When passing list-type configuration values (e.g.,
cudagraph_capture_sizes) to the vLLM async server, the old code usedstr(list)which produces"[1, 2, 4, 8]"as a single argument.However, vLLM's argparse uses
nargs="+"for list arguments, which expects multiple space-separated values like--cudagraph-capture-sizes 1 2 4 8.This caused argparse to fail with:
invalid int value: '[1, 2, 4, 8]'Solution:
build_cli_args_from_config()helper function for testabilitynargs="+"requires at least one value)Checklist Before Submitting
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=alwaysci-requestchannel in theverlSlack workspace.