Unverified Commit 2bb1b268 authored by Hongkuan Zhou's avatar Hongkuan Zhou Committed by GitHub
Browse files

fix: move deep_update function to trtllm folder (#3070)


Signed-off-by: default avatarhongkuanz <hongkuanz@nvidia.com>
parent 1ba53f2c
......@@ -159,21 +159,6 @@ def parse_override_engine_args(args: list[str]) -> tuple[dict, list[str]]:
return override_dict, args
def deep_update(target: dict, source: dict) -> None:
"""
Recursively update nested dictionaries.
Args:
target: Dictionary to update
source: Dictionary with new values
"""
for key, value in source.items():
if isinstance(value, dict) and key in target and isinstance(target[key], dict):
deep_update(target[key], value)
else:
target[key] = value
class ConfigModifierProtocol(Protocol):
@classmethod
def convert_config(cls, config: dict, target: Literal["prefill", "decode"]) -> dict:
......
......@@ -23,7 +23,6 @@ from torch.cuda import device_count
from transformers import AutoConfig
import dynamo.nixl_connect as nixl_connect
from benchmarks.profiler.utils.config import deep_update
from dynamo.llm import ModelInput, ModelRuntimeConfig, ModelType, register_llm
from dynamo.runtime import DistributedRuntime, dynamo_worker
from dynamo.runtime.logging import configure_dynamo_logging
......@@ -37,6 +36,7 @@ from dynamo.trtllm.request_handlers.handlers import (
from dynamo.trtllm.utils.trtllm_utils import (
Config,
cmd_line_args,
deep_update,
is_first_worker,
parse_endpoint,
)
......
......@@ -368,3 +368,18 @@ def cmd_line_args():
config.tool_call_parser = args.dyn_tool_call_parser
return config
def deep_update(target: dict, source: dict) -> None:
"""
Recursively update nested dictionaries.
Args:
target: Dictionary to update
source: Dictionary with new values
"""
for key, value in source.items():
if isinstance(value, dict) and key in target and isinstance(target[key], dict):
deep_update(target[key], value)
else:
target[key] = value
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment