Skip to content
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

Distributed optimizations #5557

Merged
merged 13 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/tree/updater_prune.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "xgboost/json.h"
#include "./param.h"
#include "../common/io.h"

#include "../common/timer.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want you can put the pruning into pre-pruning (don't grow the tree if criteria is not met) in the future to get rid of this pruner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only wanted to track 'hidden' time.

namespace xgboost {
namespace tree {

Expand All @@ -25,6 +25,7 @@ class TreePruner: public TreeUpdater {
public:
TreePruner() {
syncher_.reset(TreeUpdater::Create("sync", tparam_));
pruner_monitor_.Init("TreePruner");
}
char const* Name() const override {
return "prune";
Expand Down Expand Up @@ -52,6 +53,7 @@ class TreePruner: public TreeUpdater {
void Update(HostDeviceVector<GradientPair> *gpair,
DMatrix *p_fmat,
const std::vector<RegTree*> &trees) override {
pruner_monitor_.Start("PrunerUpdate");
// rescale learning rate according to size of trees
float lr = param_.learning_rate;
param_.learning_rate = lr / trees.size();
Expand All @@ -60,6 +62,7 @@ class TreePruner: public TreeUpdater {
}
param_.learning_rate = lr;
syncher_->Update(gpair, p_fmat, trees);
pruner_monitor_.Stop("PrunerUpdate");
}

private:
Expand Down Expand Up @@ -105,6 +108,7 @@ class TreePruner: public TreeUpdater {
std::unique_ptr<TreeUpdater> syncher_;
// training parameter
TrainParam param_;
common::Monitor pruner_monitor_;
};

XGBOOST_REGISTER_TREE_UPDATER(TreePruner, "prune")
Expand Down
Loading