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
92064030
Unverified
Commit
92064030
authored
Oct 16, 2025
by
hhzhang16
Committed by
GitHub
Oct 17, 2025
Browse files
fix: json strings should remain intact through profiler arg processing (#3680)
Signed-off-by:
Hannah Zhang
<
hannahz@nvidia.com
>
parent
b01541c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
benchmarks/profiler/utils/config.py
benchmarks/profiler/utils/config.py
+11
-2
benchmarks/profiler/utils/config_modifiers/trtllm.py
benchmarks/profiler/utils/config_modifiers/trtllm.py
+6
-2
No files found.
benchmarks/profiler/utils/config.py
View file @
92064030
...
@@ -125,8 +125,17 @@ def break_arguments(args: list[str] | None) -> list[str]:
...
@@ -125,8 +125,17 @@ def break_arguments(args: list[str] | None) -> list[str]:
else
:
else
:
for
arg
in
args
:
for
arg
in
args
:
if
arg
is
not
None
:
if
arg
is
not
None
:
# Use shlex.split to properly handle quoted arguments
# If the arg looks like it might be JSON (starts with { or [) or is already a single token,
ans
.
extend
(
shlex
.
split
(
arg
))
# don't split it further. Only split if it contains spaces AND doesn't look like JSON.
if
(
isinstance
(
arg
,
str
)
and
(
" "
in
arg
or
"
\t
"
in
arg
)
and
not
(
arg
.
strip
().
startswith
((
"{"
,
"["
)))
):
# Use shlex.split to properly handle quoted arguments
ans
.
extend
(
shlex
.
split
(
arg
))
else
:
ans
.
append
(
arg
)
return
ans
return
ans
...
...
benchmarks/profiler/utils/config_modifiers/trtllm.py
View file @
92064030
...
@@ -95,7 +95,9 @@ class TrtllmConfigModifier:
...
@@ -95,7 +95,9 @@ class TrtllmConfigModifier:
# - Disable enable_block_reuse (no KV reuse for prefill-only)
# - Disable enable_block_reuse (no KV reuse for prefill-only)
# - Enable overlap scheduler (disabled in prefill.yaml but needed for agg)
# - Enable overlap scheduler (disabled in prefill.yaml but needed for agg)
# - Remove cache_transceiver_config (not needed in agg mode)
# - Remove cache_transceiver_config (not needed in agg mode)
if
"kv_cache_config"
not
in
override_dict
:
if
"kv_cache_config"
not
in
override_dict
or
not
isinstance
(
override_dict
[
"kv_cache_config"
],
dict
):
override_dict
[
"kv_cache_config"
]
=
{}
override_dict
[
"kv_cache_config"
]
=
{}
override_dict
[
"kv_cache_config"
][
"enable_block_reuse"
]
=
False
override_dict
[
"kv_cache_config"
][
"enable_block_reuse"
]
=
False
override_dict
[
override_dict
[
...
@@ -146,7 +148,9 @@ class TrtllmConfigModifier:
...
@@ -146,7 +148,9 @@ class TrtllmConfigModifier:
# Merge our overrides for converting decode-only disagg to aggregated:
# Merge our overrides for converting decode-only disagg to aggregated:
# - Enable enable_block_reuse (to skip prefill in decode-only)
# - Enable enable_block_reuse (to skip prefill in decode-only)
# - Remove cache_transceiver_config (not needed in agg mode)
# - Remove cache_transceiver_config (not needed in agg mode)
if
"kv_cache_config"
not
in
override_dict
:
if
"kv_cache_config"
not
in
override_dict
or
not
isinstance
(
override_dict
[
"kv_cache_config"
],
dict
):
override_dict
[
"kv_cache_config"
]
=
{}
override_dict
[
"kv_cache_config"
]
=
{}
override_dict
[
"kv_cache_config"
][
"enable_block_reuse"
]
=
True
override_dict
[
"kv_cache_config"
][
"enable_block_reuse"
]
=
True
override_dict
[
override_dict
[
...
...
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