-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Initial support for column-split cpu predictor #8676
Conversation
merging the master branch should fix the CI error. |
if (prev_thread_temp_size < nthread) { | ||
out->resize(nthread, RegTree::FVec()); | ||
// init thread buffers | ||
static void InitThreadTemp(int nthread, std::vector<RegTree::FVec> *out) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an anonymous namespace instead of static if it's not intended to be used outside of the TU.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/predictor/cpu_predictor.cc
Outdated
|
||
CHECK_EQ(model_.param.size_leaf_vector, 0) << "size_leaf_vector is enforced to 0 so far"; | ||
// parallel over local batch | ||
const auto nsize = static_cast<bst_omp_uint>(batch.Size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to set bst_omp...
explicitly, use auto
and ParallelFor
will do the casting:
common::Parallel(n_blocks, n_threads, [&](auto block_id) {}); // auto block_id has the same type as `n_blocks`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
std::vector<RegTree::FVec> feat_vecs_{}; | ||
|
||
std::size_t n_rows_; | ||
std::vector<BitVector::value_type> decision_storage_{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add some comments about the layout of the storage? How to index it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
When data is split by column, produce predictions in two passes by leveraging bit vectors.
Part of #8424