More quantile refactoring#12049
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request removes the sorted sketching functionality from XGBoost, simplifying the quantile sketching implementation by standardizing on the row-wise host sketching approach.
Changes:
- Removes
SortedQuantileandSortedSketchContainerclasses from the quantile sketching implementation - Simplifies function signatures by removing the
sorted_sketchparameter fromSketchOnDMatrixandGHistIndexMatrixconstructors - Removes tests for sorted sketching variants and cleans up code formatting
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/common/quantile.h | Removes SortedQuantile and SortedSketchContainer classes; refactors Queue struct to use std::pair and std::vector directly; adds helper methods Size(), SetSize(), Clear(), and SetFromSorted() to WQSummary |
| src/common/quantile.cc | Removes SortedSketchContainer::PushColPage implementation; updates references to use new Size() method instead of current_elements |
| src/common/hist_util.h | Removes use_sorted parameter from SketchOnDMatrix function signature |
| src/common/hist_util.cc | Simplifies SketchOnDMatrix implementation to only use HostSketchContainer; removes conditional logic for sorted vs unsorted sketching |
| src/data/gradient_index.h | Removes sorted_sketch parameter from GHistIndexMatrix constructor |
| src/data/gradient_index.cc | Removes sorted_sketch parameter and related comments; updates constructor implementation |
| src/data/simple_dmatrix.cc | Removes sorted_sketch variable and parameter from GHistIndexMatrix construction |
| src/data/sparse_page_dmatrix.cc | Removes sorted_sketch variable and parameter from SketchOnDMatrix call |
| tests/cpp/common/test_quantile.cc | Removes sorted sketching test cases and template parameters; simplifies test functions |
| tests/cpp/common/test_hist_util.cc | Removes sorted sketching test variants; updates function calls to remove parameters |
| tests/cpp/data/test_gradient_index.cc | Updates function calls to remove sorted_sketch parameter; reformats include statements |
| tests/cpp/data/test_sparse_page_dmatrix.cc | Updates SketchOnDMatrix call to remove parameter |
| tests/cpp/common/test_column_matrix.cc | Updates GHistIndexMatrix constructor calls to remove parameter |
| tests/cpp/tree/hist/test_histogram.cc | Updates SketchOnDMatrix call to remove parameter |
| tests/cpp/tree/hist/test_evaluate_splits.cc | Updates GHistIndexMatrix constructor calls and reformats code for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
After benchmarking, I think the performance reduction of around 50% is too high, so I will just refactor instead and we can remove if/when approx gets removed. |
This reverts commit 2262827.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.