Skip to content

Commit 2bb1b26

Browse files
authored
fix: move deep_update function to trtllm folder (#3070)
Signed-off-by: hongkuanz <[email protected]>
1 parent 1ba53f2 commit 2bb1b26

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

benchmarks/profiler/utils/config.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,6 @@ def parse_override_engine_args(args: list[str]) -> tuple[dict, list[str]]:
159159
return override_dict, args
160160

161161

162-
def deep_update(target: dict, source: dict) -> None:
163-
"""
164-
Recursively update nested dictionaries.
165-
166-
Args:
167-
target: Dictionary to update
168-
source: Dictionary with new values
169-
"""
170-
for key, value in source.items():
171-
if isinstance(value, dict) and key in target and isinstance(target[key], dict):
172-
deep_update(target[key], value)
173-
else:
174-
target[key] = value
175-
176-
177162
class ConfigModifierProtocol(Protocol):
178163
@classmethod
179164
def convert_config(cls, config: dict, target: Literal["prefill", "decode"]) -> dict:

components/backends/trtllm/src/dynamo/trtllm/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from transformers import AutoConfig
2424

2525
import dynamo.nixl_connect as nixl_connect
26-
from benchmarks.profiler.utils.config import deep_update
2726
from dynamo.llm import ModelInput, ModelRuntimeConfig, ModelType, register_llm
2827
from dynamo.runtime import DistributedRuntime, dynamo_worker
2928
from dynamo.runtime.logging import configure_dynamo_logging
@@ -37,6 +36,7 @@
3736
from dynamo.trtllm.utils.trtllm_utils import (
3837
Config,
3938
cmd_line_args,
39+
deep_update,
4040
is_first_worker,
4141
parse_endpoint,
4242
)

components/backends/trtllm/src/dynamo/trtllm/utils/trtllm_utils.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,18 @@ def cmd_line_args():
368368
config.tool_call_parser = args.dyn_tool_call_parser
369369

370370
return config
371+
372+
373+
def deep_update(target: dict, source: dict) -> None:
374+
"""
375+
Recursively update nested dictionaries.
376+
377+
Args:
378+
target: Dictionary to update
379+
source: Dictionary with new values
380+
"""
381+
for key, value in source.items():
382+
if isinstance(value, dict) and key in target and isinstance(target[key], dict):
383+
deep_update(target[key], value)
384+
else:
385+
target[key] = value

0 commit comments

Comments
 (0)