Remove the deprecated gpu_id.#11543
Merged
Merged
Conversation
trivialfis
marked this pull request as draft
July 1, 2025 12:05
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes support for the deprecated gpu_id parameter in favor of using the device parameter consistently. Key changes include:
- Updating tests to remove usage of gpu_id in favor of device.
- Removing gpu_id from learner configuration and its backward compatibility handling.
- Changing the handling of deprecated gpu_id in context and error reporting, as well as removing gpu_id in the Spark interface.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cpp/gbm/test_gbtree.cc | Updated test cases to use device instead of gpu_id. |
| src/learner.cc | Removed gpu_id from the list of configuration keys. |
| src/context.cc | Adjusted gpu_id handling to only warn via WarnDeprecatedGPUId. |
| src/common/error_msg.cc | Changed the log level for deprecated gpu_id from WARNING to FATAL. |
| python-package/xgboost/spark/core.py | Removed gpu_id from unsupported parameters. |
Comments suppressed due to low confidence (2)
src/context.cc:247
- Deprecated 'gpu_id' is now only warned via WarnDeprecatedGPUId and processing continues. If removal is intended, consider returning immediately or explicitly handling the absence of device to avoid unintended behavior when only gpu_id is provided.
if (has_gpu_id) {
src/common/error_msg.cc:45
- Changing the log level from WARNING to FATAL in WarnDeprecatedGPUId now terminates execution on deprecated usage. Verify that this breaking change is intended and that downstream tests and user expectations have been updated accordingly.
LOG(FATAL) << msg;
hcho3
approved these changes
Jul 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.