[mt] Unify the quantisers.#12048
Conversation
There was a problem hiding this comment.
Pull request overview
This PR unifies the gradient quantiser implementation to support distributed training for multi-output models. The changes introduce a new GradientQuantiserGroup class that replaces the previous MultiGradientQuantiser and provides both device-side access (via DeviceSpan()) and host-side access (via operator[]) to quantisers. The implementation moves quantiser construction logic into a new quantiser.cu file and optimizes distributed training by batching multiple collective operations together.
Changes:
- Introduced unified
GradientQuantiserGroupclass replacingMultiGradientQuantiserwith dual host/device access - Moved quantiser implementation to new
quantiser.cufile with optimized collective operations for distributed training - Updated all quantiser access patterns from
.Quantizers()to.DeviceSpan()for device access andoperator[]for host access - Modified distributed training check to allow distributed training for non-vector-leaf cases
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tree/gpu_hist/quantiser.cuh | Defines new unified GradientQuantiserGroup class with host/device dual interface |
| src/tree/gpu_hist/quantiser.cu | New file containing quantiser implementation with batched collective operations for distributed training |
| src/tree/gpu_hist/histogram.cu | Removed quantiser implementation code (moved to quantiser.cu) |
| src/tree/updater_gpu_hist.cu | Updated single-target quantiser usage to use new GradientQuantiserGroup with operator[] for host access |
| src/tree/updater_gpu_hist.cuh | Updated multi-target quantiser usage and relaxed distributed training restriction to allow non-vector-leaf cases |
| tests/cpp/tree/gpu_hist/test_sampler.cu | Updated test to use new DeviceSpan() API |
| tests/cpp/tree/gpu_hist/test_histogram.cu | Updated tests to use GradientQuantiserGroup with both host and device access patterns |
| tests/cpp/tree/gpu_hist/test_evaluate_splits.cu | Updated test helper to construct quantiser via GradientQuantiserGroup |
| tests/cpp/tree/gpu_hist/dummy_quantizer.cuh | Updated test utilities to use GradientQuantiserGroup |
| src/predictor/interpretability/shap.cu | Minor cleanup to suppress unused parameter warning |
Comments suppressed due to low confidence (1)
src/tree/gpu_hist/quantiser.cu:51
- The LaTeX equation syntax in the documentation comment uses
@begin{equation}and@end{equation}, which is not standard Doxygen syntax. Doxygen typically uses\f[and\f]for display equations or\f$for inline equations. Consider changing to\f[and\f]to ensure the equation renders correctly in generated documentation.
* @begin{equation}
* max( fl(\sum^{V}_{v_i>0}{v_i}), fl(\sum^{V}_{v_i<0}|v_i|) )
* @end{equation}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
cc @rongou |
ref #9043