main
py 14 lines 490 Bytes
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
5 def use_tensor_descriptor(override: bool | None = None) -> bool:
6 """Tri-state VLLM_TRITON_USE_TD: unset=auto (on for XPU), 1/0=force on/off."""
7 from vllm import envs
8 from vllm.platforms import current_platform
9
10 if override is None:
11 override = envs.VLLM_TRITON_USE_TD
12 if override is not None:
13 return override
14 return current_platform.is_xpu()