Skip to content

Commit 1e0405e

Browse files
committed
debug.
1 parent a04dc39 commit 1e0405e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

demo/guide-python/external_memory.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def reset(self) -> None:
7575

7676
def main(tmpdir: str) -> xgboost.Booster:
7777
# generate some random data for demo
78-
files = make_batches(1024, 17, 31, tmpdir)
78+
files = make_batches(2 ** 16, 17, 31, tmpdir)
7979
it = Iterator(files)
8080
# For non-data arguments, specify it here once instead of passing them by the `next`
8181
# method.
@@ -85,12 +85,11 @@ def main(tmpdir: str) -> xgboost.Booster:
8585
# Other tree methods including ``hist`` and ``gpu_hist`` also work, see tutorial in
8686
# doc for details.
8787
booster = xgboost.train(
88-
{"tree_method": "approx", "max_depth": 2},
88+
{"tree_method": "gpu_hist", "max_depth": 6, "sampling_method": "gradient_based", "subsample": 0.5},
8989
Xy,
9090
evals=[(Xy, "Train")],
91-
num_boost_round=10,
91+
num_boost_round=2,
9292
)
93-
return booster
9493

9594

9695
if __name__ == "__main__":

src/data/ellpack_page_raw_format.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class EllpackPageRawFormat : public SparsePageFormat<EllpackPage> {
2828
if (!fi->Read(&impl->base_rowid)) {
2929
return false;
3030
}
31+
std::cout << "impl brd:" << impl->base_rowid << std::endl;
3132
return true;
3233
}
3334

@@ -41,6 +42,7 @@ class EllpackPageRawFormat : public SparsePageFormat<EllpackPage> {
4142
bytes += sizeof(impl->is_dense);
4243
fo->Write(impl->row_stride);
4344
bytes += sizeof(impl->row_stride);
45+
std::cout << "write brd:" << impl->base_rowid << std::endl;
4446
CHECK(!impl->gidx_buffer.ConstHostVector().empty());
4547
fo->Write(impl->gidx_buffer.HostVector());
4648
bytes += impl->gidx_buffer.ConstHostSpan().size_bytes() + sizeof(uint64_t);

src/data/ellpack_page_source.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ void EllpackPageSource::Fetch() {
2424
auto *impl = this->page_->Impl();
2525
*impl = EllpackPageImpl(device_, *cuts_, *csr, is_dense_, row_stride_, feature_types_);
2626
page_->SetBaseRowId(csr->base_rowid);
27+
std::cout << "csr br:" << csr->base_rowid << std::endl;
2728
this->WriteCache();
2829
}
2930
}

src/data/sparse_page_source.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class SparsePageSourceImpl : public BatchIteratorImpl<S> {
117117
}
118118
// An heuristic for number of pre-fetched batches. We can make it part of BatchParam
119119
// to let user adjust number of pre-fetched batches when needed.
120-
uint32_t constexpr kPreFetch = 3;
120+
uint32_t constexpr kPreFetch = 1;
121121

122122
size_t n_prefetch_batches = std::min(kPreFetch, n_batches_);
123123
CHECK_GT(n_prefetch_batches, 0) << "total batches:" << n_batches_;
@@ -140,6 +140,7 @@ class SparsePageSourceImpl : public BatchIteratorImpl<S> {
140140

141141
std::uint64_t offset = self->cache_info_->offset.at(fetch_it);
142142
std::uint64_t length = self->cache_info_->bytes.at(fetch_it);
143+
// std::cout << typeid(S).name() << " offset:" << offset << " length:" << length << std::endl;
143144

144145
auto fi = std::make_unique<common::PrivateMmapStream>(n, true, offset, length);
145146
CHECK(fmt->Read(page.get(), fi.get()));

0 commit comments

Comments
 (0)