Skip to content

Commit 72172d6

Browse files
authored
Temporarily disables Split-KV feature
2 parents f006b7a + f25f6ef commit 72172d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

csrc/flash_api.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ std::tuple<at::Tensor, at::Tensor> set_params_splitkv(
255255
TORCH_CHECK(params.num_splits <= 128, "num_splits > 128 not supported");
256256
}
257257

258+
// Temporarily disable Split-KV, because some bugs are still being fixed.
259+
// See: https://github.com/SmallDoges/flash-dmattn/issues/47
260+
// Regardless of how it is set externally, always set num_splits back to 1.
261+
// This is to avoid the extra memory overhead of Split-KV.
262+
params.num_splits = 1;
263+
softmax_lse_accum.reset();
264+
out_accum.reset();
265+
258266
return std::make_tuple(softmax_lse_accum, out_accum);
259267
}
260268

0 commit comments

Comments
 (0)