|
21 | 21 | from strenum import StrEnum |
22 | 22 | from transformers import PreTrainedTokenizerBase |
23 | 23 |
|
24 | | -from tensorrt_llm.llmapi.utils import orchestrator_type_env |
| 24 | +from tensorrt_llm.llmapi.utils import logger_debug, orchestrator_type_env |
25 | 25 | from tensorrt_llm.lora_helper import (LoraConfig, |
26 | 26 | get_default_trtllm_modules_to_hf_modules) |
27 | 27 |
|
@@ -2095,19 +2095,21 @@ def validate_peft_cache_config(self): |
2095 | 2095 | "while LoRA prefetch is not supported") |
2096 | 2096 | return self |
2097 | 2097 |
|
2098 | | - @field_validator('orchestrator_type', mode='before') |
2099 | | - def validate_orchestrator_config(v): |
| 2098 | + @model_validator(mode='before') |
| 2099 | + def validate_orchestrator_config(cls, values): |
2100 | 2100 | # The environment variable will override the orchestrator_type field. |
2101 | 2101 | # TODO: remove the environment variable after RPC path is stable, then |
2102 | 2102 | # there will be only two stable options: None(RPC) and 'ray'. |
2103 | 2103 | if (ev := orchestrator_type_env()) is not None: |
| 2104 | + logger_debug( |
| 2105 | + f"changing orchestrator_type to {ev} from environment variable") |
2104 | 2106 | if ev not in ['rpc', 'ray']: |
2105 | 2107 | raise ValueError( |
2106 | 2108 | f"Invalid orchestrator type: {ev}. Please set orchestrator_type to 'rpc' or 'ray'." |
2107 | 2109 | ) |
2108 | | - v = ev |
| 2110 | + values['orchestrator_type'] = ev |
2109 | 2111 |
|
2110 | | - return v |
| 2112 | + return values |
2111 | 2113 |
|
2112 | 2114 | def _update_plugin_config(self, key: str, value: Any): |
2113 | 2115 | setattr(self.build_config.plugin_config, key, value) |
|
0 commit comments