From 44782a1c03700eea414b29a13b9a534f88523745 Mon Sep 17 00:00:00 2001 From: Li Zhang Date: Thu, 2 Nov 2023 04:24:35 +0000 Subject: [PATCH] fix typo --- .../kernels/decoder_multihead_attention/array_ops.h | 2 +- .../decoder_multihead_attention_template.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/turbomind/kernels/decoder_multihead_attention/array_ops.h b/src/turbomind/kernels/decoder_multihead_attention/array_ops.h index 209da7e71d..4885284a54 100644 --- a/src/turbomind/kernels/decoder_multihead_attention/array_ops.h +++ b/src/turbomind/kernels/decoder_multihead_attention/array_ops.h @@ -146,7 +146,7 @@ struct LogNScaling { return 1.f; } else { - return log2(seq_len) / log2(max_position_embeddings); + return log2f(seq_len) / log2f(max_position_embeddings); } } diff --git a/src/turbomind/kernels/decoder_multihead_attention/decoder_multihead_attention_template.h b/src/turbomind/kernels/decoder_multihead_attention/decoder_multihead_attention_template.h index ae82a8b786..7844232045 100644 --- a/src/turbomind/kernels/decoder_multihead_attention/decoder_multihead_attention_template.h +++ b/src/turbomind/kernels/decoder_multihead_attention/decoder_multihead_attention_template.h @@ -289,8 +289,8 @@ struct DecoderMultiHeadAttentionKernel { Store(&smem_O_[qi * kMaxHeadDim + offset.x], cast(frag_V)); } - auto farg_K_store = conv_k_store_(frag_K); - auto farg_V_store = conv_v_store_(frag_V); + auto frag_K_store = conv_k_store_(frag_K); + auto frag_V_store = conv_v_store_(frag_V); // store if (warp_id_ == 0 && is_gqa_leader_) { @@ -304,12 +304,12 @@ struct DecoderMultiHeadAttentionKernel { + kv_head_idx_ * params_.kv_cache_block_size * kHeadDim; v_cache_ = (Tkv*)v_cache_ptrs_[block_index] + params_.layer_offset + kv_head_idx_ * params_.kv_cache_block_size * kHeadDim; - Store(&k_cache_[block_offset * kHeadDim + offset.x], farg_K_store); - Store(&v_cache_[block_offset * kHeadDim + offset.x], farg_V_store); + Store(&k_cache_[block_offset * kHeadDim + offset.x], frag_K_store); + Store(&v_cache_[block_offset * kHeadDim + offset.x], frag_V_store); } else { - Store(&k_cache_[timestep_ * kHeadDim + offset.x], farg_K_store); - Store(&v_cache_[timestep_ * kHeadDim + offset.x], farg_V_store); + Store(&k_cache_[timestep_ * kHeadDim + offset.x], frag_K_store); + Store(&v_cache_[timestep_ * kHeadDim + offset.x], frag_V_store); } } }