Skip to content

Commit

Permalink
misc:Remove unused k_smem_offset_w update in MLA kernel (#878)
Browse files Browse the repository at this point in the history
The variable `ckv_smem_offset_w` and `kpe_smem_offset_w` are never used
after update in current loop, and they will be redefined and recomputed
in the next loop.I think these are redundant code.
  • Loading branch information
muoshuosha authored Feb 19, 2025
1 parent 68a0378 commit 1605eaa
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions include/flashinfer/attention/mla_fa2.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ __device__ __forceinline__ void load_kv(
warp_idx_in_wg * 4 + lane_idx / 8, 8 * mma_d + lane_idx % 8);
ckv_smem.load_128b_async<SharedMemFillMode::kFillZero>(ckv_smem_offset_w, ckv_ptr,
q < kv_bound);
ckv_smem_offset_w = ckv_smem.template advance_offset_by_column<8>(ckv_smem_offset_w, mma_d);
ckv_ptr += 8 * upcast_size<DTypeKV>();
}

Expand All @@ -220,7 +219,6 @@ __device__ __forceinline__ void load_kv(
warp_idx_in_wg * 4 + lane_idx / 8, 8 * mma_d + lane_idx % 8);
kpe_smem.load_128b_async<SharedMemFillMode::kFillZero>(kpe_smem_offset_w, kpe_ptr,
q < kv_bound);
kpe_smem_offset_w = kpe_smem.template advance_offset_by_column<8>(kpe_smem_offset_w, mma_d);
kpe_ptr += 8 * upcast_size<DTypeKV>();
}
}
Expand All @@ -245,7 +243,6 @@ __device__ __forceinline__ void load_kv(
8 * mma_d + lane_idx % 8);
ckv_smem.load_128b_async<SharedMemFillMode::kFillZero>(ckv_smem_offset_w, ckv_ptr,
q < kv_bound);
ckv_smem_offset_w = ckv_smem.template advance_offset_by_column<8>(ckv_smem_offset_w, mma_d);
ckv_ptr += 8 * upcast_size<DTypeKV>();
}

Expand All @@ -256,7 +253,6 @@ __device__ __forceinline__ void load_kv(
8 * mma_d + lane_idx % 8);
kpe_smem.load_128b_async<SharedMemFillMode::kFillZero>(kpe_smem_offset_w, kpe_ptr,
q < kv_bound);
kpe_smem_offset_w = kpe_smem.template advance_offset_by_column<8>(kpe_smem_offset_w, mma_d);
kpe_ptr += 8 * upcast_size<DTypeKV>();
}
}
Expand Down

0 comments on commit 1605eaa

Please sign in to comment.