Skip to content

Commit f25ff07

Browse files
Fix swapped arguments from Dao-AILab#2448
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
1 parent de933da commit f25ff07

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

csrc/flash_attn/flash_api_torch_lib.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ mha_varlen_fwd(at::Tensor &q, // total_q x num_heads x head_size, total_q := \s
3535
int window_size_right,
3636
const float softcap,
3737
const bool return_softmax,
38-
int num_splits,
39-
std::optional<at::Generator> gen_);
38+
std::optional<at::Generator> gen_,
39+
int num_splits = 0);
4040

4141
std::vector<at::Tensor>
4242
mha_fwd_kvcache(at::Tensor &q, // batch_size x seqlen_q x num_heads x head_size
@@ -110,7 +110,7 @@ TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
110110
"Tensor cu_seqlens_k, Tensor? seqused_k, Tensor? leftpad_k, Tensor? block_table, Tensor? alibi_slopes, "
111111
"int max_seqlen_q, int max_seqlen_k, float p_dropout, float softmax_scale, bool zero_tensors, "
112112
"bool is_causal, int window_size_left, int window_size_right, float softcap, bool return_softmax, "
113-
"int num_splits, Generator? gen) -> Tensor[]");
113+
"Generator? gen, int num_splits=0) -> Tensor[]");
114114
ops.impl("varlen_fwd", torch::kCUDA, make_pytorch_shim(&mha_varlen_fwd));
115115

116116
ops.def("fwd_kvcache(Tensor! q, Tensor kcache, Tensor vcache, Tensor? k, Tensor? v, Tensor? seqlens_k, "

0 commit comments

Comments
 (0)