Skip to content

Commit cbedb70

Browse files
authored
[Frontend] Remove confusing -O.xx flag error (#30169)
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
1 parent 8d3da4c commit cbedb70

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

tests/utils_/test_argparse_utils.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -458,22 +458,3 @@ def test_flat_product():
458458
(3, 4, "a", 5, 6),
459459
(3, 4, "b", 5, 6),
460460
]
461-
462-
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.* 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-
with pytest.raises(ValueError, match=r"Please use -cc\.\* instead"):
473-
parser.parse_args(["-O.mode=2"])
474-
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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,6 @@ def repl(match: re.Match) -> str:
244244
else:
245245
key = pattern.sub(repl, arg, count=1)
246246
processed_args.append(key)
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-
)
254247
elif arg.startswith("-O") and arg != "-O":
255248
# allow -O flag to be used without space, e.g. -O3 or -Odecode
256249
# also handle -O=<optimization_level> here

0 commit comments

Comments
 (0)