Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz committed Nov 2, 2023
1 parent 2e08a0b commit 44782a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ struct DecoderMultiHeadAttentionKernel {
Store(&smem_O_[qi * kMaxHeadDim + offset.x], cast<float>(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_) {
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 44782a1

Please sign in to comment.