Skip to content

Conversation

@trivialfis
Copy link
Member

No description provided.

@trivialfis trivialfis requested a review from Copilot August 11, 2025 11:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds error handling to throw an error when a DMatrix is empty in a distributed setting with categorical features. The change prevents issues that could arise when some workers have empty input while others have categorical data, which would make category inference impossible.

  • Added validation to check for empty DMatrix when categorical features are present in distributed settings
  • Refactored Dask utilities to move version checking functions to a separate module
  • Updated tests to expect the new validation error rather than proceeding with empty data

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/data/cat_container.cc Implements the core validation logic that throws an error when any worker has empty input with categorical features
src/data/cat_container.h Adds function declaration for the new validation function
src/data/*.cc (multiple) Integrates the validation check across different DMatrix implementations
tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py Updates test to expect ValueError when training with empty DMatrix
python-package/xgboost/dask/utils.py Moves Dask version checking utilities to separate module
python-package/xgboost/dask/init.py Imports version checking functions from the new utils location

trivialfis and others added 2 commits August 11, 2025 19:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@trivialfis
Copy link
Member Author

cc @rongou .

@trivialfis trivialfis merged commit 26856a8 into dmlc:master Aug 12, 2025
63 of 66 checks passed
@trivialfis trivialfis deleted the enc-empty-dmatrix branch August 12, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants