Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions vllm/utils/flashinfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,19 @@ def use_trtllm_attention(

if force_use_trtllm is None:
# Environment variable not set - use auto-detection
use_trtllm = (num_tokens <= 256 and max_seq_len <= 131072
and kv_cache_dtype == "auto")
if use_trtllm:
logger.warning_once("Using TRTLLM attention (auto-detected).")
if is_prefill:
# Prefill auto-detection
use_trtllm = (max_seq_len <= 131072 and kv_cache_dtype == "auto")
if use_trtllm:
logger.warning_once(
"Using TRTLLM prefill attention (auto-detected).")
else:
# Decode auto-detection
use_trtllm = (num_tokens <= 256 and max_seq_len <= 131072
and kv_cache_dtype == "auto")
if use_trtllm:
logger.warning_once(
"Using TRTLLM decode attention (auto-detected).")
return use_trtllm

# Environment variable is set to 1 - respect it
Expand Down