File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 2121from strenum import StrEnum
2222from transformers import PreTrainedTokenizerBase
2323
24+ from tensorrt_llm .llmapi .utils import orchestrator_type_env
2425from tensorrt_llm .lora_helper import (LoraConfig ,
2526 get_default_trtllm_modules_to_hf_modules )
2627
@@ -2025,6 +2026,20 @@ def validate_peft_cache_config(self):
20252026 "while LoRA prefetch is not supported" )
20262027 return self
20272028
2029+ @field_validator ('orchestrator_type' , mode = 'before' )
2030+ def validate_orchestrator_config (v ):
2031+ # The environment variable will override the orchestrator_type field.
2032+ # TODO: remove the environment variable after RPC path is stable, then
2033+ # there will be only two stable options: None(RPC) and 'ray'.
2034+ if (ev := orchestrator_type_env ()) is not None :
2035+ if ev not in ['rpc' , 'ray' ]:
2036+ raise ValueError (
2037+ f"Invalid orchestrator type: { ev } . Please set orchestrator_type to 'rpc' or 'ray'."
2038+ )
2039+ v = ev
2040+
2041+ return v
2042+
20282043 def _update_plugin_config (self , key : str , value : Any ):
20292044 setattr (self .build_config .plugin_config , key , value )
20302045
Original file line number Diff line number Diff line change @@ -356,6 +356,10 @@ def enable_llmapi_debug() -> bool:
356356 return _enable_llmapi_debug_
357357
358358
359+ def orchestrator_type_env () -> Optional [str ]:
360+ return os .environ .get ("TLLM_ORCHESTRATOR_TYPE" , None )
361+
362+
359363@cache
360364def enable_worker_single_process_for_tp1 () -> bool :
361365 ''' Tell whether to make worker use single process for TP1.
You can’t perform that action at this time.
0 commit comments