[refactor] Adopt get_parallel() everywhere and close out the parallel wrapper surface (#30492)
This commit is contained in:
@@ -1712,30 +1712,32 @@ class _SGLangPlugin(_FrameworkPlugin):
|
||||
|
||||
info = {}
|
||||
|
||||
from sglang.srt.runtime_context import get_parallel
|
||||
|
||||
try:
|
||||
info["tp_rank"] = self._dist.get_tensor_model_parallel_rank()
|
||||
info["tp_size"] = self._dist.get_tensor_model_parallel_world_size()
|
||||
info["pp_rank"] = self._dist.get_pipeline_model_parallel_rank()
|
||||
info["pp_size"] = self._dist.get_pipeline_model_parallel_world_size()
|
||||
info["moe_ep_rank"] = self._dist.get_moe_expert_parallel_rank()
|
||||
info["moe_ep_size"] = self._dist.get_moe_expert_parallel_world_size()
|
||||
info["moe_tp_rank"] = self._dist.get_moe_tensor_parallel_rank()
|
||||
info["moe_tp_size"] = self._dist.get_moe_tensor_parallel_world_size()
|
||||
info["moe_dp_rank"] = self._dist.get_moe_data_parallel_rank()
|
||||
info["moe_dp_size"] = self._dist.get_moe_data_parallel_world_size()
|
||||
parallel = get_parallel()
|
||||
info["tp_rank"] = parallel.tp_rank
|
||||
info["tp_size"] = parallel.tp_size
|
||||
info["pp_rank"] = parallel.pp_rank
|
||||
info["pp_size"] = parallel.pp_size
|
||||
info["moe_ep_rank"] = parallel.moe_ep_rank
|
||||
info["moe_ep_size"] = parallel.moe_ep_size
|
||||
info["moe_tp_rank"] = parallel.moe_tp_rank
|
||||
info["moe_tp_size"] = parallel.moe_tp_size
|
||||
info["moe_dp_rank"] = parallel.moe_dp_rank
|
||||
info["moe_dp_size"] = parallel.moe_dp_size
|
||||
except (AttributeError, AssertionError):
|
||||
info["distributed_error"] = True
|
||||
|
||||
try:
|
||||
parallel = get_parallel()
|
||||
info["enable_dp_attention"] = self._dp_attn.is_dp_attention_enabled()
|
||||
info["attn_tp_rank"] = self._dp_attn.get_attention_tp_rank()
|
||||
info["attn_tp_size"] = self._dp_attn.get_attention_tp_size()
|
||||
info["attn_tp_rank"] = parallel.attn_tp_rank
|
||||
info["attn_tp_size"] = parallel.attn_tp_size
|
||||
info["attn_dp_rank"] = self._dp_attn.get_attention_dp_rank()
|
||||
info["attn_dp_size"] = self._dp_attn.get_attention_dp_size()
|
||||
info["local_attn_dp_rank"] = self._dp_attn.get_local_attention_dp_rank()
|
||||
info["local_attn_dp_size"] = self._dp_attn.get_local_attention_dp_size()
|
||||
info["attn_cp_rank"] = self._dp_attn.get_attention_cp_rank()
|
||||
info["attn_cp_size"] = self._dp_attn.get_attention_cp_size()
|
||||
info["attn_cp_rank"] = parallel.attn_cp_rank
|
||||
info["attn_cp_size"] = parallel.attn_cp_size
|
||||
except (AttributeError, AssertionError):
|
||||
info["dp_attention_error"] = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user