Skip to content

Conversation

@gmagogsfm
Copy link
Contributor

@gmagogsfm gmagogsfm commented Nov 27, 2025

Users can now:

  • Continue using -O{1,2,3}, which now means optimization level, not compilation mode any more.
  • Continue using -O.xxx (deprecation warning until later time when we remove the support)
  • Start using -cc (no warning, preferred)
  • Use --compilation-config (no change)

Warning message: "The -O flag for --compilation-config is deprecated and will be removed in a later release. Please use -cc instead. Example: -cc.mode=0 instead of -O.mode=0"

Fixes #27832

@mergify
Copy link

mergify bot commented Nov 27, 2025

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

@mergify mergify bot added documentation Improvements or additions to documentation ci/build labels Nov 27, 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 remaps the -O command-line flag to -cc for compilation configuration, deprecating the former. The changes span documentation, tests, and argument parsing logic. While the updates to documentation and tests are correct, I've found a critical issue with the implementation of the deprecation warning for the -O flag. The current approach will not trigger the warning due to how arguments are pre-processed. I have provided detailed comments and suggestions to fix this issue by relocating the warning logic. Once addressed, the PR will correctly implement the intended functionality.

"--compilation-config",
"-cc",
"-O",
action=CompilationConfigAction,
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Following my other comment, this action should be removed as CompilationConfigAction is ineffective and should be removed.

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.

Thanks for implementing this! We should wait for #26847 to merge first. Can you make the deprecation comments and warnings mention the functionality will be removed in v0.13.0?

Comment on lines 412 to 417
args = parser.parse_args(["-O.mode", "0"])
assert args.compilation_config == {"mode": 0}

args = parser.parse_args(["-O.mode=NONE"])
assert args.compilation_config == {"mode": "NONE"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a comment that we're planning to deprecate these in v0.13.0?

Comment on lines 98 to 101
As a shorthand, one can append compilation arguments via
-cc.parameter=argument such as `-cc.mode=3` (same as `-cc='{"mode":3}'`).
Optimization level shortcuts like `-O3` are also supported (equivalent to
-cc.mode=3).
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will no longer be true after #26247; -O<n> will map to optimization level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I will wait for #26847 to land and fix up the logic.

"--compilation-config", "-O", **vllm_kwargs["compilation_config"]
"--compilation-config",
"-cc",
"-O",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah let's remove the -O here completely and just remap any use of -O.<...>/-O {...} to -cc in argparse_utils

@mergify
Copy link

mergify bot commented Nov 28, 2025

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

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 Nov 28, 2025
@gmagogsfm gmagogsfm force-pushed the o_cc branch 2 times, most recently from 3149903 to c556b06 Compare November 28, 2025 07:54
@mergify mergify bot removed the needs-rebase label Nov 28, 2025
Migrate compilation configuration from -O to -cc flags while preserving
the new optimization level functionality that uses -O flags.

Changes:
- Update argparse_utils.py to handle -O flag disambiguation
- Add deprecation warnings for -O.* dotted syntax for compilation config
- Convert -O.backend, -O.mode, etc. to -cc.backend, -cc.mode with warnings
- Update CLI argument parsing to use -cc instead of -O for compilation config
- Update tests to use new -cc syntax for compilation config
- Maintain backward compatibility with proper deprecation messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Replace all remaining references to deprecated -O.* compilation config
syntax with the new -cc.* syntax throughout the codebase:

- Documentation: Update debug guide and torch_compile.md examples
- Tests: Update compilation tests to use -cc.* syntax
- CI scripts: Update buildkite XPU test script
- Config docs: Update VllmConfig docstring examples

This ensures consistency across the codebase and removes deprecated
usage examples that might confuse users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
@mergify
Copy link

mergify bot commented Nov 28, 2025

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

):
# Convert -O <n> to --optimization-level <n>
processed_args.append("--optimization-level")
elif arg.startswith("-O") and arg[2] == ".":
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
elif arg.startswith("-O") and arg[2] == ".":
elif arg.startswith("-O."):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 263 to 271
if any(
cc_option in arg
for cc_option in [
".mode",
".backend",
".custom_option",
".enable_fusion",
".disable_custom_fusion",
]
Copy link
Member

Choose a reason for hiding this comment

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

This list is not exhaustive and it shouldn't need to exist. Any use of -O. is deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

- Handle all -O.* dotted syntax as deprecated, not just specific options
- Emit warning and convert -O.* to -cc.* syntax automatically
- Update codebase references from -O.* to -cc.* syntax
- Add comprehensive test for deprecation warning
- Simplify condition checking and remove unnecessary scope parameter

The -O.* dotted syntax is deprecated and will be removed in v0.13.0
or v1.0.0, whichever is earlier. Users should use -cc.* instead.
Example: -cc.backend=eager instead of -O.backend=eager.

Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
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.

LGTM, thanks!

@hmellor hmellor enabled auto-merge (squash) November 28, 2025 19:44
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 28, 2025
@hmellor hmellor merged commit 3461e7e into vllm-project:main Nov 28, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build documentation Improvements or additions to documentation 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.

[RFC]: Remap CompilationConfig from -O to -cc in CLI

3 participants