update with new rabit api
This commit is contained in:
parent
25cf27d50f
commit
cd2bce4719
@ -17,8 +17,8 @@ cd -
|
|||||||
python splitrows.py ../../demo/regression/machine.txt.train train-machine $k
|
python splitrows.py ../../demo/regression/machine.txt.train train-machine $k
|
||||||
|
|
||||||
# run xgboost mpi
|
# run xgboost mpi
|
||||||
../../rabit/tracker/rabit_mpi.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=3 eval_train=1
|
../../subtree/rabit/tracker/rabit_demo.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=3 eval_train=1
|
||||||
|
|
||||||
# run xgboost-mpi save model 0001, continue to run from existing model
|
# run xgboost-mpi save model 0001, continue to run from existing model
|
||||||
../../rabit/tracker/rabit_mpi.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=1
|
../../subtree/rabit/tracker/rabit_demo.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=1
|
||||||
../../rabit/tracker/rabit_mpi.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=2 model_in=0001.model
|
../../subtree/rabit/tracker/rabit_demo.py -n $k ../../xgboost machine-row.conf dsplit=row num_round=2 model_in=0001.model
|
||||||
|
|||||||
@ -205,8 +205,8 @@ struct GradStats {
|
|||||||
this->Add(b.sum_grad, b.sum_hess);
|
this->Add(b.sum_grad, b.sum_hess);
|
||||||
}
|
}
|
||||||
/*! \brief same as add, reduce is used in All Reduce */
|
/*! \brief same as add, reduce is used in All Reduce */
|
||||||
inline void Reduce(const GradStats &b) {
|
inline static void Reduce(GradStats &a, const GradStats &b) {
|
||||||
this->Add(b);
|
a.Add(b);
|
||||||
}
|
}
|
||||||
/*! \brief set current value to a - b */
|
/*! \brief set current value to a - b */
|
||||||
inline void SetSubstract(const GradStats &a, const GradStats &b) {
|
inline void SetSubstract(const GradStats &a, const GradStats &b) {
|
||||||
@ -285,8 +285,8 @@ struct CVGradStats : public GradStats {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*! \brief same as add, reduce is used in All Reduce */
|
/*! \brief same as add, reduce is used in All Reduce */
|
||||||
inline void Reduce(const CVGradStats &b) {
|
inline static void Reduce(CVGradStats &a, const CVGradStats &b) {
|
||||||
this->Add(b);
|
a.Add(b);
|
||||||
}
|
}
|
||||||
/*! \brief set current value to a - b */
|
/*! \brief set current value to a - b */
|
||||||
inline void SetSubstract(const CVGradStats &a, const CVGradStats &b) {
|
inline void SetSubstract(const CVGradStats &a, const CVGradStats &b) {
|
||||||
@ -368,8 +368,8 @@ struct SplitEntry{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*! \brief same as update, used by AllReduce*/
|
/*! \brief same as update, used by AllReduce*/
|
||||||
inline void Reduce(const SplitEntry &e) {
|
inline static void Reduce(SplitEntry &dst, const SplitEntry &src) {
|
||||||
this->Update(e);
|
dst.Update(src);
|
||||||
}
|
}
|
||||||
/*!\return feature index to split on */
|
/*!\return feature index to split on */
|
||||||
inline unsigned split_index(void) const {
|
inline unsigned split_index(void) const {
|
||||||
|
|||||||
@ -155,7 +155,7 @@ class DistColMaker : public ColMaker<TStats> {
|
|||||||
private:
|
private:
|
||||||
utils::BitMap bitmap;
|
utils::BitMap bitmap;
|
||||||
std::vector<int> boolmap;
|
std::vector<int> boolmap;
|
||||||
rabit::Reducer<SplitEntry> reducer;
|
rabit::Reducer<SplitEntry, SplitEntry::Reduce> reducer;
|
||||||
};
|
};
|
||||||
// we directly introduce pruner here
|
// we directly introduce pruner here
|
||||||
TreePruner pruner;
|
TreePruner pruner;
|
||||||
|
|||||||
@ -117,7 +117,7 @@ class HistMaker: public BaseMaker {
|
|||||||
// workspace of thread
|
// workspace of thread
|
||||||
ThreadWSpace wspace;
|
ThreadWSpace wspace;
|
||||||
// reducer for histogram
|
// reducer for histogram
|
||||||
rabit::Reducer<TStats> histred;
|
rabit::Reducer<TStats, TStats::Reduce> histred;
|
||||||
// set of working features
|
// set of working features
|
||||||
std::vector<bst_uint> fwork_set;
|
std::vector<bst_uint> fwork_set;
|
||||||
// update function implementation
|
// update function implementation
|
||||||
|
|||||||
@ -147,7 +147,7 @@ class TreeRefresher: public IUpdater {
|
|||||||
// training parameter
|
// training parameter
|
||||||
TrainParam param;
|
TrainParam param;
|
||||||
// reducer
|
// reducer
|
||||||
rabit::Reducer<TStats> reducer;
|
rabit::Reducer<TStats, TStats::Reduce> reducer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tree
|
} // namespace tree
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user