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
f5dd320e
Unverified
Commit
f5dd320e
authored
Oct 11, 2022
by
Rémy Luciani
Committed by
GitHub
Oct 11, 2022
Browse files
[python-package] add install option to enable printing of time costs (#5497)
parent
8bd5e897
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
python-package/README.rst
python-package/README.rst
+9
-0
python-package/setup.py
python-package/setup.py
+10
-2
No files found.
python-package/README.rst
View file @
f5dd320e
...
@@ -163,6 +163,15 @@ By default, installation in environment with 32-bit Python is prohibited. Howeve
...
@@ -163,6 +163,15 @@ By default, installation in environment with 32-bit Python is prohibited. Howeve
It is **strongly not recommended** to use this version of LightGBM!
It is **strongly not recommended** to use this version of LightGBM!
Build with time costs output
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: sh
pip install lightgbm --install-option=--time-costs
Use this option to make LightGBM output time costs for different internal routines, to investigate and benchmark its performance.
Install from `conda-forge channel <https://anaconda.org/conda-forge/lightgbm>`_
Install from `conda-forge channel <https://anaconda.org/conda-forge/lightgbm>`_
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
...
...
python-package/setup.py
View file @
f5dd320e
...
@@ -27,6 +27,7 @@ LIGHTGBM_OPTIONS = [
...
@@ -27,6 +27,7 @@ LIGHTGBM_OPTIONS = [
(
'hdfs'
,
'h'
,
'Compile HDFS version'
),
(
'hdfs'
,
'h'
,
'Compile HDFS version'
),
(
'bit32'
,
None
,
'Compile 32-bit version'
),
(
'bit32'
,
None
,
'Compile 32-bit version'
),
(
'precompile'
,
'p'
,
'Use precompiled library'
),
(
'precompile'
,
'p'
,
'Use precompiled library'
),
(
'time-costs'
,
None
,
'Output time costs for different internal routines'
),
(
'boost-root='
,
None
,
'Boost preferred installation prefix'
),
(
'boost-root='
,
None
,
'Boost preferred installation prefix'
),
(
'boost-dir='
,
None
,
'Directory with Boost package configuration file'
),
(
'boost-dir='
,
None
,
'Directory with Boost package configuration file'
),
(
'boost-include-dir='
,
None
,
'Directory containing Boost headers'
),
(
'boost-include-dir='
,
None
,
'Directory containing Boost headers'
),
...
@@ -116,7 +117,8 @@ def compile_cpp(
...
@@ -116,7 +117,8 @@ def compile_cpp(
opencl_library
:
Optional
[
str
]
=
None
,
opencl_library
:
Optional
[
str
]
=
None
,
nomp
:
bool
=
False
,
nomp
:
bool
=
False
,
bit32
:
bool
=
False
,
bit32
:
bool
=
False
,
integrated_opencl
:
bool
=
False
integrated_opencl
:
bool
=
False
,
time_costs
:
bool
=
False
)
->
None
:
)
->
None
:
build_dir
=
CURRENT_DIR
/
"build_cpp"
build_dir
=
CURRENT_DIR
/
"build_cpp"
rmtree
(
build_dir
,
ignore_errors
=
True
)
rmtree
(
build_dir
,
ignore_errors
=
True
)
...
@@ -154,6 +156,8 @@ def compile_cpp(
...
@@ -154,6 +156,8 @@ def compile_cpp(
cmake_cmd
.
append
(
"-DUSE_OPENMP=OFF"
)
cmake_cmd
.
append
(
"-DUSE_OPENMP=OFF"
)
if
use_hdfs
:
if
use_hdfs
:
cmake_cmd
.
append
(
"-DUSE_HDFS=ON"
)
cmake_cmd
.
append
(
"-DUSE_HDFS=ON"
)
if
time_costs
:
cmake_cmd
.
append
(
"-DUSE_TIMETAG=ON"
)
if
system
()
in
{
'Windows'
,
'Microsoft'
}:
if
system
()
in
{
'Windows'
,
'Microsoft'
}:
if
use_mingw
:
if
use_mingw
:
...
@@ -241,6 +245,7 @@ class CustomInstall(install):
...
@@ -241,6 +245,7 @@ class CustomInstall(install):
self
.
mpi
=
False
self
.
mpi
=
False
self
.
hdfs
=
False
self
.
hdfs
=
False
self
.
precompile
=
False
self
.
precompile
=
False
self
.
time_costs
=
False
self
.
nomp
=
False
self
.
nomp
=
False
self
.
bit32
=
False
self
.
bit32
=
False
...
@@ -259,7 +264,8 @@ class CustomInstall(install):
...
@@ -259,7 +264,8 @@ class CustomInstall(install):
use_hdfs
=
self
.
hdfs
,
boost_root
=
self
.
boost_root
,
boost_dir
=
self
.
boost_dir
,
use_hdfs
=
self
.
hdfs
,
boost_root
=
self
.
boost_root
,
boost_dir
=
self
.
boost_dir
,
boost_include_dir
=
self
.
boost_include_dir
,
boost_librarydir
=
self
.
boost_librarydir
,
boost_include_dir
=
self
.
boost_include_dir
,
boost_librarydir
=
self
.
boost_librarydir
,
opencl_include_dir
=
self
.
opencl_include_dir
,
opencl_library
=
self
.
opencl_library
,
opencl_include_dir
=
self
.
opencl_include_dir
,
opencl_library
=
self
.
opencl_library
,
nomp
=
self
.
nomp
,
bit32
=
self
.
bit32
,
integrated_opencl
=
self
.
integrated_opencl
)
nomp
=
self
.
nomp
,
bit32
=
self
.
bit32
,
integrated_opencl
=
self
.
integrated_opencl
,
time_costs
=
self
.
time_costs
)
install
.
run
(
self
)
install
.
run
(
self
)
if
LOG_PATH
.
is_file
():
if
LOG_PATH
.
is_file
():
LOG_PATH
.
unlink
()
LOG_PATH
.
unlink
()
...
@@ -285,6 +291,7 @@ class CustomBdistWheel(bdist_wheel):
...
@@ -285,6 +291,7 @@ class CustomBdistWheel(bdist_wheel):
self
.
mpi
=
False
self
.
mpi
=
False
self
.
hdfs
=
False
self
.
hdfs
=
False
self
.
precompile
=
False
self
.
precompile
=
False
self
.
time_costs
=
False
self
.
nomp
=
False
self
.
nomp
=
False
self
.
bit32
=
False
self
.
bit32
=
False
...
@@ -307,6 +314,7 @@ class CustomBdistWheel(bdist_wheel):
...
@@ -307,6 +314,7 @@ class CustomBdistWheel(bdist_wheel):
install
.
mpi
=
self
.
mpi
install
.
mpi
=
self
.
mpi
install
.
hdfs
=
self
.
hdfs
install
.
hdfs
=
self
.
hdfs
install
.
precompile
=
self
.
precompile
install
.
precompile
=
self
.
precompile
install
.
time_costs
=
self
.
time_costs
install
.
nomp
=
self
.
nomp
install
.
nomp
=
self
.
nomp
install
.
bit32
=
self
.
bit32
install
.
bit32
=
self
.
bit32
...
...
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