Skip to content

Commit 40820e6

Browse files
authored
[None][fix] CHERRY-PICK trtllm-serve yaml loading (#7551) (#7897)
Signed-off-by: Yan Chunwei <328693+Superjomn@users.noreply.github.com>
1 parent 05bec3b commit 40820e6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tensorrt_llm/llmapi/llm_args.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,6 +2619,22 @@ def update_llm_args_with_extra_dict(
26192619
logger.warning(f"Overriding {field_name} {extra_llm_str}")
26202620

26212621
llm_args = llm_args | llm_args_dict
2622+
2623+
# For trtllm-bench or trtllm-serve, build_config may be passed for the PyTorch
2624+
# backend, overwriting the knobs there since build_config always has the highest priority
2625+
if "build_config" in llm_args:
2626+
for key in [
2627+
"max_batch_size",
2628+
"max_num_tokens",
2629+
"max_beam_width",
2630+
"max_seq_len",
2631+
]:
2632+
if key in llm_args_dict:
2633+
logger.info(
2634+
f"Overriding {key} from build_config to {llm_args_dict[key]}"
2635+
)
2636+
setattr(llm_args["build_config"], key, llm_args_dict[key])
2637+
26222638
return llm_args
26232639

26242640

0 commit comments

Comments
 (0)