Implement double-buffer for ellpack.#11465
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a double-buffer design for Ellpack pages so that external memory can leverage distinct host and device caches with a variant‐based accessor. Key changes include refactoring all direct accessor calls to use a visitor pattern (via Visit/VisitOnHost), updating test files to call GetHostEllpack/GetDeviceEllpack, and introducing a double buffer accessor (DoubleEllpackAccessor).
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/cpp/* | Updated testing code to use Visit and GetHostEllpack |
| src/data/ellpack_page.cuh & related files | Introduced variant-based accessor and double-buffer logic |
| src/tree/updater_gpu_hist.cu | Updated accessor calls via lambdas using the new API |
| src/common/compressed_iterator.h | Extended compressed iterator to support double buffering |
| include/xgboost/base.h | Updated copyright years and minor style adjustments |
Comments suppressed due to low confidence (2)
src/data/ellpack_page.cuh:325
- [nitpick] Consider adding more detailed documentation for the Visit and VisitOnHost methods to clarify the expected callback signature and how both accessor variants are handled.
template <typename Fn> decltype(auto) Visit(Context const* ctx, common::Span<FeatureType const> feature_types, Fn&& fn) const {
src/data/ellpack_page_source.cu:249
- There appears to be an extra semicolon after the call to dst->NullValue(), which can be removed for cleaner code.
auto null = dst->NullValue();;
trivialfis
marked this pull request as ready for review
May 16, 2025 19:50
Member
Author
|
cc @rongou |
rongou
approved these changes
May 16, 2025
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.
This helps us to have the external memory cache in two different places.
todos: