Skip to content

[EM] By pass device copy if the page fits into device memory. #11477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2025

Conversation

trivialfis
Copy link
Member

No description provided.

@trivialfis
Copy link
Member Author

cc @rongou

@trivialfis trivialfis requested a review from Copilot May 22, 2025 20:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds logic to skip device copy when an Ellpack page already resides fully in device memory, marks MemCostBytes as [[nodiscard]], and introduces a new test to verify accessor behavior.

  • Implement skip-copy branch in EllpackHostCacheStreamImpl::Read
  • Add [[nodiscard]] attribute to MemCostBytes declaration and definition
  • Add EllpackHostCacheTest.Accessor to cover on-device and host+device scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/cpp/data/test_extmem_quantile_dmatrix.cu New test for verifying device-only and hybrid accessors
src/data/ellpack_page_source.cu Added on_device check to bypass unnecessary copies
src/data/ellpack_page.cuh Marked MemCostBytes as [[nodiscard]]
src/data/ellpack_page.cu Updated MemCostBytes definition with [[nodiscard]]
Comments suppressed due to low confidence (1)

src/data/ellpack_page_source.cu:234

  • [nitpick] Consider renaming on_device to a more descriptive name like is_fully_on_device_page to clarify that the entire page resides in device memory.
bool on_device = h_page->gidx_buffer.empty() && !d_page->empty();

@trivialfis trivialfis merged commit 1daba2a into dmlc:master May 23, 2025
61 checks passed
@trivialfis trivialfis deleted the ext-device-page branch May 23, 2025 06:15
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Jun 4, 2025
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.

2 participants