-
Notifications
You must be signed in to change notification settings - Fork 7.7k
fix: support PP2+CP8+TP8 (PP with context parallelism) #19548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+11
−3
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c6306a8
fix: support PP2+CP8+TP8 (PP with context parallelism)
whybeyoung 72346bd
fix lint
whybeyoung fb4ac91
Merge branch 'main' into fix-cp8pp2tp8
ShangmingCai a1e6b24
fix assert
whybeyoung b7bef35
Merge branch 'main' into fix-cp8pp2tp8
whybeyoung 3a4dd4f
Merge branch 'main' into fix-cp8pp2tp8
ShangmingCai 6d7d034
Merge branch 'main' into fix-cp8pp2tp8
ShangmingCai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1235,6 +1235,7 @@ def _handle_model_specific_adjustments(self): | |
| assert ( | ||
| self.tp_size == 8 | ||
| ), "Current multi-machine CP support suffers from precision issues. So context parallel only support Single machine(tp_size == 8)" | ||
| self.attn_cp_size = self.tp_size | ||
|
|
||
| logger.warning( | ||
| f"Enable Context Parallel opt for deeeseekv3.2-DSA, Setting dp_size == {self.dp_size} and moe_dense_tp_size == {self.moe_dense_tp_size}, ep_size == {self.ep_size}, tp_size == {self.tp_size}, kv_cache_dtype == {self.kv_cache_dtype}, moe_a2a_backend {self.moe_a2a_backend} " | ||
|
|
@@ -2116,7 +2117,8 @@ def _handle_context_parallelism(self): | |
| assert ( | ||
| self.tp_size % (self.dp_size * self.attn_cp_size) == 0 | ||
| ), "tp_size must be divisible by dp_size * attn_cp_size" | ||
| assert self.pp_size == 1, "PP is not supported with context parallelism" | ||
| if not self.enable_nsa_prefill_context_parallel: | ||
| assert self.pp_size == 1, "PP is not supported with context parallelism" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be reomved. with TP=2, we can support CP for H800/H20x8. For H200, there is no such constraints. |
||
|
|
||
| if self.moe_dp_size > 1: | ||
| # The tp_size is the world size, not the real tensor parallel size | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we clarify the attn_cp_size ? Currently cp is used as attn_dp_size = tp / dp. It can be confusing .