Support multiple batches in gpu_hist (#5014)
* Initial external memory training support for GPU Hist tree method.
This commit is contained in:
@@ -166,6 +166,15 @@ struct BatchParam {
|
||||
int max_bin;
|
||||
/*! \brief Number of rows in a GPU batch, used for finding quantiles on GPU. */
|
||||
int gpu_batch_nrows;
|
||||
/*! \brief Page size for external memory mode. */
|
||||
size_t gpu_page_size;
|
||||
|
||||
inline bool operator!=(const BatchParam& other) const {
|
||||
return gpu_id != other.gpu_id ||
|
||||
max_bin != other.max_bin ||
|
||||
gpu_batch_nrows != other.gpu_batch_nrows ||
|
||||
gpu_page_size != other.gpu_page_size;
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -21,6 +21,8 @@ struct GenericParameter : public XGBoostParameter<GenericParameter> {
|
||||
int nthread;
|
||||
// primary device, -1 means no gpu.
|
||||
int gpu_id;
|
||||
// gpu page size in external memory mode, 0 means using the default.
|
||||
size_t gpu_page_size;
|
||||
|
||||
void CheckDeprecated() {
|
||||
if (this->n_gpus != 0) {
|
||||
@@ -49,6 +51,10 @@ struct GenericParameter : public XGBoostParameter<GenericParameter> {
|
||||
.set_default(-1)
|
||||
.set_lower_bound(-1)
|
||||
.describe("The primary GPU device ordinal.");
|
||||
DMLC_DECLARE_FIELD(gpu_page_size)
|
||||
.set_default(0)
|
||||
.set_lower_bound(0)
|
||||
.describe("GPU page size when running in external memory mode.");
|
||||
DMLC_DECLARE_FIELD(n_gpus)
|
||||
.set_default(0)
|
||||
.set_range(0, 1)
|
||||
|
||||
Reference in New Issue
Block a user