Skip to content

Conversation

@mcelrath
Copy link

@mcelrath mcelrath commented Nov 3, 2025

References: #27984

Purpose

Remove unused swap_space parameter after the removal of best_of sampling. Fixes #27984

Test Plan

(Untested) working on it.

Help would be appreciated. I'm having quite a lot of difficulty compiling vllm and all its dependencies. This should be a simple fix with no impact anywhere else.

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

👋 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 ask your reviewers to trigger select CI tests on top of fastcheck CI.

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.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@mergify
Copy link

mergify bot commented Nov 3, 2025

Documentation preview: https://vllm--27988.org.readthedocs.build/en/27988/

@mergify mergify bot added documentation Improvements or additions to documentation frontend v1 tpu Related to Google TPUs kv-connector labels Nov 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to remove the unused swap_space parameter throughout the codebase. The changes are comprehensive, touching documentation, tests, and core configuration files. While most of the changes are correct, I've identified a critical issue in vllm/engine/arg_utils.py that appears to be a typo. This typo will likely cause a KeyError during command-line argument parsing, breaking the CLI. I've provided a suggestion to fix this.

)
cache_group.add_argument("--swap-space", **cache_kwargs["swap_space"])
cache_group.add_argument("--kv-cache-dtype", **cache_kwargs["cache_dtype"])
cache_group.add_argument("--kv-cache-dtype", **cache_kwargs["kv_cache_dtype"])
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There seems to be a typo here. The get_kwargs(CacheConfig) function returns a dictionary with keys corresponding to the fields in CacheConfig. CacheConfig has a field named cache_dtype, but not kv_cache_dtype. Accessing cache_kwargs["kv_cache_dtype"] will likely cause a KeyError. This should probably be cache_kwargs["cache_dtype"] as it was before this change.

Suggested change
cache_group.add_argument("--kv-cache-dtype", **cache_kwargs["kv_cache_dtype"])
cache_group.add_argument("--kv-cache-dtype", **cache_kwargs["cache_dtype"])

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 880 to 882
cache_group.add_argument(
"--kv-cache-memory-bytes", **cache_kwargs["kv_cache_memory_bytes"]
)
cache_group.add_argument("--swap-space", **cache_kwargs["swap_space"])
cache_group.add_argument("--kv-cache-dtype", **cache_kwargs["cache_dtype"])
cache_group.add_argument("--kv-cache-dtype", **cache_kwargs["kv_cache_dtype"])

Choose a reason for hiding this comment

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

P1 Badge Fix CLI lookup for kv cache dtype option

The new code builds the CLI by fetching cache_kwargs["kv_cache_dtype"], but the CacheConfig dataclass still exposes the field as cache_dtype. get_kwargs(CacheConfig) therefore produces a dictionary with key "cache_dtype", and this lookup now raises a KeyError as soon as the argument parser is constructed (e.g. running python -m vllm.entrypoints.llm --help). This prevents the CLI from starting at all. Keep the lookup keyed on "cache_dtype" or rename the field consistently.

Useful? React with 👍 / 👎.

Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

I see a few more references that aren't removed by this PR: image

cc @ApostaC does LMCache depend on the swap_space argument at all in vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py?

@ApostaC
Copy link
Collaborator

ApostaC commented Nov 4, 2025

Hey @hmellor , we don't use that at all.

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

Labels

documentation Improvements or additions to documentation frontend kv-connector tpu Related to Google TPUs v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: swap_space parameter is unused and useless

3 participants