Export NaNs in logits to scheduler_stats if output is corrupted (#18777)

Signed-off-by: Vlad Mihailescu <vtmihailescu@gmail.com>
This commit is contained in:
Vlad Tiberiu Mihailescu
2025-06-20 22:47:16 +08:00
committed by GitHub
parent 7e8977fcd4
commit 2e3e3c86dc
7 changed files with 104 additions and 2 deletions
+8 -1
View File
@@ -130,6 +130,7 @@ if TYPE_CHECKING:
VLLM_SLEEP_WHEN_IDLE: bool = False
VLLM_MQ_MAX_CHUNK_BYTES_MB: int = 16
VLLM_KV_CACHE_LAYOUT: Optional[str] = None
VLLM_COMPUTE_NANS_IN_LOGITS: bool = False
def get_default_cache_root():
@@ -897,7 +898,13 @@ environment_variables: dict[str, Callable[[], Any]] = {
# leave the layout choice to the backend. Mind that backends may only
# implement and support a subset of all possible layouts.
"VLLM_KV_CACHE_LAYOUT":
lambda: os.getenv("VLLM_KV_CACHE_LAYOUT", None)
lambda: os.getenv("VLLM_KV_CACHE_LAYOUT", None),
# Enable checking whether the generated logits contain NaNs,
# indicating corrupted output. Useful for debugging low level bugs
# or bad hardware but it may add compute overhead.
"VLLM_COMPUTE_NANS_IN_LOGITS":
lambda: bool(int(os.getenv("VLLM_COMPUTE_NANS_IN_LOGITS", "0"))),
}
# --8<-- [end:env-vars-definition]