From f6897ba4a8c53b838c4e74b706e1ba2db8c521a7 Mon Sep 17 00:00:00 2001 From: leolingli Date: Tue, 25 Nov 2025 14:24:50 +0800 Subject: [PATCH] [bugfix] put trtllm env set before kvmanager init --- flexkv/integration/tensorrt_llm/trtllm_adapter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flexkv/integration/tensorrt_llm/trtllm_adapter.py b/flexkv/integration/tensorrt_llm/trtllm_adapter.py index ca07a03e48..9adeeb9f58 100644 --- a/flexkv/integration/tensorrt_llm/trtllm_adapter.py +++ b/flexkv/integration/tensorrt_llm/trtllm_adapter.py @@ -28,6 +28,8 @@ class FlexKVSchedulerConnector(KvCacheConnectorScheduler): def __init__(self, config: ExecutorConfig): + # Set environment variable for FlexKV with TensorRT-LLM,this must before KVManager initialization + os.environ['FLEXKV_WITH_TRTLLM'] = '1' tp_size, dp_size, dp_rank = get_dp_tp_info(config) flexkv_config = FlexKVConfig.from_env() flexkv_config.post_init_from_trt_config(config, tp_size, dp_size, dp_rank) @@ -59,8 +61,7 @@ def __init__(self, config: ExecutorConfig): flexkv_logger.info("Finish init FlexKVSchedulerConnector") - # Set environment variable for FlexKV with TensorRT-LLM - os.environ['FLEXKV_WITH_TRTLLM'] = '1' + def is_ready( self,