Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
0d37450e
Unverified
Commit
0d37450e
authored
Oct 09, 2025
by
Sage Moore
Committed by
GitHub
Oct 09, 2025
Browse files
[BUGFIX] Add cu_tokens_across_sp to DPMetadata (#26457)
Signed-off-by:
Sage Moore
<
sage@neuralmagic.com
>
parent
47e66c24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
vllm/forward_context.py
vllm/forward_context.py
+11
-0
No files found.
vllm/forward_context.py
View file @
0d37450e
...
@@ -161,6 +161,17 @@ class DPMetadata:
...
@@ -161,6 +161,17 @@ class DPMetadata:
assert
self
.
local_sizes
is
not
None
assert
self
.
local_sizes
is
not
None
return
self
.
local_sizes
return
self
.
local_sizes
# Get the cumulative tokens across sequence parallel ranks.
# In this case the input to the MoEs will be distributed w.r.t both
# DP and TP rank.
# When sp_size==1, this is just the cummulative num tokens across DP.
def
cu_tokens_across_sp
(
self
,
sp_size
:
int
)
->
torch
.
Tensor
:
num_tokens_across_sp_cpu
=
(
self
.
num_tokens_across_dp_cpu
-
1
+
sp_size
)
//
sp_size
num_tokens_across_sp_cpu
=
num_tokens_across_sp_cpu
.
repeat_interleave
(
sp_size
)
return
torch
.
cumsum
(
num_tokens_across_sp_cpu
,
dim
=
0
)
@
dataclass
@
dataclass
class
ForwardContext
:
class
ForwardContext
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment