Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions python/sglang/srt/layers/dp_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions test/srt/parse_results.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import json
import pandas as pd
import argparse
import json
import os

import pandas as pd
from tabulate import tabulate

# Parse command-line arguments
Expand Down
3 changes: 3 additions & 0 deletions test/srt/test_dp_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def setUpClass(cls):
"--enable-dp-attention",
"--dp",
"2",
"--enable-torch-compile",
"--torch-compile-max-bs",
"2",
],
)

Expand Down
Loading