Log fully resolved pooling config at startup (#48030)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
313d01f507
commit
9182e86971
+59
-1
@@ -22,6 +22,7 @@ import zmq
|
||||
|
||||
import vllm.envs as envs
|
||||
from vllm.config import ParallelConfig, VllmConfig
|
||||
from vllm.config.pooler import POOLER_CONFIG_LOG_FIELDS
|
||||
from vllm.distributed import (
|
||||
cleanup_dist_env_and_memory,
|
||||
stateless_destroy_torch_distributed_process_group,
|
||||
@@ -121,6 +122,7 @@ class EngineCore:
|
||||
|
||||
# Setup Model.
|
||||
self.model_executor = executor_class(vllm_config)
|
||||
self._pooler_config_logged = False
|
||||
if executor_fail_callback is not None:
|
||||
self.model_executor.register_failure_callback(executor_fail_callback)
|
||||
|
||||
@@ -348,7 +350,63 @@ class EngineCore:
|
||||
return scheduler_kv_cache_config
|
||||
|
||||
def get_supported_tasks(self) -> tuple[SupportedTask, ...]:
|
||||
return self.model_executor.supported_tasks
|
||||
supported_tasks = self.model_executor.supported_tasks
|
||||
self._log_pooler_config(supported_tasks)
|
||||
return supported_tasks
|
||||
|
||||
def _log_pooler_config(self, supported_tasks: tuple[SupportedTask, ...]) -> None:
|
||||
if self._pooler_config_logged:
|
||||
return
|
||||
|
||||
model_config = self.vllm_config.model_config
|
||||
pooler_config = model_config.pooler_config
|
||||
if (
|
||||
self.vllm_config.parallel_config.data_parallel_rank_local
|
||||
or model_config.runner_type != "pooling"
|
||||
or pooler_config is None
|
||||
):
|
||||
return
|
||||
|
||||
supported_pooling_tasks = tuple(
|
||||
sorted(set(supported_tasks) & set(POOLING_TASKS))
|
||||
)
|
||||
if not supported_pooling_tasks:
|
||||
return
|
||||
|
||||
self._pooler_config_logged = True
|
||||
task_set = set(supported_pooling_tasks)
|
||||
use_activation = pooler_config.use_activation
|
||||
if use_activation is None:
|
||||
use_activation = True
|
||||
sources = getattr(model_config, "_pooler_config_sources", {})
|
||||
pooling_type_field = (
|
||||
"seq_pooling_type"
|
||||
if task_set & {"embed", "classify"}
|
||||
else "tok_pooling_type"
|
||||
)
|
||||
|
||||
def log_field(name: str, field: str) -> str:
|
||||
value = (
|
||||
use_activation
|
||||
if field == "use_activation"
|
||||
else getattr(pooler_config, field)
|
||||
)
|
||||
source = sources.get(field, "unknown")
|
||||
return f"{name}={value}(source={source})"
|
||||
|
||||
log_items = [("pooling_type", pooling_type_field)]
|
||||
log_items.extend(
|
||||
(field, field)
|
||||
for field in POOLER_CONFIG_LOG_FIELDS
|
||||
if field != pooling_type_field
|
||||
)
|
||||
config_fields = ", ".join(log_field(name, field) for name, field in log_items)
|
||||
|
||||
logger.info_once(
|
||||
"Resolved pooling config: %s, supported_tasks=%s",
|
||||
config_fields,
|
||||
supported_pooling_tasks,
|
||||
)
|
||||
|
||||
def get_kv_cache_group_metadata(self) -> list[dict[str, int | str | None]]:
|
||||
"""Return msgspec-serializable metadata for scheduler KV cache groups."""
|
||||
|
||||
Reference in New Issue
Block a user