Skip to content

[PRACTICE] Add parallel training to BaggingTrainer#1

Closed
mattsgarlata wants to merge 3 commits intomainfrom
parallel-training-clean
Closed

[PRACTICE] Add parallel training to BaggingTrainer#1
mattsgarlata wants to merge 3 commits intomainfrom
parallel-training-clean

Conversation

@mattsgarlata
Copy link
Copy Markdown
Member

PRACTICE PR

Verifying we have exactly 1 commit before submitting to oracle/tribuo.

Should show commit: 8f76e13

Changes

  • Add parallel training support to BaggingTrainer
  • Defaults to single-threaded (backward compatible)
  • 8.6x speedup on M4 Max with 16 cores

Craigacp and others added 2 commits November 10, 2025 14:45
* Bumping XGBoost to 2.1.3

* Moving to XGBoost 3.0.4 for compatibility.

* Pom file updates to latest versions of Maven plugins.

* Force XGBoost to save in ubj format, which has been the default since XGBoost 2.1.

* Moving from Java 24 to Java 25 in the CI and adding a Linux aarch64 runner.

* Adding libomp to macOS github actions.

* Adding libomp install to the 21 and 25 macOS CI runs.
Implement parallel training for ensemble models using individual task
submission for optimal load balancing across threads. Each model is
submitted as a separate task to the executor, allowing threads to grab
work as they become available.

- Add configurable thread count (numThreads parameter)
- Defaults to single-threaded (backward compatible)
- Set numThreads=-1 to use all available processors
- Use MIN_PRIORITY threads to avoid starving user-facing operations
- Maintain reproducibility through pre-generated random seeds
- Fall back to sequential training for single-threaded execution

Performance testing shows 7-10x speedup with 16 threads on typical
workloads, demonstrating substantial benefit from parallelization.
@mattsgarlata mattsgarlata force-pushed the parallel-training-clean branch 2 times, most recently from 7b56ffe to 083c077 Compare November 15, 2025 14:07
Added testBaggingParallel() method to exercise the parallel training
codepath. The test creates a BaggingTrainer with 2 threads and is
integrated into testDenseData(), testSparseData(), and
testSparseBinaryData() test methods.
@mattsgarlata mattsgarlata deleted the parallel-training-clean branch November 18, 2025 10:28
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.

2 participants