Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: fix the bug in pdf_to_cdf device function that causes hang when n_bins > TPB && n_bins % TPB != 0 #3921

Merged
Merged
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
5 changes: 3 additions & 2 deletions cpp/src/decisiontree/batched-levelalgo/kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ DI DataT pdf_to_cdf(DataT* pdf_shist, DataT* cdf_shist, IdxT nbins) {
// variable to accumulate aggregate of sumscans of previous iterations
DataT total_aggregate = DataT(0);

for (IdxT tix = threadIdx.x; tix < max(TPB, nbins); tix += blockDim.x) {
for (IdxT tix = threadIdx.x; tix < raft::ceildiv(nbins, TPB) * TPB;
tix += blockDim.x) {
DataT result;
DataT block_aggregate;
// getting the scanning element from pdf shist only
Expand All @@ -380,8 +381,8 @@ DI DataT pdf_to_cdf(DataT* pdf_shist, DataT* cdf_shist, IdxT nbins) {
// store the result in cdf shist
if (tix < nbins) {
cdf_shist[tix] = result + total_aggregate;
total_aggregate += block_aggregate;
}
total_aggregate += block_aggregate;
}
// return the total sum
return total_aggregate;
Expand Down