Add env var to control custom Triton kernel cache and set CSGMV as default backend. (#12176)
This commit is contained in:
@@ -180,6 +180,7 @@ class Envs:
|
||||
|
||||
# Triton
|
||||
SGLANG_TRITON_DECODE_ATTN_STATIC_KV_SPLITS = EnvBool(False)
|
||||
SGLANG_USE_CUSTOM_TRITON_KERNEL_CACHE = EnvBool(False)
|
||||
|
||||
# Torch Compile
|
||||
SGLANG_ENABLE_TORCH_COMPILE = EnvBool(False)
|
||||
|
||||
@@ -331,7 +331,7 @@ class ServerArgs:
|
||||
max_loaded_loras: Optional[int] = None
|
||||
max_loras_per_batch: int = 8
|
||||
lora_eviction_policy: str = "lru"
|
||||
lora_backend: str = "triton"
|
||||
lora_backend: str = "csgmv"
|
||||
max_lora_chunk_size: Optional[int] = 16
|
||||
|
||||
# Kernel backend
|
||||
|
||||
@@ -3571,7 +3571,17 @@ def cached_triton_kernel(key_fn=None):
|
||||
"""
|
||||
|
||||
def decorator(fn):
|
||||
return CachedKernel(fn, key_fn)
|
||||
if envs.SGLANG_USE_CUSTOM_TRITON_KERNEL_CACHE.get():
|
||||
logger.debug(
|
||||
f"{envs.SGLANG_USE_CUSTOM_TRITON_KERNEL_CACHE.name} = True. Using custom triton kernel cache."
|
||||
)
|
||||
return CachedKernel(fn, key_fn)
|
||||
else:
|
||||
# Fallback to the native triton cache.
|
||||
logger.debug(
|
||||
f"{envs.SGLANG_USE_CUSTOM_TRITON_KERNEL_CACHE.name} = False. Using native triton kernel cache."
|
||||
)
|
||||
return fn
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
@@ -511,7 +511,7 @@ class SRTRunner:
|
||||
attention_backend: Optional[str] = None,
|
||||
prefill_attention_backend: Optional[str] = None,
|
||||
decode_attention_backend: Optional[str] = None,
|
||||
lora_backend: str = "triton",
|
||||
lora_backend: str = "csgmv",
|
||||
disable_cuda_graph: bool = False,
|
||||
disable_radix_cache: bool = False,
|
||||
chunked_prefill_size: Optional[int] = None,
|
||||
|
||||
Reference in New Issue
Block a user