How dmlc/xgboost works
XGBoost is a portable gradient-boosting library. The principal workflow is: a Python, JVM, R, or C user supplies tabular data; bindings create matrix representations; the learner computes objectives and metrics while fitting tree or linear boosters; the predictor returns scores, explanations, or serialized models. Distributed Dask/Spark execution, external-memory data, categorical features, checkpointing, and CPU/CUDA/SYCL execution are represented as branches. Some relationships rely on documented capabilities because only sampled source excerpts were available.
Main entry points: c_api.cc C API · learner.cc Learner Orchestrator · model.h Model Persistence · adapter.cc Data Adapters
Components 27
Language Bindings
- Python API
python-package/xgboost/core.py - JVM API
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java - R API
R-package/src/xgboost_R.cc - C API
src/c_api/c_api.cc - Dask Spark Adapters
python-package/xgboost/dask/__init__.py - Spark Adapter
python-package/xgboost/spark/estimator.py
Data Layer
- Data Adapters
src/data/adapter.cc - DMatrix Storage
src/data/simple_dmatrix.cc - External Memory
src/data/extmem_quantile_dmatrix.cc - Categorical Data
src/data/cat_container.cc
Training Core
- Learner Orchestrator
src/learner.cc - Objectives
src/objective/objective.cc - Evaluation Metrics
src/metric/metric.cc - Boosting Models
src/gbm/gbm.cc
Inference Models
- Predictor
src/predictor/predictor.cc - SHAP Explanations
src/predictor/interpretability/shap.cc - Model Persistence
include/xgboost/model.h
Scale Runtime
- Distributed Collective
src/collective/comm.cc - Device Context
src/context.cc - SYCL Devices
plugin/sycl/device_manager.cc - Checkpoint Manager
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/ExternalCheckpointManager.java
Other components
- Model Artifacts
- Python User
- JVM User
- R User
- C User
- Distributed Runtime
Connections 27
- Python User → Python API: calls
- JVM User → JVM API: calls
- R User → R API: calls
- C User → C API: calls
- Dask Spark Adapters → Python API: orchestrates
- Spark Adapter → JVM API: orchestrates
- Python API → C API: calls
- JVM API → C API: calls
- R API → C API: calls
- C API → Data Adapters: creates data
- Data Adapters → DMatrix Storage: builds matrix
- Data Adapters → External Memory: streams pages
- DMatrix Storage → Categorical Data: stores categories
- C API → Learner Orchestrator: trains model
- C API → Predictor: requests scores
- Learner Orchestrator → Objectives: computes gradients
- Learner Orchestrator → Boosting Models: fits booster
- Learner Orchestrator → Evaluation Metrics: evaluates rounds
- Learner Orchestrator → Distributed Collective: synchronizes
- Predictor → SHAP Explanations: computes explanations
- Learner Orchestrator → Model Persistence: saves model
- Model Persistence → Model Artifacts: writes model
- Model Artifacts → Model Persistence: reads model
- Checkpoint Manager → Model Persistence: loads checkpoints
- Checkpoint Manager → Model Artifacts: writes checkpoints
- Distributed Runtime → Distributed Collective: provides ranks
- Device Context → SYCL Devices: selects queues