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
defede50
Unverified
Commit
defede50
authored
Apr 14, 2025
by
fzyzcjy
Committed by
GitHub
Apr 14, 2025
Browse files
Fix DeepSeek DP Attention + torch compile (#5367)
Co-authored-by:
ispobock
<
ispobaoke@163.com
>
parent
fc728719
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
python/sglang/srt/layers/dp_attention.py
python/sglang/srt/layers/dp_attention.py
+2
-4
test/srt/parse_results.py
test/srt/parse_results.py
+3
-2
test/srt/test_dp_attention.py
test/srt/test_dp_attention.py
+3
-0
No files found.
python/sglang/srt/layers/dp_attention.py
View file @
defede50
...
...
@@ -192,8 +192,7 @@ def _dp_gather(
if
local_tokens
.
shape
[
0
]
>
0
and
(
is_partial
or
get_attention_tp_rank
()
==
0
):
assert
(
global_tokens
.
untyped_storage
().
data_ptr
()
!=
local_tokens
.
untyped_storage
().
data_ptr
()
local_tokens
.
untyped_storage
()
is
not
global_tokens
.
untyped_storage
()
),
"aliasing between global_tokens and local_tokens not allowed"
memcpy_triton
(
global_tokens
,
local_tokens
,
0
,
local_start_pos
,
local_num_tokens
,
False
...
...
@@ -243,8 +242,7 @@ def dp_scatter(
assert
global_tokens
.
is_contiguous
()
if
local_tokens
.
shape
[
0
]
>
0
:
assert
(
local_tokens
.
untyped_storage
().
data_ptr
()
!=
global_tokens
.
untyped_storage
().
data_ptr
()
local_tokens
.
untyped_storage
()
is
not
global_tokens
.
untyped_storage
()
),
"aliasing between local_tokens and global_tokens not allowed"
memcpy_triton
(
local_tokens
,
global_tokens
,
0
,
local_start_pos
,
local_num_tokens
,
True
...
...
test/srt/parse_results.py
View file @
defede50
import
json
import
pandas
as
pd
import
argparse
import
json
import
os
import
pandas
as
pd
from
tabulate
import
tabulate
# Parse command-line arguments
...
...
test/srt/test_dp_attention.py
View file @
defede50
...
...
@@ -28,6 +28,9 @@ class TestDPAttentionDP2TP2(CustomTestCase):
"--enable-dp-attention"
,
"--dp"
,
"2"
,
"--enable-torch-compile"
,
"--torch-compile-max-bs"
,
"2"
,
],
)
...
...
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