dmlc / dmlc/xgboost

DaskXGBRegressor with tweedie objective throws error when N-chunks = 1

Open
#10,493 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

I've been trying to use Dask to chunk data and train a regressor, but I kept receiving this error when trying out some sample code:

```
xgboost.core.XGBoostError: [15:26:58] /Users/runner/work/xgboost/xgboost/src/objective/regression_obj.cu:528: Check failed: info.labels.Size() != 0U (0 vs. 0) : label set cannot be empty
```

After some experimentation I realised that when I changed the `chunks` in my dask to a smaller size that the full array length, the error would go away.

I've included a snippet which should help recreate the issue:

```python
import distributed
from xgboost import dask as dxgb
import dask.array as da

if __name__ == "__main__":
client = distributed.Client()
samples = 1000
cols = 10

X_train = da.random.random(size=(samples, cols), chunks=1000) # set to

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Python reproducer and DaskXGBRegressor.fit, then trace the empty-label failure to xgboost/src/objective/regression_obj.cu:528. Compare the one-chunk and smaller-chunk cases, including the reg:tweedie objective. Done means the supplied one-chunk example trains successfully without the label-set error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.