Remove reintroduced GPU sketch memory estimation#12159
Merged
RAMitchell merged 1 commit intodmlc:masterfrom Apr 13, 2026
Merged
Remove reintroduced GPU sketch memory estimation#12159RAMitchell merged 1 commit intodmlc:masterfrom
RAMitchell merged 1 commit intodmlc:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the accidentally reintroduced GPU sketch memory-estimation code path and restores a fixed 64M-element sliding-window batching policy for GPU sketching.
Changes:
- Deleted memory-estimation helpers/APIs (
RequiredMemory,SketchBatchNumElements, batch-size override plumbing) and reverted to a fixeddetail::kSketchBatchNumElementswindow size. - Updated GPU sketching implementations to use fixed-window batching (including more robust last-window sizing for adapter sketching).
- Removed the estimator-specific batch override test and updated hessian-sketch tests to match the simplified API.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/common/hist_util.cuh |
Removes estimator-related declarations/API surface; introduces fixed batch constant; simplifies DeviceSketch*/AdapterDeviceSketch interfaces. |
src/common/hist_util.cu |
Deletes estimator implementations and uses fixed batch size in DeviceSketchWithHessian batching loop. |
tests/cpp/common/test_hist_util.cu |
Removes batch-override test coverage and updates call sites to the new fixed-batch API. |
Comments suppressed due to low confidence (1)
src/common/hist_util.cuh:369
- The comment mentions an "estimation of
sketch_batch_num_elements" assuming dense input, butsketch_batch_num_elementsis now a fixed constant (clamped to remaining). Update the wording to refer to the dense assumption used when computingapprox_n_samples, or remove the outdated phrasing to avoid confusion.
// Re-estimate the needed number of cuts based on the size of the sub-batch.
//
// The estimation of `sketch_batch_num_elements` assumes dense input, so the
// approximation here is reasonably accurate. It doesn't hurt accuracy since the
// estimated n_samples must be greater or equal to the actual n_samples thanks to the
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
trivialfis
approved these changes
Apr 13, 2026
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.
Summary
This removes the GPU sketch memory-estimation path that was accidentally reintroduced after
#12118.The GPU sketch batching policy goes back to the fixed
64Msliding-window size:RequiredMemory(...)SketchBatchNumElements(...)DeviceSketch*/AdapterDeviceSketchWhat Changed
src/common/hist_util.cuhandsrc/common/hist_util.cudetail::kSketchBatchNumElementstests/cpp/common/test_hist_util.cuDeviceSketchWithHessian(...)no longer depends oninfo.num_nonzero_for loop progressAdapterDeviceSketch(...)sizes the last window from the true remaining elementsTesting
testxgboostwith CUDAResult:
66/66passed