[AMD] deepseek-v4 clean env vars (#28920)
This commit is contained in:
@@ -1472,13 +1472,11 @@ class DeepseekV4HipRadixBackend(
|
||||
extra_indices.shape[-1] % 64 == 0
|
||||
), f"{extra_indices.shape=}'s last dimension is not aligned to 64"
|
||||
|
||||
import os
|
||||
|
||||
from sglang.srt.layers.attention.hip_flash_mla import (
|
||||
flash_mla_with_kvcache_entrypoint,
|
||||
)
|
||||
|
||||
backend = os.environ.get("SGLANG_HACK_FLASHMLA_BACKEND", "kernel")
|
||||
backend = envs.SGLANG_HACK_FLASHMLA_BACKEND.get()
|
||||
input_dict = dict(
|
||||
q=q,
|
||||
k_cache=swa_k_cache,
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import os
|
||||
|
||||
from sglang.srt.environ import envs
|
||||
from sglang.srt.utils import is_hip
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
def is_unified_kv_triton() -> bool:
|
||||
# unified_kv_triton is only implemented on HIP (ROCm)
|
||||
return (
|
||||
is_hip()
|
||||
and os.environ.get("SGLANG_HACK_FLASHMLA_BACKEND", "") == "unified_kv_triton"
|
||||
)
|
||||
return is_hip() and envs.SGLANG_HACK_FLASHMLA_BACKEND.get() == "unified_kv_triton"
|
||||
|
||||
@@ -2,6 +2,7 @@ from typing import Any, Optional
|
||||
|
||||
import torch
|
||||
|
||||
from sglang.srt.environ import envs
|
||||
from sglang.srt.layers.quantization.fp8_kernel import is_fp8_fnuz
|
||||
from sglang.srt.utils import is_hip
|
||||
|
||||
@@ -10,9 +11,7 @@ FP8_DTYPE = torch.float8_e4m3fnuz if is_fp8_fnuz() else torch.float8_e4m3fn
|
||||
|
||||
def flash_mla_with_kvcache_entrypoint(backend: str, **kwargs):
|
||||
if is_hip():
|
||||
import os
|
||||
|
||||
backend = os.environ.get("SGLANG_HACK_FLASHMLA_BACKEND", "tilelang")
|
||||
backend = envs.SGLANG_HACK_FLASHMLA_BACKEND.get()
|
||||
else:
|
||||
import sgl_kernel.flash_mla as flash_mla
|
||||
|
||||
|
||||
@@ -2626,6 +2626,18 @@ class ServerArgs:
|
||||
envs.SGLANG_OPT_USE_TILELANG_MHC_PRE.set(False)
|
||||
envs.SGLANG_OPT_DEEPGEMM_HC_PRENORM.set(False)
|
||||
envs.SGLANG_FP8_PAGED_MQA_LOGITS_TORCH.set(True)
|
||||
elif is_hip():
|
||||
envs.SGLANG_OPT_DEEPGEMM_HC_PRENORM.set(False)
|
||||
envs.SGLANG_OPT_USE_FUSED_COMPRESS.set(True)
|
||||
envs.SGLANG_OPT_FP8_WO_A_GEMM.set(False)
|
||||
envs.SGLANG_OPT_USE_JIT_INDEXER_METADATA.set(False)
|
||||
envs.SGLANG_OPT_USE_TOPK_V2.set(False)
|
||||
envs.SGLANG_OPT_USE_AITER_INDEXER.set(True)
|
||||
envs.SGLANG_OPT_USE_TILELANG_MHC_PRE.set(False)
|
||||
envs.SGLANG_OPT_USE_TILELANG_MHC_POST.set(False)
|
||||
envs.SGLANG_FP8_PAGED_MQA_LOGITS_TORCH.set(True)
|
||||
envs.SGLANG_OPT_USE_MULTI_STREAM_OVERLAP.set(False)
|
||||
envs.SGLANG_EAGER_INPUT_NO_COPY.set(True)
|
||||
|
||||
elif model_arch in ["GptOssForCausalLM"]:
|
||||
# Set attention backend for GPT-OSS
|
||||
|
||||
Reference in New Issue
Block a user