Fix #3402: wrong fid crashes distributed algorithm (#3535)

* Fix #3402: wrong fid crashes distributed algorithm

The bug was introduced by the recent DMatrix refactor (#3301). It was partially
fixed by #3408 but the example in #3402 was still failing. The example in #3402
will succeed after this fix is applied.

* Explicitly specify "this" to prevent compile error

* Add regression test

* Add distributed test to Travis matrix

* Install kubernetes Python package as dependency of dmlc tracker

* Add Python dependencies

* Add compile step

* Reduce size of regression test case

* Further reduce size of test
This commit is contained in:
Philip Hyunsu Cho
2018-08-04 19:20:04 -07:00
committed by GitHub
parent 31d1baba3d
commit 7fefd6865d
6 changed files with 100 additions and 2 deletions

View File

@@ -725,9 +725,10 @@ class GlobalProposalHistMaker: public CQHistMaker<TStats> {
const auto nsize = static_cast<bst_omp_uint>(this->work_set_.size());
#pragma omp parallel for schedule(dynamic, 1)
for (bst_omp_uint i = 0; i < nsize; ++i) {
int offset = this->feat2workindex_[this->work_set_[i]];
int fid = this->work_set_[i];
int offset = this->feat2workindex_[fid];
if (offset >= 0) {
this->UpdateHistCol(gpair, batch[i], info, tree,
this->UpdateHistCol(gpair, batch[fid], info, tree,
fset, offset,
&this->thread_hist_[omp_get_thread_num()]);
}