From 2c10c6232d253ce048ef76e730705db1bfb8cc63 Mon Sep 17 00:00:00 2001 From: niushengxiao Date: Mon, 3 Aug 2026 11:00:53 +0800 Subject: [PATCH 1/3] fix: fix a ep start bug --- lightllm/__init__.py | 4 ++++ .../meta_weights/fused_moe/impl/deepgemm_impl.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lightllm/__init__.py b/lightllm/__init__.py index e9ba6f3041..e1b90c326e 100644 --- a/lightllm/__init__.py +++ b/lightllm/__init__.py @@ -1,3 +1,7 @@ +import os + +os.environ.setdefault("EP_REUSE_NCCL_COMM", "0") + from lightllm.utils.device_utils import is_musa if is_musa(): diff --git a/lightllm/common/basemodel/layer_weights/meta_weights/fused_moe/impl/deepgemm_impl.py b/lightllm/common/basemodel/layer_weights/meta_weights/fused_moe/impl/deepgemm_impl.py index aa080a19fe..cfc82facee 100644 --- a/lightllm/common/basemodel/layer_weights/meta_weights/fused_moe/impl/deepgemm_impl.py +++ b/lightllm/common/basemodel/layer_weights/meta_weights/fused_moe/impl/deepgemm_impl.py @@ -146,7 +146,7 @@ def select_experts_and_quant_input( n_group: int, scoring_func: str, ): - topk_weights, topk_idx = self._select_experts( + topk_weights, topk_idx, _ = self._select_experts( input_tensor=hidden_states, router_logits=router_logits, correction_bias=e_score_correction_bias, From 9a4612beee75ff79da3fbce0e5e8179c20aaa3b3 Mon Sep 17 00:00:00 2001 From: shihaobai <1798930569@qq.com> Date: Mon, 3 Aug 2026 06:31:23 +0000 Subject: [PATCH 2/3] fix: eagerly initialize the DeepEP process group --- lightllm/distributed/communication_op.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lightllm/distributed/communication_op.py b/lightllm/distributed/communication_op.py index f15badde25..07a69db0fe 100644 --- a/lightllm/distributed/communication_op.py +++ b/lightllm/distributed/communication_op.py @@ -152,6 +152,13 @@ def new_deepep_group( global_world_size = get_global_world_size() deepep_group = dist.new_group(list(range(global_world_size))) + # DeepEP reuses this group's NCCL communicator via _comm_ptr(). Because the + # group is created without device_id, warm it up first to avoid reading a null + # communicator. The default process group's warmup does not cover this group. + dist.barrier( + group=deepep_group, + device_ids=[torch.cuda.current_device()], + ) self.ll_num_tokens = prefill_num_max_dispatch_tokens_per_rank self.ll_decode_num_tokens = decode_num_max_dispatch_tokens_per_rank self.ll_hidden = hidden_size From 9e68fbe3bf6047183e9ce4f622eff2d0b82b065a Mon Sep 17 00:00:00 2001 From: shihaobai <1798930569@qq.com> Date: Mon, 3 Aug 2026 06:36:17 +0000 Subject: [PATCH 3/3] remove env --- lightllm/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lightllm/__init__.py b/lightllm/__init__.py index e1b90c326e..e9ba6f3041 100644 --- a/lightllm/__init__.py +++ b/lightllm/__init__.py @@ -1,7 +1,3 @@ -import os - -os.environ.setdefault("EP_REUSE_NCCL_COMM", "0") - from lightllm.utils.device_utils import is_musa if is_musa():