Skip to content

[BugFix] Deepseek renaming cum_offsets to cu_seqlens_q #2895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions custom_ops/gpu_ops/append_attn/mla_cache_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ std::vector<paddle::Tensor> PrefillMLAWriteCacheKernel(

meta_data.max_blocks_per_seq = block_tables.dims()[1];
meta_data.block_size = kv_cache_dims[2];
meta_data.batch_size = cu_seqlens_q.dims()[0];
meta_data.batch_size = seq_lens_decoder.dims()[0];
switch (kv_pe.dtype()) {
case paddle::DataType::BFLOAT16: {
return PrefillMLAWriteCache<paddle::DataType::BFLOAT16>(meta_data,
Expand Down Expand Up @@ -224,7 +224,7 @@ std::vector<paddle::Tensor> DecodeMLAWriteCacheKernel(

meta_data.max_blocks_per_seq = block_tables.dims()[1];
meta_data.block_size = kv_cache_dims[2];
meta_data.batch_size = cu_seqlens_q.dims()[0];
meta_data.batch_size = seq_lens_encoder.dims()[0];
switch (kv_pe.dtype()) {
case paddle::DataType::BFLOAT16: {
return DecodeMLAWriteCache<paddle::DataType::BFLOAT16>(meta_data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def forward_extend(

latent_cache = forward_meta.caches[layer.layer_id] if hasattr(
forward_meta, 'caches') else None

# 写入缓存
prefill_mla_write_cache(
compressed_kv,
Expand All @@ -249,7 +248,7 @@ def forward_extend(
forward_meta.seq_lens_encoder,
forward_meta.seq_lens_decoder,
forward_meta.padding_offset,
forward_meta.cum_offsets,
forward_meta.cu_seqlens_q,
metadata.block_tables,
"none",
getattr(forward_meta, 'max_input_length', -1),
Expand Down Expand Up @@ -308,7 +307,7 @@ def forward_decode(
forward_meta.seq_lens_decoder,
forward_meta.seq_lens_encoder,
forward_meta.padding_offset,
forward_meta.cum_offsets,
forward_meta.cu_seqlens_q,
metadata.block_tables,
"none",
self.max_seq_len,
Expand All @@ -325,7 +324,6 @@ def forward_decode(
forward_meta.seq_lens_this_time,
forward_meta.cu_seqlens_q,
forward_meta.padding_offset,
forward_meta.cum_offsets,
metadata.block_tables,
metadata.encoder_batch_ids,
metadata.encoder_tile_ids_per_batch,
Expand Down Expand Up @@ -402,7 +400,7 @@ def forward_mixed(
forward_meta.seq_lens_encoder,
forward_meta.seq_lens_decoder,
forward_meta.padding_offset,
forward_meta.cum_offsets,
forward_meta.cu_seqlens_q,
metadata.block_tables,
"none",
self.max_seq_len,
Expand Down Expand Up @@ -433,7 +431,7 @@ def forward_mixed(
forward_meta.seq_lens_decoder,
forward_meta.seq_lens_encoder,
forward_meta.padding_offset,
forward_meta.cum_offsets,
forward_meta.cu_seqlens_q,
metadata.block_tables,
"none",
self.max_seq_len,
Expand All @@ -450,7 +448,6 @@ def forward_mixed(
forward_meta.seq_lens_this_time,
forward_meta.cu_seqlens_q,
forward_meta.padding_offset,
forward_meta.cum_offsets,
metadata.block_tables,
metadata.encoder_batch_ids,
metadata.encoder_tile_ids_per_batch,
Expand Down