[Fix] Don't let a failed deep_ep import-time check kill servers that never use DeepEP (#40671)

This commit is contained in:
Gawr Gura 0721
2026-10-06 01:58:02 -07:00
committed by GitHub
parent e49e971131
commit b563bbd597
3 changed files with 105 additions and 4 deletions
@@ -45,6 +45,7 @@ _use_zbal = _is_npu and envs.SGLANG_ZBAL_LOCAL_MEM_SIZE.get() > 0
if TYPE_CHECKING:
from sglang.srt.batch_overlap.single_batch_overlap import CombineOverlapArgs
_deepep_import_error: Optional[BaseException] = None
try:
if _use_zbal:
from zbal.zbal.deepep_adaptor import Config
@@ -58,8 +59,11 @@ try:
)
use_deepep = True
except ImportError:
except Exception as exc:
# deep_ep's import-time host checks raise more than ImportError; defer any
# failure to the first DeepEP use so other models still start.
use_deepep = False
_deepep_import_error = exc
from enum import Enum, IntEnum, auto
@@ -375,9 +379,14 @@ class _DeepEPDispatcherImplBase:
):
if not use_deepep:
raise ImportError(
"DeepEP is not installed. Please install DeepEP package from "
"DeepEP is not available. Please install DeepEP package from "
"https://github.com/deepseek-ai/deepep."
)
+ (
f" Original import error: {_deepep_import_error}"
if _deepep_import_error is not None
else ""
)
) from _deepep_import_error
self.group = group
self.router_topk = router_topk
@@ -41,7 +41,7 @@ try:
from deep_ep import ElasticBuffer
use_deepep_v2 = True
except (ImportError, OSError) as exc:
except Exception as exc: # deep_ep's import-time host checks; see deepep.py
use_deepep_v2 = False
_deepep_v2_import_error = exc