Commit 30be2f1c authored by Guolin Ke's avatar Guolin Ke
Browse files

change unit size to MB.

parent 31c3a89e
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
int num_leaves = 127; int num_leaves = 127;
int feature_fraction_seed = 2; int feature_fraction_seed = 2;
double feature_fraction = 1.0; double feature_fraction = 1.0;
// max cache size(unit:GB) for historical histogram. < 0 means not limit // max cache size(unit:MB) for historical histogram. < 0 means not limit
double histogram_pool_size = -1; double histogram_pool_size = -1;
void Set(const std::unordered_map<std::string, std::string>& params) override; void Set(const std::unordered_map<std::string, std::string>& params) override;
}; };
......
...@@ -130,7 +130,7 @@ void OverallConfig::CheckParamConflict() { ...@@ -130,7 +130,7 @@ void OverallConfig::CheckParamConflict() {
is_parallel_find_bin = true; is_parallel_find_bin = true;
if (gbdt_config->tree_config.histogram_pool_size >= 0) { if (gbdt_config->tree_config.histogram_pool_size >= 0) {
Log::Error("Histogram LRU queue was enabled (histogram_pool_size=%f). Will disable this for reducing communication cost." Log::Error("Histogram LRU queue was enabled (histogram_pool_size=%f). Will disable this for reducing communication cost."
, tree_config.histogram_pool_size); , gbdt_config->tree_config.histogram_pool_size);
// Change pool size to -1(not limit) when using data parallel for reducing communication cost // Change pool size to -1(not limit) when using data parallel for reducing communication cost
gbdt_config->tree_config.histogram_pool_size = -1; gbdt_config->tree_config.histogram_pool_size = -1;
} }
......
...@@ -55,8 +55,7 @@ void SerialTreeLearner::Init(const Dataset* train_data) { ...@@ -55,8 +55,7 @@ void SerialTreeLearner::Init(const Dataset* train_data) {
for (int i = 0; i < train_data_->num_features(); ++i) { for (int i = 0; i < train_data_->num_features(); ++i) {
total_histogram_size += sizeof(HistogramBinEntry) * train_data_->FeatureAt(i)->num_bin(); total_histogram_size += sizeof(HistogramBinEntry) * train_data_->FeatureAt(i)->num_bin();
} }
max_cache_size = static_cast<int>(histogram_pool_size_ * 1024 * 1024 * 1024 / total_histogram_size); max_cache_size = static_cast<int>(histogram_pool_size_ * 1024 * 1024 / total_histogram_size);
} }
// at least need 2 leaves // at least need 2 leaves
max_cache_size = Common::Max(2, max_cache_size); max_cache_size = Common::Max(2, max_cache_size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment