[Misc] centralize all usage of environment variables (#4548)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
"""Attention layer ROCm GPUs."""
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, List, Optional, Tuple, Type
|
||||
|
||||
import torch
|
||||
|
||||
import vllm.envs as envs
|
||||
from vllm.attention.backends.abstract import (AttentionBackend, AttentionImpl,
|
||||
AttentionMetadata,
|
||||
AttentionMetadataPerStage)
|
||||
@@ -156,8 +156,7 @@ class ROCmFlashAttentionImpl(AttentionImpl):
|
||||
|
||||
self.use_naive_attn = False
|
||||
# NOTE: Allow for switching between Triton and CK. Defaulting to triton.
|
||||
self.use_triton_flash_attn = (os.environ.get(
|
||||
"VLLM_USE_TRITON_FLASH_ATTN", "True").lower() in ("true", "1"))
|
||||
self.use_triton_flash_attn = envs.VLLM_USE_TRITON_FLASH_ATTN
|
||||
if self.use_triton_flash_attn:
|
||||
from vllm.attention.ops.triton_flash_attention import ( # noqa: F401
|
||||
triton_attention)
|
||||
|
||||
Reference in New Issue
Block a user