[Platform] format platform to make it more clear (#610)

Platform should only contain the function that based from vllm. This PR
move the unrelated function to the right place to make platform more
clear.

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2025-04-30 09:03:10 +08:00
committed by GitHub
parent b917361ca5
commit 95e7aa4736
3 changed files with 17 additions and 33 deletions

View File

@@ -226,29 +226,3 @@ class NPUPlatform(Platform):
model configuration.
"""
return True
@classmethod
def destroy_platform_model_parallel(cls) -> None:
from vllm_ascend.distributed.parallel_state import \
destory_ascend_model_parallel
destory_ascend_model_parallel()
@classmethod
def platform_has_backend_register(cls) -> bool:
return True
@classmethod
def platform_register_backend(cls, pg, prefix_store, group_rank,
group_size, backend_options,
timeout) -> None:
from torch.distributed import ProcessGroup, is_hccl_available
assert is_hccl_available()
from torch_npu._C._distributed_c10d import ProcessGroupHCCL
backend_options = ProcessGroupHCCL.Options()
backend_options._timeout = timeout
backend_class = ProcessGroupHCCL(prefix_store, group_rank, group_size,
backend_options)
device = torch.device("npu")
backend_class._set_sequence_number_for_group()
backend_type = ProcessGroup.BackendType.CUSTOM
pg._register_backend(device, backend_type, backend_class)