Skip to content

Commit 0180c55

Browse files
committed
Disable invalid check for completely sparse batch that results in failed assertion for issue dmlc#1827
1 parent e38bea3 commit 0180c55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/data/simple_csr_source.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ void SimpleCSRSource::CopyFrom(dmlc::Parser<uint32_t>* parser) {
4141
if (batch.weight != nullptr) {
4242
info.weights.insert(info.weights.end(), batch.weight, batch.weight + batch.size);
4343
}
44-
CHECK(batch.index != nullptr);
44+
// Remove the assertion on batch.index, which can be null in the case that the data in this
45+
// batch is entirely sparse. Although it's true that this indicates a likely issue with the
46+
// user's data workflows, passing XGBoost entirely sparse data should not cause it to fail.
47+
// See https://github.com/dmlc/xgboost/issues/1827 for complete detail.
48+
// CHECK(batch.index != nullptr);
49+
4550
// update information
4651
this->info.num_row += batch.size;
4752
// copy the data over

0 commit comments

Comments
 (0)