From dbaa5d0bdf7684b3e6aeea7d6bb139c6ede3f2a7 Mon Sep 17 00:00:00 2001 From: Alex Bain Date: Fri, 21 Apr 2017 09:28:02 -0700 Subject: [PATCH] Disable invalid check for completely sparse batch that results in failed assertion for issue #1827 (#2213) --- src/data/simple_csr_source.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/simple_csr_source.cc b/src/data/simple_csr_source.cc index 78f14f360..1a8bd419e 100644 --- a/src/data/simple_csr_source.cc +++ b/src/data/simple_csr_source.cc @@ -41,7 +41,12 @@ void SimpleCSRSource::CopyFrom(dmlc::Parser* parser) { if (batch.weight != nullptr) { info.weights.insert(info.weights.end(), batch.weight, batch.weight + batch.size); } - CHECK(batch.index != nullptr); + // Remove the assertion on batch.index, which can be null in the case that the data in this + // batch is entirely sparse. Although it's true that this indicates a likely issue with the + // user's data workflows, passing XGBoost entirely sparse data should not cause it to fail. + // See https://github.com/dmlc/xgboost/issues/1827 for complete detail. + // CHECK(batch.index != nullptr); + // update information this->info.num_row += batch.size; // copy the data over