Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ def __init__(
if model_config.attention.backend == "TRTLLM":
# TRTLLM backend is not supported for Cosmos3CrossAttention
model_config.attention.backend = "VANILLA"
# Warn once per (module class, requested, resolved) triple so the
# fallback is visible without per-module-instance log spam.
logger.warning_once(
f"{type(self).__name__}: requested attention backend {original_backend} is not "
f"supported for Cosmos3 cross-attention; falling back to VANILLA.",
key=(type(self).__name__, original_backend, "VANILLA"),
)

super().__init__(
hidden_size=hidden_size,
Expand Down
9 changes: 9 additions & 0 deletions tensorrt_llm/_torch/visual_gen/modules/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import torch
import torch.nn as nn

from tensorrt_llm.logger import logger
from tensorrt_llm.visual_gen.sparse_attention import SkipSoftmaxAttentionConfig

from ...modules.linear import Linear, TensorParallelMode, WeightMode, WeightsLoadingConfig
Expand Down Expand Up @@ -105,6 +106,14 @@ def __init__(
# Cross-attention fallback: TRTLLM and CUTEDSL VSA are self-attn only.
if self.qkv_mode == QKVMode.SEPARATE_QKV and (base_backend == "TRTLLM" or _is_vsa):
backend_name = "VANILLA"
requested = f"{base_backend} (VSA)" if _is_vsa else base_backend
# Warn once per (module class, requested, resolved) triple so the
# fallback is visible without per-module-instance log spam.
logger.warning_once(
f"{type(self).__name__}: requested attention backend {requested} does not "
f"support qkv_mode=SEPARATE_QKV; falling back to {backend_name}.",
key=(type(self).__name__, requested, backend_name),
)
else:
backend_name = base_backend

Expand Down
Loading