Skip to content

Remove deprecated tree_method=gpu_hist with XGBoost - #7858

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:release/26.04from
chyunsu3:remove_gpu_hist
Mar 20, 2026
Merged

Remove deprecated tree_method=gpu_hist with XGBoost#7858
rapids-bot[bot] merged 2 commits into
NVIDIA:release/26.04from
chyunsu3:remove_gpu_hist

Conversation

@chyunsu3

@chyunsu3 chyunsu3 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Closes #7191

@chyunsu3
chyunsu3 requested review from a team as code owners March 5, 2026 22:26
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Mar 5, 2026
@chyunsu3 chyunsu3 added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change doc Documentation and removed improvement Improvement / enhancement to an existing function labels Mar 5, 2026
@coderabbitai

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated model training configurations in benchmark and demonstration notebooks for improved GPU and CPU device compatibility and resource handling.

Walkthrough

The changes replace deprecated XGBoost tree_method="gpu_hist" parameters with tree_method="hist" and add explicit device configuration ("cuda" or "cpu") across multiple files to align with current XGBoost API standards.

Changes

Cohort / File(s) Summary
XGBoost Configuration in Notebooks
notebooks/target_encoder_walkthrough.ipynb, python/cuml/cuml/experimental/hyperparams/HPO_demo.ipynb
Updated XGBoost parameters from deprecated tree_method="gpu_hist" to tree_method="hist" with explicit device configuration (cuda/cpu) across multiple cells.
XGBoost Configuration in Helper Functions
python/cuml/cuml/benchmark/bench_helper_funcs.py
Updated XGBoost tree_method and device parameters in classifier builder functions to use tree_method="hist" with device="cuda".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: removing deprecated tree_method=gpu_hist usage with XGBoost, which aligns with the changeset modifications across multiple files.
Description check ✅ Passed The description references issue #7191, which directly relates to the changeset's objective of replacing deprecated XGBoost tree_method parameter usage.
Linked Issues check ✅ Passed The PR successfully addresses issue #7191 by replacing all instances of tree_method='gpu_hist' with tree_method='hist' and adding device='cuda' (or device='cpu' for CPU paths) across the three modified files.
Out of Scope Changes check ✅ Passed All changes are scoped to the objective of replacing deprecated tree_method parameter usage; no unrelated modifications are present in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@python/cuml/cuml/experimental/hyperparams/HPO_demo.ipynb`:
- Around line 764-767: The notebook text claims CPU mode runs below 1% but the
code uses the variable data_fraction with a guard data_fraction <= 0.1 (10%);
make them consistent by either updating the explanatory markdown to state "10%"
or changing the conditional to use 0.01 (1%) so the runtime guard matches the
text; locate the check that references data_fraction and the nearby markdown
paragraph describing the CPU threshold and update one of them so both reflect
the same percentage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f6b9a157-07a5-4712-991b-8e2fd5aeac73

📥 Commits

Reviewing files that changed from the base of the PR and between ede20b6 and cea2870.

📒 Files selected for processing (3)
  • notebooks/target_encoder_walkthrough.ipynb
  • python/cuml/cuml/benchmark/bench_helper_funcs.py
  • python/cuml/cuml/experimental/hyperparams/HPO_demo.ipynb

Comment on lines +764 to 767
"Now, running the model in CPU version to notice the difference in performance in terms of time. The main difference you would notice is that the `device` is set to `cpu` instead of `cuda`. The interface remains the same and we can even make use of the same parameters that we defined earlier (in fact, this is necessary for a fair comparison). \n",
"\n",
"Note: Remember the `data_fraction` flag from earlier and we will ensure we only run the CPU version if we are using less than 1% of the data"
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

CPU threshold text is inconsistent with the code guard.

Line 764 says CPU mode should run below 1%, but Line 795 uses data_fraction <= 0.1 (10%). Please align the text or condition to avoid misleading notebook users.

🛠️ Suggested markdown fix
- "Now, running the model in CPU version to notice the difference in performance in terms of time. The main difference you would notice is that the `device` is set to `cpu` instead of `cuda`. The interface remains the same and we can even make use of the same parameters that we defined earlier (in fact, this is necessary for a fair comparison). \n",
+ "Now, running the model in CPU version to notice the difference in performance in terms of time. The main difference you would notice is that the `device` is set to `cpu` instead of `cuda`. The interface remains the same and we can even make use of the same parameters that we defined earlier (in fact, this is necessary for a fair comparison). \n",
- "Note: Remember the `data_fraction` flag from earlier and we will ensure we only run the CPU version if we are using less than 1% of the data"
+ "Note: Remember the `data_fraction` flag from earlier and we will ensure we only run the CPU version if we are using 10% of the data or less"

As per coding guidelines, notebook examples and guidance should remain accurate and aligned with executable behavior.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Now, running the model in CPU version to notice the difference in performance in terms of time. The main difference you would notice is that the `device` is set to `cpu` instead of `cuda`. The interface remains the same and we can even make use of the same parameters that we defined earlier (in fact, this is necessary for a fair comparison). \n",
"\n",
"Note: Remember the `data_fraction` flag from earlier and we will ensure we only run the CPU version if we are using less than 1% of the data"
]
"Now, running the model in CPU version to notice the difference in performance in terms of time. The main difference you would notice is that the `device` is set to `cpu` instead of `cuda`. The interface remains the same and we can even make use of the same parameters that we defined earlier (in fact, this is necessary for a fair comparison). \n",
"\n",
"Note: Remember the `data_fraction` flag from earlier and we will ensure we only run the CPU version if we are using 10% of the data or less"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@python/cuml/cuml/experimental/hyperparams/HPO_demo.ipynb` around lines 764 -
767, The notebook text claims CPU mode runs below 1% but the code uses the
variable data_fraction with a guard data_fraction <= 0.1 (10%); make them
consistent by either updating the explanatory markdown to state "10%" or
changing the conditional to use 0.01 (1%) so the runtime guard matches the text;
locate the check that references data_fraction and the nearby markdown paragraph
describing the CPU threshold and update one of them so both reflect the same
percentage.

@chyunsu3
chyunsu3 changed the base branch from main to release/26.04 March 19, 2026 02:51

@jcrist jcrist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@jcrist

jcrist commented Mar 20, 2026

Copy link
Copy Markdown
Member

/merge

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hey great!!!

@jameslamb
jameslamb removed the request for review from KyleFromNVIDIA March 20, 2026 14:54
@rapids-bot
rapids-bot Bot merged commit 7f0385e into NVIDIA:release/26.04 Mar 20, 2026
93 checks passed
@chyunsu3
chyunsu3 deleted the remove_gpu_hist branch March 23, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue doc Documentation non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA ] Replace deprecated uses of tree_method=gpu_hist with XGBoost

6 participants