Skip to content

Commit

Permalink
perf: reduce total_num_tiles_q by one (#644)
Browse files Browse the repository at this point in the history
The bound can be reduced by one to slightly decrease workspace memory
usage.
  • Loading branch information
nandor authored Dec 4, 2024
1 parent b577710 commit 553ace5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/flashinfer/attention/scheduler.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ inline auto PrefillSplitQOKVIndptr(IdType* qo_indptr_h, IdType* kv_indptr_h,
// number of rows and the batch size. The sum of qo lengths rounded
// up to cta_tile_q will not exceed this number derived from the total
// number of rows.
total_num_tiles_q = ceil_div(total_num_rows, cta_tile_q) + batch_size;
total_num_tiles_q = ceil_div(total_num_rows, cta_tile_q) + batch_size - 1;
} else {
int64_t sum_packed_qo_len = 0;
for (uint32_t i = 0; i < batch_size; ++i) {
Expand Down

0 comments on commit 553ace5

Please sign in to comment.