Fix MUSA detection in compiled prefill path (#39061)
This commit is contained in:
@@ -115,13 +115,14 @@ def should_use_dsa_fused_topk(seed_dsa_topk_from_draft_extend: bool) -> bool:
|
||||
|
||||
|
||||
def is_dsa_enable_prefill_cp():
|
||||
if get_parallel().attn_cp_size <= 1:
|
||||
return False
|
||||
|
||||
if is_hip() or is_npu() or is_musa():
|
||||
return False
|
||||
|
||||
# Generic prefill CP derives activation from the runtime topology and model
|
||||
# architecture.
|
||||
if get_parallel().attn_cp_size <= 1:
|
||||
return False
|
||||
from sglang.srt.configs.model_config import is_deepseek_dsa, is_deepseek_v4
|
||||
|
||||
hf_config = process_model_config().hf_config
|
||||
|
||||
@@ -221,13 +221,17 @@ def is_cpu() -> bool:
|
||||
return os.getenv("SGLANG_USE_CPU_ENGINE", "0") == "1" and is_host_cpu_supported
|
||||
|
||||
|
||||
try:
|
||||
import torchada # noqa: F401
|
||||
except ImportError:
|
||||
_IS_MUSA = False
|
||||
else:
|
||||
_IS_MUSA = hasattr(torch.version, "musa") and torch.version.musa is not None
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def is_musa() -> bool:
|
||||
try:
|
||||
import torchada # noqa: F401
|
||||
except ImportError:
|
||||
return False
|
||||
return hasattr(torch.version, "musa") and torch.version.musa is not None
|
||||
return _IS_MUSA
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
|
||||
Reference in New Issue
Block a user