Skip to content

Conversation

@elizabetht
Copy link
Contributor

@elizabetht elizabetht commented Dec 5, 2025

Purpose

Add config flag for VLLM_DISABLE_COMPILE_CACHE which should be overridden if env var is set

Test Plan

Scenario Config Value Env Var Test
Default (nothing set) False Not set ✅ test_disable_compile_cache_config_without_env_var
User sets config to True True Not set ✅ test_disable_compile_cache_config + test_disable_compile_cache_config_without_env_var
User sets env var False 1 ✅ test_disable_compile_cache_env_var_override + test_VLLM_DISABLE_COMPILE_CACHE
Both set True 1 ✅ test_disable_compile_cache_both_set (newly added)
Config True, env var 0 True 0 Implicitly covered - env var 0 is treated as "not set" by the env parsing logic, so it falls back to "Config True, env var not set"

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.

Signed-off-by: Elizabeth Thomas <email2eliza@gmail.com>
Signed-off-by: Elizabeth Thomas <email2eliza@gmail.com>
Signed-off-by: Elizabeth Thomas <email2eliza@gmail.com>
@elizabetht
Copy link
Contributor Author

@ProExpertProg @zou3519

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 introduces a new configuration flag, disable_compile_cache, to control the vLLM compile cache, with the environment variable VLLM_DISABLE_COMPILE_CACHE taking precedence. The changes are well-implemented across the configuration, backend, and interface files. The documentation has also been updated accordingly. My main feedback is to refactor the newly added tests for better readability and maintainability.

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

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Signed-off-by: Elizabeth Thomas <email2eliza@gmail.com>
Signed-off-by: Elizabeth Thomas <email2eliza@gmail.com>
@mergify
Copy link

mergify bot commented Dec 5, 2025

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

@mergify mergify bot added the documentation Improvements or additions to documentation label Dec 5, 2025
@mergify
Copy link

mergify bot commented Dec 5, 2025

Hi @elizabetht, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

@mergify
Copy link

mergify bot commented Dec 5, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @elizabetht.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Dec 5, 2025
Signed-off-by: Elizabeth Thomas <email2eliza@gmail.com>
@mergify mergify bot removed the needs-rebase label Dec 5, 2025
Copy link
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

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

Thanks for the work! But I don't think this flag is needed as we already have the env variable which increased the complexity.

@elizabetht
Copy link
Contributor Author

@yewentao256 this issue #29917 talks about needing the config flag for this env variable? @ProExpertProg @zou3519 could you weigh in on this issue?

@ProExpertProg
Copy link
Collaborator

Yeah this flag is needed so that we can see whether cache is enabled or disabled when printing config. Env var should stay around so that cache can be disabled without modifying code.

Copy link
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.

Please just address the comments


# Build a config dict for cache checking that includes the disable flag
cache_check_config = self.inductor_config.copy()
cache_check_config["vllm_disable_compile_cache"] = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of adding the key to inductor config, let's just add a parameter

# Remove vllm-specific keys that are not valid inductor config options
# before passing to standalone_compile. These keys are used internally
# by vLLM for cache control but would cause AttributeError in torch._inductor.
current_config.pop("vllm_disable_compile_cache", None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's just add a separate param. Could also pass the whole CompilationConfig around

not always correct. You can disable it via setting `VLLM_DISABLE_COMPILE_CACHE=1`.
not always correct. You can disable it by either:

- Setting the config flag: `--compilation-config '{"disable_compile_cache": true}'`
Copy link
Collaborator

@zou3519 zou3519 Dec 8, 2025

Choose a reason for hiding this comment

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

Btw, positive flags are generally better than negative flags. Something like enable_compile_cache. Because double negation gets confusing.

I know the envvar is already negative, but we should (in the future) add a positive envvar and then deprecate the negative envvar. In that sense, I'd prefer that we have the config flag be positive.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants