-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
[enc] Throw error when DMatrix is empty. #11628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
cc @rongou . |
This reverts commit 8e8a8f5.
No description provided.