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
7 changes: 2 additions & 5 deletions csrc/smxx/fwd_kernel2.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ __global__ void __launch_bounds__(NumThreads) _flash_kda_fwd_recurrence(
int H,
int N,
int64_t const* cu_seqlens,
int const* tile_prefix,
int total_tiles
) {
using BF16 = cutlass::bfloat16_t;
Expand Down Expand Up @@ -221,11 +222,7 @@ __global__ void __launch_bounds__(NumThreads) _flash_kda_fwd_recurrence(
if constexpr (IsVarlen) {
bos = cu_seqlens[seq_idx];
eos = cu_seqlens[seq_idx + 1];
// Compute tile_base via linear scan (no host-precomputed table)
tile_base = 0;
for (int i = 0; i < seq_idx; i++) {
tile_base += (int(cu_seqlens[i + 1] - cu_seqlens[i]) + CHUNK - 1) / CHUNK;
}
tile_base = tile_prefix[seq_idx];
} else {
int T_seq = T_total / N;
bos = seq_idx * T_seq;
Expand Down
2 changes: 1 addition & 1 deletion csrc/smxx/fwd_launch.cu
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void launch_fwd(
tma_load_initial_state,
tma_store_final_state,
tma_store_out,
out_ptr, T_total, H, N, cu_seqlens_ptr, total_tiles
out_ptr, T_total, H, N, cu_seqlens_ptr, ws_tile_prefix, total_tiles
);
}
#endif
Expand Down