Skip to content

Commit 74be90d

Browse files
authored
[backport] Avoid implicit synchronization in evaluation. (dmlc#11542) (dmlc#11580)
1 parent 04988b1 commit 74be90d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tree/gpu_hist/evaluate_splits.cu

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class EvaluateSplitAgent {
114114
for (int scan_begin = gidx_begin; scan_begin < gidx_end; scan_begin += kBlockSize) {
115115
bool thread_active = (scan_begin + threadIdx.x) < gidx_end;
116116
GradientPairInt64 bin = thread_active ? LoadGpair(node_histogram + scan_begin + threadIdx.x)
117-
: GradientPairInt64();
117+
: GradientPairInt64();
118118
#if CUB_VERSION >= 300000
119119
BlockScanT(temp_storage->scan).ExclusiveScan(bin, bin, cuda::std::plus{}, prefix_op);
120120
#else
@@ -142,6 +142,8 @@ class EvaluateSplitAgent {
142142
best_split->Update(gain, missing_left ? kLeftDir : kRightDir, fvalue, fidx, left, right,
143143
false, param, rounding);
144144
}
145+
146+
__syncwarp();
145147
}
146148
}
147149

@@ -172,6 +174,8 @@ class EvaluateSplitAgent {
172174
best_split->UpdateCat(gain, missing_left ? kLeftDir : kRightDir,
173175
static_cast<bst_cat_t>(fvalue), fidx, left, right, param, rounding);
174176
}
177+
178+
__syncwarp();
175179
}
176180
}
177181
/**
@@ -200,6 +204,8 @@ class EvaluateSplitAgent {
200204
best_split->UpdateCat(gain, missing_left ? kLeftDir : kRightDir, best_thresh, fidx, left_sum,
201205
right_sum, param, rounding);
202206
}
207+
208+
__syncwarp();
203209
}
204210
/**
205211
* \brief Partition-based split for categorical feature.

0 commit comments

Comments
 (0)