Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
63e39937
Unverified
Commit
63e39937
authored
Oct 03, 2024
by
xendo
Committed by
GitHub
Oct 03, 2024
Browse files
[Frontend] [Neuron] Parse literals out of override-neuron-config (#8959)
Co-authored-by:
Jerzy Zagorski
<
jzagorsk@amazon.com
>
parent
f5d72b2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
20 deletions
+37
-20
tests/engine/test_arg_utils.py
tests/engine/test_arg_utils.py
+34
-14
vllm/engine/arg_utils.py
vllm/engine/arg_utils.py
+3
-6
No files found.
tests/engine/test_arg_utils.py
View file @
63e39937
...
@@ -42,22 +42,42 @@ def test_bad_nullable_kvs(arg):
...
@@ -42,22 +42,42 @@ def test_bad_nullable_kvs(arg):
nullable_kvs
(
arg
)
nullable_kvs
(
arg
)
@
pytest
.
mark
.
parametrize
((
"arg"
,
"expected"
),
[
# yapf: disable
(
None
,
None
),
@
pytest
.
mark
.
parametrize
((
"arg"
,
"expected"
,
"option"
),
[
(
"{}"
,
{}),
(
None
,
None
,
"mm-processor-kwargs"
),
(
'{"num_crops": 4}'
,
{
(
"{}"
,
{},
"mm-processor-kwargs"
),
"num_crops"
:
4
(
}),
'{"num_crops": 4}'
,
(
'{"foo": {"bar": "baz"}}'
,
{
{
"foo"
:
{
"num_crops"
:
4
"bar"
:
"baz"
},
}
"mm-processor-kwargs"
}),
),
(
'{"foo": {"bar": "baz"}}'
,
{
"foo"
:
{
"bar"
:
"baz"
}
},
"mm-processor-kwargs"
),
(
'{"cast_logits_dtype":"bfloat16","sequence_parallel_norm":true,"sequence_parallel_norm_threshold":2048}'
,
{
"cast_logits_dtype"
:
"bfloat16"
,
"sequence_parallel_norm"
:
True
,
"sequence_parallel_norm_threshold"
:
2048
,
},
"override-neuron-config"
),
])
])
def
test_mm_processor_kwargs_prompt_parser
(
arg
,
expected
):
# yapf: enable
def
test_composite_arg_parser
(
arg
,
expected
,
option
):
parser
=
EngineArgs
.
add_cli_args
(
FlexibleArgumentParser
())
parser
=
EngineArgs
.
add_cli_args
(
FlexibleArgumentParser
())
if
arg
is
None
:
if
arg
is
None
:
args
=
parser
.
parse_args
([])
args
=
parser
.
parse_args
([])
else
:
else
:
args
=
parser
.
parse_args
([
"--
mm-processor-kwargs
"
,
arg
])
args
=
parser
.
parse_args
([
f
"--
{
option
}
"
,
arg
])
assert
args
.
mm_processor_kwargs
==
expected
assert
getattr
(
args
,
option
.
replace
(
"-"
,
"_"
))
==
expected
vllm/engine/arg_utils.py
View file @
63e39937
...
@@ -800,13 +800,10 @@ class EngineArgs:
...
@@ -800,13 +800,10 @@ class EngineArgs:
"lower performance."
)
"lower performance."
)
parser
.
add_argument
(
parser
.
add_argument
(
'--override-neuron-config'
,
'--override-neuron-config'
,
type
=
lambda
configs
:
{
type
=
json
.
loads
,
str
(
key
):
value
for
key
,
value
in
(
config
.
split
(
':'
)
for
config
in
configs
.
split
(
','
))
},
default
=
None
,
default
=
None
,
help
=
"override or set neuron device configuration."
)
help
=
"Override or set neuron device configuration. "
"e.g. {
\"
cast_logits_dtype
\"
:
\"
bloat16
\"
}.'"
)
parser
.
add_argument
(
parser
.
add_argument
(
'--scheduling-policy'
,
'--scheduling-policy'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment