-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
SketchBatchNumElements minor bugs #9716
Copy link
Copy link
Open
Description
-
In xgboost/blob/master/src/common/hist_util.cu, SketchBatchNumElements,
auto avail = dh::AvailableMemory(device) * 0.8;
this is a double, and this function returns size_t.
return value, return std::min(sketch_batch_num_elements, kIntMax); -
In xgboost/blob/master/tests/cpp/common/test_hist_util.cu, TEST(HistUtil, SketchBatchNumElements),
auto avail = static_cast<size_t>(dh::AvailableMemory(device) * 0.8);
this is correct, not double. However, "avail_elem" isn't compared with KIntMax, which can be a very large integer. It causes the following code fails,"ASSERT_EQ(batch, avail_elem);"
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels