Skip to content

[MT] Support distributed training and the Dask interface.#12292

Merged
trivialfis merged 14 commits into
dmlc:masterfrom
trivialfis:mt-distributed
Jul 9, 2026
Merged

[MT] Support distributed training and the Dask interface.#12292
trivialfis merged 14 commits into
dmlc:masterfrom
trivialfis:mt-distributed

Conversation

@trivialfis

@trivialfis trivialfis commented Jul 8, 2026

Copy link
Copy Markdown
Member

ref: #9043

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

Adds distributed-training support for multi-target (“vector leaf”) hist training (including Dask) by introducing the needed collective reductions for node/leaf statistics and expanding test coverage for both CPU and GPU Dask workflows.

Changes:

  • Add new Dask test helpers and new CPU/GPU distributed Dask tests for multi_output_tree with a value-gradient objective (reg:absoluteerror).
  • Enable distributed multi-target hist training by globally reducing multi-target root/leaf sums and ensuring histograms are allreduced where required.
  • Introduce a dedicated Hypothesis strategy (hist_multi_parameter_strategy) usage in distributed Dask test suites.

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/test_distributed/test_with_dask/test_with_dask.py Adds CPU Dask multi-target hist property test + targeted absolute-error and sklearn-style smoke tests.
tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py Adds GPU Dask multi-target hist property test + targeted absolute-error and sklearn-style smoke tests (guarded by CuPy availability).
src/tree/updater_quantile_hist.cc Adds collective reduction for multi-target leaf sums (and extra sanity checks) to support distributed vector-leaf training.
src/tree/updater_gpu_hist.cuh Adds collective reductions and required histogram allreduces for multi-target GPU hist, enabling distributed vector-leaf training.
python-package/xgboost/testing/dask.py Adds shared Dask helpers to generate multi-output regression data and validate multi_output_tree training/prediction/config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trivialfis
trivialfis requested a review from RAMitchell July 8, 2026 18:41

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread src/objective/adaptive.h

@RAMitchell RAMitchell 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.

Just curious, can scalar leaf training be implemented as a base case of vector leaf training? I don't like having two builder implementations.

Comment thread src/objective/adaptive.h Outdated
Comment thread src/objective/adaptive.h
Comment thread src/objective/adaptive.h Outdated
if (tree.IsMultiTarget()) {
tree.SetLeaves(h_node_idx, common::Span{quantiles});
} else {
for (size_t i = 0; i < nidx.size(); ++i) {

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.

i here also

Comment thread src/tree/updater_gpu_hist.cuh
@trivialfis

trivialfis commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Just curious, can scalar leaf training be implemented as a base case of vector leaf training?

Yes. For now, I would like to keep them separate. We have different evaluators, different tree model formats, etc. I omitted some optimizations for the vector leaf to keep things simple and would like to use it as a base for the CV implementation without breaking or regressing the scalar leaf.

@RAMitchell

Copy link
Copy Markdown
Member

I think life will be easier if you finish this before implementing CV.

@trivialfis

Copy link
Copy Markdown
Member Author

I think life will be easier if you finish this before implementing CV.

No, then I will have to run benchmarks to avoid regression for every change.

@trivialfis

Copy link
Copy Markdown
Member Author

My current WIP CV implementation does use the multi-target code base uniformly with single-target as a trivial case. But unifying the code with the existing scalar leaf would be a huge refactoring effort that I would like to defer until everything is inplace.

@trivialfis trivialfis mentioned this pull request Jul 9, 2026
48 tasks
@RAMitchell

Copy link
Copy Markdown
Member

No, then I will have to run benchmarks to avoid regression for every change.

Don't you need to do this eventually?

You are currently building a large disruptive feature on top of another disruptive unfinished feature that might still need to change. Is it the most efficient way to work?

I won't stop you but just something to think about.

@trivialfis

Copy link
Copy Markdown
Member Author

Don't you need to do this eventually?

Yes, but with a clear picture of everything, and can omit benchmarks that don't necessarily matter for the final state.

You are currently building a large disruptive feature on top of another disruptive unfinished feature that might still need to change. Is it the most efficient way to work?

  1. The PR series ([MT]) intends to make it complete and finished.
  2. The vector leaf code is actually leaner and makes things easier for me to modify. You see, it doesn't have special optimizations to skip partitioning; it doesn't have column splitting, and it doesn't support federated learning.

I won't stop you but just something to think about.

Thank you for this. Yes, I care deeply about the state of the code.

@trivialfis
trivialfis merged commit ec5977f into dmlc:master Jul 9, 2026
97 of 98 checks passed
@trivialfis
trivialfis deleted the mt-distributed branch July 9, 2026 14:15
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