Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhaoyu6
sglang
Commits
b87aacb5
"test.vcproj" did not exist on "2a0ddc8cb27d91437382757af3a510069969d287"
Unverified
Commit
b87aacb5
authored
Aug 13, 2025
by
Cheng Wan
Committed by
GitHub
Aug 13, 2025
Browse files
[DP Attention] Refactor: adding some utility functions (#9136)
parent
b3363cc1
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
python/sglang/srt/two_batch_overlap.py
python/sglang/srt/two_batch_overlap.py
+4
-8
No files found.
python/sglang/srt/two_batch_overlap.py
View file @
b87aacb5
...
@@ -678,16 +678,12 @@ class TboForwardBatchPreparer:
...
@@ -678,16 +678,12 @@ class TboForwardBatchPreparer:
# TODO improve, e.g. unify w/ `init_raw`
# TODO improve, e.g. unify w/ `init_raw`
if
(
if
(
global_server_args_dict
[
"moe_dense_tp_size"
]
==
1
global_server_args_dict
[
"moe_dense_tp_size"
]
==
1
and
batch
.
g
athered
_buffer
is
not
None
and
batch
.
g
lobal_dp
_buffer
_len
is
not
None
):
):
sum_len
=
end_token_index
-
start_token_index
sum_len
=
end_token_index
-
start_token_index
gathered_buffer
=
torch
.
zeros
(
global_dp_buffer_len
=
sum_len
(
sum_len
,
batch
.
gathered_buffer
.
shape
[
1
]),
dtype
=
batch
.
gathered_buffer
.
dtype
,
device
=
batch
.
gathered_buffer
.
device
,
)
else
:
else
:
g
athered
_buffer
=
None
g
lobal_dp
_buffer
_len
=
None
output_dict
.
update
(
output_dict
.
update
(
dict
(
dict
(
...
@@ -706,7 +702,7 @@ class TboForwardBatchPreparer:
...
@@ -706,7 +702,7 @@ class TboForwardBatchPreparer:
global_num_tokens_gpu
=
None
,
global_num_tokens_gpu
=
None
,
global_num_tokens_cpu
=
None
,
global_num_tokens_cpu
=
None
,
dp_padding_mode
=
None
,
dp_padding_mode
=
None
,
g
athered_buffer
=
gathered
_buffer
,
g
lobal_dp_buffer_len
=
global_dp
_buffer
_len
,
global_num_tokens_for_logprob_gpu
=
None
,
global_num_tokens_for_logprob_gpu
=
None
,
global_num_tokens_for_logprob_cpu
=
None
,
global_num_tokens_for_logprob_cpu
=
None
,
sampling_info
=
None
,
sampling_info
=
None
,
...
...
Prev
1
2
Next
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