Skip to content

Commit

Permalink
warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 20, 2024
1 parent bc571c1 commit 8fffe4d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/data/ellpack_page_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ class EllpackFormatPolicy {
using FormatT = EllpackPageRawFormat;

public:
EllpackFormatPolicy() = default;
EllpackFormatPolicy() {
if (!has_hmm_) {
LOG(WARNING) << "CUDA heterogeneous memory management is not available, the overhead for "
"iterating through external memory might be significant.";
} else if (!common::SupportsAts()) {
LOG(WARNING) << "CUDA address translation service is not available, the overhead for "
"iterating through external memory might be significant.";
}
}
// For testing with the HMM flag.
explicit EllpackFormatPolicy(bool has_hmm) : has_hmm_{has_hmm} {}

Expand Down Expand Up @@ -135,6 +143,9 @@ class EllpackMmapStreamPolicy : public F<S> {
bst_idx_t length) const;
};

/**
* @brief Ellpack source with sparse pages as the underlying source.
*/
template <typename F>
class EllpackPageSourceImpl : public PageSourceIncMixIn<EllpackPage, F> {
using Super = PageSourceIncMixIn<EllpackPage, F>;
Expand Down Expand Up @@ -171,6 +182,9 @@ using EllpackPageHostSource =
using EllpackPageSource =
EllpackPageSourceImpl<EllpackMmapStreamPolicy<EllpackPage, EllpackFormatPolicy>>;

/**
* @brief Ellpack source directly interfaces with user-defined iterators.
*/
template <typename FormatCreatePolicy>
class ExtEllpackPageSourceImpl : public ExtQantileSourceMixin<EllpackPage, FormatCreatePolicy> {
using Super = ExtQantileSourceMixin<EllpackPage, FormatCreatePolicy>;
Expand Down Expand Up @@ -201,6 +215,7 @@ class ExtEllpackPageSourceImpl : public ExtQantileSourceMixin<EllpackPage, Forma
info_{info},
ext_info_{std::move(ext_info)},
base_rows_{std::move(base_rows)} {
cuts->SetDevice(ctx->Device());
this->SetCuts(std::move(cuts), ctx->Device());
this->Fetch();
}
Expand Down

0 comments on commit 8fffe4d

Please sign in to comment.