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
dynamo
Commits
19e8a165
Unverified
Commit
19e8a165
authored
Mar 04, 2026
by
Hongkuan Zhou
Committed by
GitHub
Mar 04, 2026
Browse files
fix: strip None args when profiler generating configs (#6882)
Signed-off-by:
hongkuanz
<
hongkuanz@nvidia.com
>
parent
bb79b7de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
components/src/dynamo/profiler/utils/config.py
components/src/dynamo/profiler/utils/config.py
+23
-0
components/src/dynamo/profiler/utils/config_modifiers/protocol.py
...ts/src/dynamo/profiler/utils/config_modifiers/protocol.py
+2
-1
No files found.
components/src/dynamo/profiler/utils/config.py
View file @
19e8a165
...
@@ -141,6 +141,29 @@ def remove_valued_arguments(args: list[str], key: str) -> list[str]:
...
@@ -141,6 +141,29 @@ def remove_valued_arguments(args: list[str], key: str) -> list[str]:
return
args
return
args
def
sanitize_cli_args
(
args
:
list
[
str
])
->
list
[
str
]:
"""Strip valued arguments whose value is the literal string ``"None"``.
AIC's rule engine uses Jinja2 ``compile_expression`` which converts
undefined variables to Python ``None``. When that ``None`` is
serialized into CLI args it becomes the four-character string
``"None"``, which is never a valid CLI value and causes backends
(e.g. sglang ``--kv-cache-dtype None``) to reject the argument.
"""
result
=
list
(
args
)
i
=
0
while
i
<
len
(
result
)
-
1
:
if
result
[
i
].
startswith
(
"--"
)
and
result
[
i
+
1
]
==
"None"
:
logger
.
warning
(
"Stripping CLI arg %s with invalid value 'None'"
,
result
[
i
],
)
del
result
[
i
:
i
+
2
]
else
:
i
+=
1
return
result
def
append_argument
(
args
:
list
[
str
],
to_append
)
->
list
[
str
]:
def
append_argument
(
args
:
list
[
str
],
to_append
)
->
list
[
str
]:
idx
=
find_arg_index
(
args
)
idx
=
find_arg_index
(
args
)
if
isinstance
(
to_append
,
list
):
if
isinstance
(
to_append
,
list
):
...
...
components/src/dynamo/profiler/utils/config_modifiers/protocol.py
View file @
19e8a165
...
@@ -27,6 +27,7 @@ from dynamo.profiler.utils.config import (
...
@@ -27,6 +27,7 @@ from dynamo.profiler.utils.config import (
ServiceResources
,
ServiceResources
,
break_arguments
,
break_arguments
,
get_service_name_by_type
,
get_service_name_by_type
,
sanitize_cli_args
,
set_argument_value
,
set_argument_value
,
update_image
,
update_image
,
)
)
...
@@ -562,7 +563,7 @@ class BaseConfigModifier:
...
@@ -562,7 +563,7 @@ class BaseConfigModifier:
service
.
resources
.
limits
[
"gpu"
]
=
str
(
gpus
)
service
.
resources
.
limits
[
"gpu"
]
=
str
(
gpus
)
if
service
.
extraPodSpec
and
service
.
extraPodSpec
.
mainContainer
:
if
service
.
extraPodSpec
and
service
.
extraPodSpec
.
mainContainer
:
service
.
extraPodSpec
.
mainContainer
.
args
=
list
(
cli_args
)
service
.
extraPodSpec
.
mainContainer
.
args
=
sanitize_cli_args
(
list
(
cli_args
)
)
@
classmethod
@
classmethod
def
_apply_disagg_workers
(
def
_apply_disagg_workers
(
...
...
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