Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions vllm_ascend/distributed/parallel_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"expert tensor parallel group is not initialized")
return _ETP

def get_wp_group() -> GroupCoordinator:
assert _WP is not None, (

Check failure on line 24 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Name "_WP" is not defined [name-defined]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the declaration of _WP to global scope?

"world group is not initialized")
return _WP

Check failure on line 26 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Name "_WP" is not defined [name-defined]

def init_ascend_model_parallel(
tensor_model_parallel_size: int = 1,
Expand Down Expand Up @@ -59,6 +63,14 @@
backend,
group_name="etp")

global _WP
all_ranks = torch.arange(world_size)
group_ranks = all_ranks.view(-1, world_size).unbind(0)

Check failure on line 68 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

"list[int]" has no attribute "tolist" [attr-defined]
group_ranks = [x.tolist() for x in group_ranks]

Check failure on line 69 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Name "_WP" is not defined [name-defined]
_WP = init_model_parallel_group(group_ranks,
get_world_group().local_rank,
backend,
group_name="wp")

def destory_ascend_model_parallel():
global _EP
Expand All @@ -70,3 +82,8 @@
if _ETP:
_ETP.destroy()
_ETP = None

global _WP

Check failure on line 86 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Name "_WP" is not defined [name-defined]
if _WP:

Check failure on line 87 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Name "_WP" is not defined [name-defined]
_WP.destroy()

Check failure on line 88 in vllm_ascend/distributed/parallel_state.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Name "_WP" is not defined [name-defined]
_WP = None
Empty file.
Empty file.
Loading
Loading