[Misc] Rename VLLM_TRITON_ATTN_USE_TD to VLLM_TRITON_USE_TD (#45781)
Signed-off-by: Artur Fierka <artur.fierka@intel.com> Co-authored-by: Claude <noreply@anthropic.com>
Artur Fierka committed
Jul 14, 2026 at 12:32 UTC
50ac1c7bab47f14d56d86967532574824d02260e
3 files changed
+26
-7
vllm/envs.py
+22
-3
@@ -87,6 +87,8 @@ if TYPE_CHECKING:
87
VLLM_MAIN_CUDA_VERSION: str = "13.0"
88
VLLM_FLOAT32_MATMUL_PRECISION: Literal["highest", "high", "medium"] = "highest"
89
VLLM_BATCH_INVARIANT: bool = False
90
+ VLLM_TRITON_USE_TD: bool | None = None
91
+ # Deprecated alias of VLLM_TRITON_USE_TD (removed in v0.25).
92
VLLM_TRITON_ATTN_USE_TD: bool | None = None
93
VLLM_GPU_SYNC_CHECK: Literal["warn", "error"] | None = None
94
MAX_JOBS: str | None = None
@@ -533,6 +535,19 @@ def get_env_or_set_default(
535
logger = logging.getLogger(__name__)
536
537
538
+def _deprecated_triton_attn_use_td() -> None:
539
+ """Warn that VLLM_TRITON_ATTN_USE_TD was renamed to VLLM_TRITON_USE_TD.
540
+
541
+ The old name is ignored; VLLM_TRITON_USE_TD is the supported variable.
542
+ """
543
+ if "VLLM_TRITON_ATTN_USE_TD" in os.environ:
544
+ logger.warning(
545
+ "VLLM_TRITON_ATTN_USE_TD is deprecated and will be removed in "
546
+ "v0.25. Use VLLM_TRITON_USE_TD instead."
547
+ )
548
+ return None
549
+
550
+
551
def _resolve_rust_frontend_path() -> str | None:
552
"""Resolve the Rust frontend binary path.
553
@@ -588,13 +603,13 @@ environment_variables: dict[str, Callable[[], Any]] = {
603
"VLLM_BATCH_INVARIANT": lambda: bool(int(os.getenv("VLLM_BATCH_INVARIANT", "0"))),
604
# Use tensor descriptors for Q/K/V loads and output stores in the
605
# Triton unified-attention kernel. Enables HW 2D block reads on
591
- # Intel Xe2/Xe3; the non-TD branch is dead-code-eliminated at Triton
606
+ # Intel XPU; the non-TD branch is dead-code-eliminated at Triton
607
# compile time so other platforms see no overhead. Tri-state override:
608
# unset (default) lets the `triton_attn` backend auto-select per
609
# platform (currently auto-enabled on XPU only); ``1`` forces TD on;
610
# ``0`` forces TD off. Useful for A/B benchmarking the TD path.
596
- "VLLM_TRITON_ATTN_USE_TD": lambda: {"1": True, "0": False}.get(
597
- os.getenv("VLLM_TRITON_ATTN_USE_TD", "").strip()
611
+ "VLLM_TRITON_USE_TD": lambda: {"1": True, "0": False}.get(
612
+ os.getenv("VLLM_TRITON_USE_TD", "").strip()
613
),
614
# If set, enable PyTorch's GPU<->CPU synchronization debug mode around
615
# the worker's `execute_model` and `sample_tokens` calls. Valid values
@@ -603,6 +618,10 @@ environment_variables: dict[str, Callable[[], Any]] = {
618
"VLLM_GPU_SYNC_CHECK": env_with_choices(
619
"VLLM_GPU_SYNC_CHECK", None, ["warn", "error"]
620
),
621
+ # Deprecated: renamed to VLLM_TRITON_USE_TD. Kept registered so it does
622
+ # not trip the unknown-env-var check; warns on use and is otherwise
623
+ # ignored.
624
+ "VLLM_TRITON_ATTN_USE_TD": lambda: _deprecated_triton_attn_use_td(),
625
# Maximum number of compilation jobs to run in parallel.
626
# By default this is the number of CPUs
627
"MAX_JOBS": lambda: os.getenv("MAX_JOBS", None),
vllm/v1/attention/backends/triton_attn.py
+3
-3
@@ -563,15 +563,15 @@ class TritonAttentionImpl(AttentionImpl):
563
self._is_per_token_head_quant = self._kv_quant_mode.is_per_token_head
564
565
# Enable tensor descriptors for Q/K/V load/store on platforms that
566
- # benefit from HW 2D block reads (Intel Xe2/Xe3). The dead branch
566
+ # benefit from HW 2D block reads (Intel XPU). The dead branch
567
# is eliminated at Triton compile time, so other platforms see
568
# zero cost when TD is off.
569
#
570
- # ``VLLM_TRITON_ATTN_USE_TD`` is tri-state:
570
+ # ``VLLM_TRITON_USE_TD`` is tri-state:
571
# - unset (None): auto-select (TD on for XPU, off elsewhere),
572
# - ``1``: force TD on regardless of platform,
573
# - ``0``: force TD off regardless of platform (useful for A/B).
574
- td_override = envs.VLLM_TRITON_ATTN_USE_TD
574
+ td_override = envs.VLLM_TRITON_USE_TD
575
if td_override is None:
576
self.use_td = current_platform.is_xpu()
577
else:
vllm/v1/attention/ops/triton_unified_attention.py
+1
-1
@@ -1026,7 +1026,7 @@ def unified_attention(
1026
assert q.stride(1) == head_size, (
1027
f"USE_TD_QO requires contiguous query heads "
1028
f"(q.stride(1) = {q.stride(1)} != head_size = {head_size}); "
1029
- f"set VLLM_TRITON_ATTN_USE_TD=0 or pad the query layout."
1029
+ f"set VLLM_TRITON_USE_TD=0 or pad the query layout."
1030
)
1031
assert out.stride(1) == head_size, (
1032
f"USE_TD_QO requires contiguous output heads "