Skip to content

Allow users to pass arbitrary JSON keys from CLI#18208

Merged
vllm-bot merged 14 commits intovllm-project:mainfrom
hmellor:allow-individual-json-keys-in-cli
May 16, 2025
Merged

Allow users to pass arbitrary JSON keys from CLI#18208
vllm-bot merged 14 commits intovllm-project:mainfrom
hmellor:allow-individual-json-keys-in-cli

Conversation

@hmellor
Copy link
Copy Markdown
Member

@hmellor hmellor commented May 15, 2025

Closes #17640
Supersede #17842

Allows users to pass individual JSON keys via FlexibleArgumentParser in the format --json-arg.key1.key2 value

i.e. --hf-overrides.key1 val1 --hf-overrides.key2.key3 val2 will result in the following args:

INFO 05-15 17:09:16 [cli_args.py:297] non-default args: {'enforce_eager': True, 'hf_overrides': {'key1': 'val1', 'key2': {'key3': 'val2'}}, 'gpu_memory_utilization': 0.45}

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

👋 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.

🚀

hmellor added 4 commits May 15, 2025 17:13
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
Copy Markdown
Collaborator

@NickLucche NickLucche left a comment

Choose a reason for hiding this comment

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

Nice one!
Is this documented somewhere in the docs or cli help?

hmellor added 3 commits May 15, 2025 18:49
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>
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label May 15, 2025
@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented May 15, 2025

Is this documented somewhere in the docs or cli help?

I've added details to the JSON tip that gets appended to all arguments that accept JSON, it looks like this:

  --kv-transfer-config KV_TRANSFER_CONFIG
                        The configurations for distributed KV cache transfer.
                        Should either be a valid JSON string or JSON keys passed individually. For example, the following sets of arguments are equivalent:
                        - `--json-arg '{"key1": "value1", "key2": {"key3": "value2"}}'`
                        - `--json-arg.key1 value1 --json-arg.key2.key3 value2`
                        (default: None)

hmellor added 2 commits May 15, 2025 19:05
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

Really nice feature!

@rdodev
Copy link
Copy Markdown

rdodev commented May 15, 2025

Awesome and super simple code change. <3 it.

hmellor added 4 commits May 15, 2025 23:08
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>
@DarkLight1337 DarkLight1337 added this to the v0.9.0 milestone May 16, 2025
@vllm-bot vllm-bot merged commit b18201f into vllm-project:main May 16, 2025
60 of 62 checks passed
@hmellor hmellor deleted the allow-individual-json-keys-in-cli branch May 16, 2025 06:20
@rdodev
Copy link
Copy Markdown

rdodev commented May 16, 2025

Hey @hmellor do you know if there's any chance this making it into v0.9.0?

@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented May 16, 2025

I've asked if it can be cherry-picked!

@rdodev
Copy link
Copy Markdown

rdodev commented May 16, 2025

I've asked if it can be cherry-picked!

Awesome. Thank you! That one has some other spicy updates of interest to us. Hoping it can be done.

zzzyq pushed a commit to zzzyq/vllm that referenced this pull request May 24, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Yuqi Zhang <yuqizhang@google.com>
@rdodev
Copy link
Copy Markdown

rdodev commented May 30, 2025

Hey @hmellor just testing this now that 0.9.0 is out.

        - --rope-scaling.rope_type
        - "yarn"
        - --rope-scaling.factor
        - "4.0"
        - --rope-scaling.original_max_position_embeddings
        - "32768"
        - --max-model-len
        - "131072"

It's getting translated to
Overriding HF config with {'rope_scaling': {'rope-type': 'yarn', 'factor': '4.0', 'original-max-position-embeddings': '32768'}

Which is causing an error because the configurator is looking for rope_type but it's not found because the arg parse converted the _ to a dash.

Edit:
This is happening with all args that contain _ as part of their name.

@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented May 31, 2025

Good catch, I'll make a fix on Monday!

@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented Jun 2, 2025

Fix in #19030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[Feature]: provide a way to configure rope-scaling that isn't inline JSON

6 participants