Skip to content

Commit

Permalink
fix_ parallel_tree_learner_split_info
Browse files Browse the repository at this point in the history
#6491 (comment)
This code is used for computing the buffer size of the communicating the split info the in distributed training. But lost the two most recently added parameters(right_sum_gradient_and_hessian, left_sum_gradient_and_hessian) size.
When use parallel_tree_learner method with number of categories of one feature larger than 28 (default max_cat_to_onehot(32)-2*2), it will resut in an Segmentation fault.
  • Loading branch information
moming39 authored Dec 7, 2024
1 parent d4d6c87 commit 8942dac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/treelearner/split_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct SplitInfo {
bool default_left = true;
int8_t monotone_type = 0;
inline static int Size(int max_cat_threshold) {
return 2 * sizeof(int) + sizeof(uint32_t) + sizeof(bool) + sizeof(double) * 7 + sizeof(data_size_t) * 2 + max_cat_threshold * sizeof(uint32_t) + sizeof(int8_t);
return 2 * sizeof(int) + sizeof(uint32_t) + sizeof(bool) + sizeof(double) * 7 + sizeof(data_size_t) * 2 + max_cat_threshold * sizeof(uint32_t) + sizeof(int8_t) + sizeof(int64_t)*2;
}

inline void CopyTo(char* buffer) const {
Expand Down

0 comments on commit 8942dac

Please sign in to comment.