Skip to content

[MT] Implement interaction constraints.#12294

Merged
trivialfis merged 1 commit into
dmlc:masterfrom
trivialfis:mt-int-cont
Jul 10, 2026
Merged

[MT] Implement interaction constraints.#12294
trivialfis merged 1 commit into
dmlc:masterfrom
trivialfis:mt-int-cont

Conversation

@trivialfis

@trivialfis trivialfis commented Jul 9, 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

Implements support for interaction constraints when training multi-target (“vector leaf”) models, and extends the Python test suite to exercise this behavior for both CPU and GPU hist updaters.

Changes:

  • Enables interaction constraints for multi-target training by removing prior LOG(FATAL) guards in CPU quantile-hist and GPU hist updaters.
  • Updates multi-target split application to propagate per-node interaction-constraint state during tree growth (CPU and GPU).
  • Adds CPU/GPU Python tests and enhances the shared test helper to generate deterministic multi-target labels and validate output shapes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/python/test_interaction_constraints.py Adds a CPU hist multi-target test case to validate interaction constraints.
tests/python-gpu/test_gpu_interaction_constraints.py Adds a GPU hist multi-target test case to validate interaction constraints.
src/tree/updater_quantile_hist.cc Removes the multi-target “not implemented” fatal for interaction constraints so MT training can proceed.
src/tree/updater_gpu_hist.cuh Resets and updates interaction-constraint state for multi-target GPU hist growth; removes the prior fatal guard.
src/tree/hist/evaluate_splits.h Propagates interaction-constraint state when applying multi-target splits on CPU hist.
python-package/xgboost/testing/interaction_constraints.py Extends the test helper to support multi-target labels and deterministic data generation.

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

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

Looks straightforward. Is there only one test for interaction constraints? Seems a bit light.

"device": device,
}
if n_targets > 1:
params["multi_strategy"] = "multi_output_tree"

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.

Do we also still test the old path?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The old path is just scalar tree, not much to test as trees don't share the structure.

@trivialfis

Copy link
Copy Markdown
Member Author

Looks straightforward. Is there only one test for interaction constraints? Seems a bit light.

We have some C++ tests for the constraint itself, the Python test does the integration test.

@trivialfis
trivialfis merged commit 8110a24 into dmlc:master Jul 10, 2026
83 checks passed
@trivialfis
trivialfis deleted the mt-int-cont branch July 10, 2026 11:26
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