-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dab1382
commit bc571c1
Showing
4 changed files
with
44 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright 2024, XGBoost Contributors | ||
*/ | ||
#pragma once | ||
|
||
#include "xgboost/data.h" // for BatchParam | ||
|
||
namespace xgboost::data::cuda_impl { | ||
// Use two batch for prefecting. There's always one batch being worked on, while the other | ||
// batch being transferred. | ||
constexpr auto DftPrefetchBatches() { return 2; } | ||
|
||
// Empty parameter to prevent regen, only used to control external memory prefetching. | ||
// | ||
// Both the approx and hist initializes the DMatrix before creating the actual | ||
// implementation (InitDataOnce). Therefore, the `GPUHistMakerDevice` can use an empty | ||
// parameter to avoid any regen. | ||
inline BatchParam StaticBatch(bool prefetch_copy) { | ||
BatchParam p; | ||
p.prefetch_copy = prefetch_copy; | ||
p.n_prefetch_batches = DftPrefetchBatches(); | ||
return p; | ||
} | ||
} // namespace xgboost::data::cuda_impl |
This file contains 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
This file contains 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
This file contains 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