mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 20:35:26 +08:00
[Frontend] Remove confusing -O.xx flag error (#30169)
Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
This commit is contained in:
parent
8d3da4c79d
commit
cbedb703cc
@ -458,22 +458,3 @@ def test_flat_product():
|
|||||||
(3, 4, "a", 5, 6),
|
(3, 4, "a", 5, 6),
|
||||||
(3, 4, "b", 5, 6),
|
(3, 4, "b", 5, 6),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_o_dotted_syntax_error():
|
|
||||||
"""Test that -O.* dotted syntax raises a clear error message."""
|
|
||||||
parser = FlexibleArgumentParser()
|
|
||||||
parser.add_argument("-cc", "--compilation-config", type=json.loads)
|
|
||||||
|
|
||||||
# Test that -O.* syntax raises a clear ValueError
|
|
||||||
with pytest.raises(ValueError, match=r"The -O\.\* syntax is no longer supported"):
|
|
||||||
parser.parse_args(["-O.backend=eager"])
|
|
||||||
|
|
||||||
with pytest.raises(ValueError, match=r"Please use -cc\.\* instead"):
|
|
||||||
parser.parse_args(["-O.mode=2"])
|
|
||||||
|
|
||||||
with pytest.raises(
|
|
||||||
ValueError,
|
|
||||||
match=r"replace '-O\.cudagraph_mode=NONE' with '-cc\.cudagraph_mode=NONE'",
|
|
||||||
):
|
|
||||||
parser.parse_args(["-O.cudagraph_mode=NONE"])
|
|
||||||
|
|||||||
@ -244,13 +244,6 @@ class FlexibleArgumentParser(ArgumentParser):
|
|||||||
else:
|
else:
|
||||||
key = pattern.sub(repl, arg, count=1)
|
key = pattern.sub(repl, arg, count=1)
|
||||||
processed_args.append(key)
|
processed_args.append(key)
|
||||||
elif arg.startswith("-O."):
|
|
||||||
# Provide clear error for deprecated -O.* syntax
|
|
||||||
raise ValueError(
|
|
||||||
f"The -O.* syntax is no longer supported. "
|
|
||||||
f"Please use -cc.* instead. "
|
|
||||||
f"For example, replace '{arg}' with '{arg.replace('-O', '-cc', 1)}'"
|
|
||||||
)
|
|
||||||
elif arg.startswith("-O") and arg != "-O":
|
elif arg.startswith("-O") and arg != "-O":
|
||||||
# allow -O flag to be used without space, e.g. -O3 or -Odecode
|
# allow -O flag to be used without space, e.g. -O3 or -Odecode
|
||||||
# also handle -O=<optimization_level> here
|
# also handle -O=<optimization_level> here
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user