[ROCm][Perf] Enable DPA+ETP prefill compute/comm dual-batch-overlap for DeepSeek-V4 (#57773)
Signed-off-by: Shanshan Shen <87969357+shen-shanshan@users.noreply.github.com> Signed-off-by: shen-shanshan <467638484@qq.com>
This commit is contained in:
@@ -176,7 +176,12 @@ def maybe_create_ubatch_slices(
|
||||
if split_point is None:
|
||||
split_point = int(num_tokens_padded) // num_ubatches
|
||||
|
||||
token_split_points = [split_point * i for i in range(1, num_ubatches)]
|
||||
if isinstance(split_point, int):
|
||||
token_split_points = [split_point * i for i in range(1, num_ubatches)]
|
||||
else:
|
||||
# Explicit split points, one per ubatch boundary.
|
||||
assert len(split_point) == num_ubatches - 1
|
||||
token_split_points = [int(p) for p in split_point]
|
||||
|
||||
# TODO(lucas): Refactor the gpu_model_runner.py so we can pass
|
||||
# in cu_num_tokens directly (i.e. query_start_loc)
|
||||
@@ -187,7 +192,7 @@ def maybe_create_ubatch_slices(
|
||||
start_token = 0
|
||||
|
||||
# Add the end point to the split points to make iteration easier
|
||||
all_points = token_split_points + [cu_num_tokens[-1]]
|
||||
all_points = token_split_points + [int(cu_num_tokens[-1])]
|
||||
|
||||
for end_token in all_points:
|
||||
token_slice = slice(start_token, end_token)
|
||||
@@ -316,6 +321,10 @@ def _make_metadata_with_slice(
|
||||
block_table_tensor = attn_metadata.block_table_tensor[request_slice]
|
||||
slot_mapping = attn_metadata.slot_mapping[token_slice]
|
||||
|
||||
positions = attn_metadata.positions
|
||||
if positions is not None:
|
||||
positions = positions[token_slice]
|
||||
|
||||
return CommonAttentionMetadata(
|
||||
query_start_loc=query_start_loc,
|
||||
query_start_loc_cpu=query_start_loc_cpu,
|
||||
@@ -326,6 +335,7 @@ def _make_metadata_with_slice(
|
||||
max_seq_len=max_seq_len,
|
||||
block_table_tensor=block_table_tensor,
|
||||
slot_mapping=slot_mapping,
|
||||
positions=positions,
|
||||
seq_lens_cpu_upper_bound=seq_lens_cpu_upper_bound,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user