Fix multi-GPU test failures (#4259)

This commit is contained in:
Rory Mitchell
2019-03-15 14:40:43 +13:00
committed by GitHub
parent 4352fcdb15
commit 5465b73e7c

View File

@@ -201,10 +201,11 @@ class GPUCoordinateUpdater : public LinearUpdater {
monitor_.Stop("LazyInitShards");
monitor_.Start("UpdateGpair");
auto &in_gpair_host = in_gpair->ConstHostVector();
// Update gpair
dh::ExecuteIndexShards(&shards_, [&](int idx, std::unique_ptr<DeviceShard>& shard) {
if (!shard->IsEmpty()) {
shard->UpdateGpair(in_gpair->ConstHostVector(), model->param);
shard->UpdateGpair(in_gpair_host, model->param);
}
});
monitor_.Stop("UpdateGpair");