Skip to content

Remove the deprecated gpu_id.#11543

Merged
trivialfis merged 2 commits into
dmlc:masterfrom
trivialfis:remove-gpu-id
Jul 1, 2025
Merged

Remove the deprecated gpu_id.#11543
trivialfis merged 2 commits into
dmlc:masterfrom
trivialfis:remove-gpu-id

Conversation

@trivialfis

Copy link
Copy Markdown
Member

No description provided.

@trivialfis
trivialfis marked this pull request as draft July 1, 2025 12:05
@trivialfis
trivialfis requested a review from Copilot July 1, 2025 13:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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;

@trivialfis
trivialfis marked this pull request as ready for review July 1, 2025 14:38
@trivialfis trivialfis changed the title [WIP] Remove gpu_id. Remove the deprecated gpu_id. Jul 1, 2025
@trivialfis
trivialfis requested a review from hcho3 July 1, 2025 18:43
@trivialfis
trivialfis merged commit c421dd0 into dmlc:master Jul 1, 2025
60 of 61 checks passed
@trivialfis
trivialfis deleted the remove-gpu-id branch July 1, 2025 19:37
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.

3 participants