Skip to content
Open
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
5 changes: 3 additions & 2 deletions csrc/models/llama/llama_attention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ infinicore::Tensor LlamaAttention::forward_(const infinicore::Tensor &hidden_sta
}

infinicore::Tensor attn_output;
if (false) {
// experimental nineoothed flash attention
if (q_reshaped->device().getType() == infinicore::Device::Type::NVIDIA
|| q_reshaped->device().getType() == infinicore::Device::Type::ILUVATAR
|| q_reshaped->device().getType() == infinicore::Device::Type::CAMBRICON) {
attn_output = infinicore::op::flash_attention(q_reshaped, k_total, v_total, total_sequence_lengths.value(), scaling_, true);
attn_output = attn_output->permute({0, 2, 1, 3})
->contiguous()
Expand Down
2 changes: 1 addition & 1 deletion python/infinilm/infer_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def forward(
past_kv_lengths._underlying if past_kv_lengths is not None else None
)
total_kv_lengths = (
total_kv_lengths._underlying if past_kv_lengths is not None else None
total_kv_lengths._underlying if total_kv_lengths is not None else None
)
input_offsets = input_offsets._underlying if input_offsets is not None else None
block_tables = block_tables._underlying if block_tables is not None else None
Expand Down