A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 11, 23:45 UTC
[Frontend] Remove deprecated -O.xx flag (#29991)
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Yanan Cao committed
Dec 5, 2025 at 00:47 UTC
62b3333448c9401f8e14feaab3b30192323f3a33
3 files changed
+21
-29
docs/design/debug_vllm_compile.md
+1
-1
@@ -86,7 +86,7 @@ LLM(model, enforce_eager=True)
86
```
87
88
To turn off just torch.compile, pass `mode = NONE` to the compilation config.
89
-(`-cc` is short for `--compilation_config`; `-O.*` dotted syntax is deprecated):
89
+(`-cc` is short for `--compilation_config`):
90
91
```sh
92
# Online
tests/utils_/test_argparse_utils.py
+12
-15
@@ -460,23 +460,20 @@ def test_flat_product():
460
]
461
462
463
-def test_o_legacy_syntax_deprecation(caplog_vllm):
464
- """Test that -O.* dotted syntax emits warnings and converts correctly to -cc syntax."""
463
+def test_o_dotted_syntax_error():
464
+ """Test that -O.* dotted syntax raises a clear error message."""
465
parser = FlexibleArgumentParser()
466
parser.add_argument("-cc", "--compilation-config", type=json.loads)
467
468
- # Test that -O.backend gets converted correctly AND emits warning
469
- args = parser.parse_args(["-O.backend=eager"])
470
- assert args.compilation_config == {"backend": "eager"}
468
+ # Test that -O.* syntax raises a clear ValueError
469
+ with pytest.raises(ValueError, match=r"The -O\.\* syntax is no longer supported"):
470
+ parser.parse_args(["-O.backend=eager"])
471
472
- # Check that deprecation warning was logged
473
- assert len(caplog_vllm.records) >= 1
474
- assert (
475
- "The -O.* dotted syntax for --compilation-config is deprecated"
476
- in caplog_vllm.text
477
- )
472
+ with pytest.raises(ValueError, match=r"Please use -cc\.\* instead"):
473
+ parser.parse_args(["-O.mode=2"])
474
479
- # Test that -O.mode gets converted correctly
480
- # Note: warning_once won't emit again in same session
481
- args = parser.parse_args(["-O.mode=2"])
482
- assert args.compilation_config == {"mode": 2}
475
+ with pytest.raises(
476
+ ValueError,
477
+ match=r"replace '-O\.cudagraph_mode=NONE' with '-cc\.cudagraph_mode=NONE'",
478
+ ):
479
+ parser.parse_args(["-O.cudagraph_mode=NONE"])
vllm/utils/argparse_utils.py
+8
-13
@@ -244,9 +244,15 @@ class FlexibleArgumentParser(ArgumentParser):
244
else:
245
key = pattern.sub(repl, arg, count=1)
246
processed_args.append(key)
247
- elif arg.startswith("-O") and arg != "-O" and arg[2] != ".":
247
+ elif arg.startswith("-O."):
248
+ # Provide clear error for deprecated -O.* syntax
249
+ raise ValueError(
250
+ f"The -O.* syntax is no longer supported. "
251
+ f"Please use -cc.* instead. "
252
+ f"For example, replace '{arg}' with '{arg.replace('-O', '-cc', 1)}'"
253
+ )
254
+ elif arg.startswith("-O") and arg != "-O":
255
# allow -O flag to be used without space, e.g. -O3 or -Odecode
249
- # -O.<...> handled later
256
# also handle -O=<optimization_level> here
257
optimization_level = arg[3:] if arg[2] == "=" else arg[2:]
258
processed_args += ["--optimization-level", optimization_level]
@@ -257,17 +263,6 @@ class FlexibleArgumentParser(ArgumentParser):
263
):
264
# Convert -O <n> to --optimization-level <n>
265
processed_args.append("--optimization-level")
260
- elif arg.startswith("-O."):
261
- # Handle -O.* dotted syntax - ALL dotted syntax is deprecated
262
- logger.warning_once(
263
- "The -O.* dotted syntax for --compilation-config is "
264
- "deprecated and will be removed in v0.13.0 or v1.0.0"
265
- ", whichever is earlier. Please use -cc.* instead. "
266
- "Example: -cc.backend=eager instead of "
267
- "-O.backend=eager."
268
- )
269
- converted_arg = arg.replace("-O", "-cc", 1)
270
- processed_args.append(converted_arg)
266
else:
267
processed_args.append(arg)
268