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
change
sglang
Commits
0e0eef00
Unverified
Commit
0e0eef00
authored
Aug 03, 2025
by
Cheng Wan
Committed by
GitHub
Aug 03, 2025
Browse files
[DP] fix the compatibility issue between DP attention and `--attention-backend triton` (#8723)
parent
cb099d20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
python/sglang/srt/model_executor/forward_batch_info.py
python/sglang/srt/model_executor/forward_batch_info.py
+10
-2
No files found.
python/sglang/srt/model_executor/forward_batch_info.py
View file @
0e0eef00
...
...
@@ -646,12 +646,17 @@ class ForwardBatch:
device
=
model_runner
.
device
,
)
bs
=
self
.
batch_size
if
len
(
global_num_tokens
)
>
1
:
num_tokens
=
global_num_tokens
[
get_attention_dp_rank
()]
else
:
num_tokens
=
global_num_tokens
[
0
]
if
self
.
forward_mode
.
is_decode
():
setattr
(
self
,
"raw_bs"
,
self
.
batch_size
)
self
.
batch_size
=
num_tokens
bs
=
self
.
batch_size
# padding
self
.
input_ids
=
self
.
_pad_tensor_to_size
(
self
.
input_ids
,
num_tokens
)
self
.
req_pool_indices
=
self
.
_pad_tensor_to_size
(
self
.
req_pool_indices
,
bs
)
...
...
@@ -659,6 +664,9 @@ class ForwardBatch:
seq_len_fill_value
=
(
model_runner
.
attn_backend
.
get_cuda_graph_seq_len_fill_value
()
)
self
.
seq_lens_sum
=
self
.
seq_lens_sum
+
seq_len_fill_value
*
(
bs
-
self
.
seq_lens
.
shape
[
0
]
)
self
.
seq_lens
=
self
.
_pad_tensor_to_size
(
self
.
seq_lens
,
bs
,
value
=
seq_len_fill_value
)
...
...
@@ -702,7 +710,7 @@ class ForwardBatch:
def
post_forward_mlp_sync_batch
(
self
,
logits_output
:
LogitsProcessorOutput
):
bs
=
self
.
batch_size
bs
=
getattr
(
self
,
"raw_bs"
,
self
.
batch_size
)
if
self
.
spec_info
is
not
None
:
if
self
.
forward_mode
.
is_decode
():
# draft
...
...
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