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
18713505
Unverified
Commit
18713505
authored
Apr 23, 2024
by
Yohei Kishimoto
Committed by
GitHub
Apr 22, 2024
Browse files
remove unnecessary omp single that cause deadlock (fixes #6273) (#6394)
parent
52441c47
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
src/utils/openmp_wrapper.cpp
src/utils/openmp_wrapper.cpp
+1
-2
tests/python_package_test/test_basic.py
tests/python_package_test/test_basic.py
+10
-0
No files found.
src/utils/openmp_wrapper.cpp
View file @
18713505
...
...
@@ -20,8 +20,7 @@ int OMP_NUM_THREADS() {
default_num_threads
=
LGBM_DEFAULT_NUM_THREADS
;
}
else
{
// otherwise, default to OpenMP-global config
#pragma omp single
{
default_num_threads
=
omp_get_max_threads
();
}
default_num_threads
=
omp_get_max_threads
();
}
// ensure that if LGBM_SetMaxThreads() was ever called, LightGBM doesn't
...
...
tests/python_package_test/test_basic.py
View file @
18713505
...
...
@@ -573,6 +573,16 @@ def test_dataset_construction_overwrites_user_provided_metadata_fields():
np_assert_array_equal
(
dtrain
.
get_field
(
"weight"
),
expected_weight
,
strict
=
True
)
def
test_dataset_construction_with_high_cardinality_categorical_succeeds
():
pd
=
pytest
.
importorskip
(
"pandas"
)
X
=
pd
.
DataFrame
({
"x1"
:
np
.
random
.
randint
(
0
,
5_000
,
10_000
)})
y
=
np
.
random
.
rand
(
10_000
)
ds
=
lgb
.
Dataset
(
X
,
y
,
categorical_feature
=
[
"x1"
])
ds
.
construct
()
assert
ds
.
num_data
()
==
10_000
assert
ds
.
num_feature
()
==
1
def
test_choose_param_value
():
original_params
=
{
"local_listen_port"
:
1234
,
...
...
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