Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
30be2f1c
Commit
30be2f1c
authored
Oct 23, 2016
by
Guolin Ke
Browse files
change unit size to MB.
parent
31c3a89e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
include/LightGBM/config.h
include/LightGBM/config.h
+1
-1
src/io/config.cpp
src/io/config.cpp
+1
-1
src/treelearner/serial_tree_learner.cpp
src/treelearner/serial_tree_learner.cpp
+1
-2
No files found.
include/LightGBM/config.h
View file @
30be2f1c
...
...
@@ -140,7 +140,7 @@ public:
int
num_leaves
=
127
;
int
feature_fraction_seed
=
2
;
double
feature_fraction
=
1.0
;
// max cache size(unit:
G
B) for historical histogram. < 0 means not limit
// max cache size(unit:
M
B) for historical histogram. < 0 means not limit
double
histogram_pool_size
=
-
1
;
void
Set
(
const
std
::
unordered_map
<
std
::
string
,
std
::
string
>&
params
)
override
;
};
...
...
src/io/config.cpp
View file @
30be2f1c
...
...
@@ -130,7 +130,7 @@ void OverallConfig::CheckParamConflict() {
is_parallel_find_bin
=
true
;
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."
,
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
gbdt_config
->
tree_config
.
histogram_pool_size
=
-
1
;
}
...
...
src/treelearner/serial_tree_learner.cpp
View file @
30be2f1c
...
...
@@ -55,8 +55,7 @@ void SerialTreeLearner::Init(const Dataset* train_data) {
for
(
int
i
=
0
;
i
<
train_data_
->
num_features
();
++
i
)
{
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
max_cache_size
=
Common
::
Max
(
2
,
max_cache_size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment