Skip to content

Commit 40f7736

Browse files
authored
[https://nvbugs/5344910][fix] Corrected memory position when setting buffers to 0 in standalone_stable_radix_topk_ (NVIDIA#6712)
Signed-off-by: Stefan Niebler <[email protected]>
1 parent 09038be commit 40f7736

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/tensorrt_llm/kernels/topkLastDim.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,8 @@ void standalone_stable_radix_topk_(void* buf, size_t& buf_size, T const* in, Idx
12751275
sort_in = static_cast<decltype(sort_in)>(aligned_pointers[9]);
12761276
sort_in_idx = static_cast<decltype(sort_in_idx)>(aligned_pointers[10]);
12771277
}
1278-
cudaMemsetAsync(
1279-
buf, 0, static_cast<char*>(aligned_pointers[2]) - static_cast<char*>(aligned_pointers[0]), stream);
1278+
cudaMemsetAsync(aligned_pointers[0], 0,
1279+
static_cast<char*>(aligned_pointers[2]) - static_cast<char*>(aligned_pointers[0]), stream);
12801280
}
12811281

12821282
T const* in_buf = nullptr;

0 commit comments

Comments
 (0)