Skip to content

More quantile refactoring#12049

Merged
RAMitchell merged 11 commits into
dmlc:masterfrom
RAMitchell:quantile-refactor-followup
Mar 3, 2026
Merged

More quantile refactoring#12049
RAMitchell merged 11 commits into
dmlc:masterfrom
RAMitchell:quantile-refactor-followup

Conversation

@RAMitchell

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SortedQuantile and SortedSketchContainer classes from the quantile sketching implementation
  • Simplifies function signatures by removing the sorted_sketch parameter from SketchOnDMatrix and GHistIndexMatrix constructors
  • 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.

@RAMitchell

Copy link
Copy Markdown
Member Author

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.

@RAMitchell RAMitchell changed the title Remove sorted sketching More quantile refactoring Mar 1, 2026
@RAMitchell
RAMitchell requested a review from Copilot March 1, 2026 16:15
@RAMitchell
RAMitchell marked this pull request as ready for review March 1, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/common/quantile.h Outdated
Comment thread src/common/quantile.h Outdated
Comment thread src/common/quantile.h Outdated
@RAMitchell
RAMitchell requested a review from trivialfis March 2, 2026 12:46
@RAMitchell
RAMitchell merged commit 14ccf33 into dmlc:master Mar 3, 2026
123 of 125 checks passed
@RAMitchell
RAMitchell deleted the quantile-refactor-followup branch March 3, 2026 09:11
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.

3 participants