Add tests for prediction cache. (#7650)
* Extract the test from approx for other tree methods. * Add note on how it works.
This commit is contained in:
@@ -216,6 +216,16 @@ class GloablApproxBuilder {
|
||||
bst_node_t num_leaves = 1;
|
||||
auto expand_set = driver.Pop();
|
||||
|
||||
/**
|
||||
* Note for update position
|
||||
* Root:
|
||||
* Not applied: No need to update position as initialization has got all the rows ordered.
|
||||
* Applied: Update position is run on applied nodes so the rows are partitioned.
|
||||
* Non-root:
|
||||
* Not applied: That node is root of the subtree, same rule as root.
|
||||
* Applied: Ditto
|
||||
*/
|
||||
|
||||
while (!expand_set.empty()) {
|
||||
// candidates that can be further splited.
|
||||
std::vector<CPUExpandEntry> valid_candidates;
|
||||
|
||||
@@ -692,6 +692,9 @@ struct GPUHistMakerDevice {
|
||||
if (GPUExpandEntry::ChildIsValid(param, tree.GetDepth(left_child_nidx),
|
||||
num_leaves)) {
|
||||
monitor.Start("UpdatePosition");
|
||||
// Update position is only run when child is valid, instead of right after apply
|
||||
// split (as in approx tree method). Hense we have the finalise position call
|
||||
// in GPU Hist.
|
||||
this->UpdatePosition(candidate.nid, p_tree);
|
||||
monitor.Stop("UpdatePosition");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user