Skip to content

Commit dd01e4b

Browse files
ShvetsKSSHVETS, KIRILL
andauthored
Distributed optimizations for 'hist' method with CPUs (#5557)
Co-authored-by: SHVETS, KIRILL <[email protected]>
1 parent e21a608 commit dd01e4b

File tree

4 files changed

+450
-93
lines changed

4 files changed

+450
-93
lines changed

src/tree/updater_prune.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "xgboost/json.h"
1515
#include "./param.h"
1616
#include "../common/io.h"
17-
17+
#include "../common/timer.h"
1818
namespace xgboost {
1919
namespace tree {
2020

@@ -25,6 +25,7 @@ class TreePruner: public TreeUpdater {
2525
public:
2626
TreePruner() {
2727
syncher_.reset(TreeUpdater::Create("sync", tparam_));
28+
pruner_monitor_.Init("TreePruner");
2829
}
2930
char const* Name() const override {
3031
return "prune";
@@ -52,6 +53,7 @@ class TreePruner: public TreeUpdater {
5253
void Update(HostDeviceVector<GradientPair> *gpair,
5354
DMatrix *p_fmat,
5455
const std::vector<RegTree*> &trees) override {
56+
pruner_monitor_.Start("PrunerUpdate");
5557
// rescale learning rate according to size of trees
5658
float lr = param_.learning_rate;
5759
param_.learning_rate = lr / trees.size();
@@ -60,6 +62,7 @@ class TreePruner: public TreeUpdater {
6062
}
6163
param_.learning_rate = lr;
6264
syncher_->Update(gpair, p_fmat, trees);
65+
pruner_monitor_.Stop("PrunerUpdate");
6366
}
6467

6568
private:
@@ -105,6 +108,7 @@ class TreePruner: public TreeUpdater {
105108
std::unique_ptr<TreeUpdater> syncher_;
106109
// training parameter
107110
TrainParam param_;
111+
common::Monitor pruner_monitor_;
108112
};
109113

110114
XGBOOST_REGISTER_TREE_UPDATER(TreePruner, "prune")

0 commit comments

Comments
 (0)