test: add parse_cli_args coverage for vLLM nested arg preservation (fixes #3348)#4019
Open
finaspirant wants to merge 1 commit into
Open
Conversation
…KGovernmentBEIS#3348) parse_cli_args had zero test coverage. This adds 6 tests covering the full -M flag pipeline for dotted vLLM arguments, including the regression case from UKGovernmentBEIS#3348 where nested underscores (e.g. num_speculative_tokens) were being mangled to hyphens (num-speculative-tokens), breaking pydantic validation in vLLM's SpeculativeConfig. The _server_arg_to_cli_key fix landed in UKGovernmentBEIS#4016; these tests lock in the correct behaviour at the CLI parsing layer. Fixes UKGovernmentBEIS#3348
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
Adds unit tests for
parse_cli_args— the CLI layer that processes-Mflags— to prevent regression of issue #3348.
Background
When running:
inspect eval task.py --model vllm/model \ -M speculative-config.num_speculative_tokens=1the argument flows through two stages:
parse_cli_argsnormalises the full key string (hyphens → underscores)_server_arg_to_cli_keyconverts back to CLI format forvllm serve,preserving underscores in nested segments
In v0.3.183, stage 2 used a global
.replace("_", "-")which mangled thenested portion —
num_speculative_tokens→num-speculative-tokens— breakingpydantic validation in vLLM's
SpeculativeConfig. The fix landed in #4016 via_server_arg_to_cli_key, with tests added intests/util/test_local_server.py.parse_cli_args(stage 1) had zero test coverage. This PR adds it.Tests Added
tests/cli/test_parse_cli_args.py— 6 tests:-Mflags combined=) handlingFixes #3348