Repository navigation
perf: skip unsampled histogram bins and accelerate small-batch prediction - #177
Merged
Merged
Conversation
brndnmtthws
marked this pull request as ready for review
October 22, 2026 14:26
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Two targeted CPU optimizations, with the existing numerical contracts intact:
No SIMD changes, floating-point reassociation, public configuration changes or model-format changes. Default full-feature training is not the target of the histogram optimization.
Before / after
Baseline: f6c5d8f (v0.4.1).
Rust 1.99.1 / LLVM 23.1.1, release profile, default features, no extra RUSTFLAGS.
Shared virtualized x86-64 cloud host exposing AMD EPYC 9V74 and nine logical CPUs. This is not a dedicated 80-core host, and these results do not generalize to other hardware.
Medians from serial baseline/candidate/candidate/baseline runs, ten samples per binary. Each process discards a warmup. Small-batch samples average 1,000 calls. Full raw samples, min/max ranges, binary hashes and reproduction instructions are in the benchmark report.
Synthetic deterministic regression data, depth 6, 256 bins, eta=0.1. Small-batch models train on 10k×30 rows. Warm training reuses cached bins; cold includes DMatrix construction and binning. Prediction excludes model training and lazy layout construction. Serialized-model and prediction checksums agree across both binaries, every repeat and thread count.
Controls and limitations
Full-feature training and 16-row batches are near parity. Initial four-thread large-batch prediction and 80%-feature training runs were noisy and showed overlapping slowdowns. Both initial results are retained. A 50-sample-per-binary follow-up gave:
No large-batch prediction win is claimed. Broad-pool training is less stable than the 25%-feature case. Missing-data fallback is also measured in the full report. Single-row APIs already used RowForest, so this does not claim to speed those up. An eight-lane x86 batch-walk experiment regressed and was dropped.
Validation
RAYON_NUM_THREADS=4 cargo test --profile ci --all-features; five intentionally ignored tests remain ignored.GPU-dependent tests skip without a usable device. No actual GPU execution, Arm runtime measurement, Python-extension rebuild or external XGBoost/LightGBM fixture generation was done locally. CI passed all 25 jobs on published head
a74a7ec35e1fea7c2b82971ad1378bfb7432047c, including Rust tests on x86 Linux/Arm Linux/macOS, MSRV, semver compatibility, XGBoost/LightGBM parity, Python wheels and sdist, CUDA build checks, and fuzz smoke.