Skip to content

Commit

Permalink
correction on split_value recovery, perform only for secure mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyueXu77 committed Mar 5, 2024
1 parent b1ca59a commit 2ba22dd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/tree/hist/evaluate_splits.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,15 @@ class HistEvaluator {
all_entries[worker * entries.size() + nidx_in_set].split);
}
}
// At this point, all the workers have the best splits for all the nodes
// and workers can recover the actual split value with the split index
// Note that after the recovery, different workers will hold different
// split_value: real value for feature owner, NaN for others
for (std::size_t nidx_in_set = 0; nidx_in_set < entries.size(); ++nidx_in_set) {
if (is_secure_) {
// At this point, all the workers have the best splits for all the nodes
// and workers can recover the actual split value with the split index
// Note that after the recovery, different workers will hold different
// split_value: real value for feature owner, NaN for others
for (std::size_t nidx_in_set = 0; nidx_in_set < entries.size(); ++nidx_in_set) {
auto cut_index = entries[nidx_in_set].split.split_value;
entries[nidx_in_set].split.split_value = cut.Values()[cut_index];
}
}
}
}
Expand Down

0 comments on commit 2ba22dd

Please sign in to comment.