[backport] CI fixes (#6933)
* Relax shotgun test. (#6900) It's non-deterministic algorithm, the test is flaky. * Disable pylint error. (#6911) * [CI] Skip external memory gtest on osx. (#6901) * [CI] Fix custom metric test with empty dataset. (#6917) * Reduce Travis environment setup time. (#6912) * Remove unused r from travis. * Don't update homebrew. * Don't install indirect/unused dependencies like libgit2, wget, openssl. * Move graphviz installation to conda. * Relax shotgun test. (#6918) * Relax test for decision stump in distributed environment. (#6919) * Backport cupy fix.
This commit is contained in:
parent
a6d1fbf8d1
commit
96f8843694
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@ -31,7 +31,10 @@ jobs:
|
|||||||
- name: Run gtest binary
|
- name: Run gtest binary
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
ctest --exclude-regex AllTestsInDMLCUnitTests --extra-verbose
|
# libomp internal error:
|
||||||
|
# OMP: Error #131: Thread identifier invalid.
|
||||||
|
./testxgboost --gtest_filter="-HistIndexCreationWithExternalMemory.Test"
|
||||||
|
ctest -R TestXGBoostCLI --extra-verbose
|
||||||
|
|
||||||
gtest-cpu-nonomp:
|
gtest-cpu-nonomp:
|
||||||
name: Test Google C++ unittest (CPU Non-OMP)
|
name: Test Google C++ unittest (CPU Non-OMP)
|
||||||
|
|||||||
12
.travis.yml
12
.travis.yml
@ -19,18 +19,10 @@ jobs:
|
|||||||
env: TASK=java_test
|
env: TASK=java_test
|
||||||
|
|
||||||
# dependent brew packages
|
# dependent brew packages
|
||||||
|
# the dependencies from homebrew is installed manually from setup script due to outdated image from travis.
|
||||||
addons:
|
addons:
|
||||||
homebrew:
|
homebrew:
|
||||||
packages:
|
update: false
|
||||||
- cmake
|
|
||||||
- libomp
|
|
||||||
- graphviz
|
|
||||||
- openssl
|
|
||||||
- libgit2
|
|
||||||
- lz4
|
|
||||||
- wget
|
|
||||||
- r
|
|
||||||
update: true
|
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- snapd
|
- snapd
|
||||||
|
|||||||
@ -1872,7 +1872,9 @@ class Booster(object):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
return _prediction_output(shape, dims, preds, False)
|
return _prediction_output(shape, dims, preds, False)
|
||||||
if lazy_isinstance(data, "cupy.core.core", "ndarray"):
|
if lazy_isinstance(data, "cupy.core.core", "ndarray") or lazy_isinstance(
|
||||||
|
data, "cupy._core.core", "ndarray"
|
||||||
|
):
|
||||||
from .data import _transform_cupy_array
|
from .data import _transform_cupy_array
|
||||||
data = _transform_cupy_array(data)
|
data = _transform_cupy_array(data)
|
||||||
interface = data.__cuda_array_interface__
|
interface = data.__cuda_array_interface__
|
||||||
@ -2027,7 +2029,7 @@ class Booster(object):
|
|||||||
"""
|
"""
|
||||||
if isinstance(fout, (STRING_TYPES, os.PathLike)):
|
if isinstance(fout, (STRING_TYPES, os.PathLike)):
|
||||||
fout = os.fspath(os.path.expanduser(fout))
|
fout = os.fspath(os.path.expanduser(fout))
|
||||||
fout = open(fout, 'w')
|
fout = open(fout, 'w') # pylint: disable=consider-using-with
|
||||||
need_close = True
|
need_close = True
|
||||||
else:
|
else:
|
||||||
need_close = False
|
need_close = False
|
||||||
|
|||||||
@ -15,6 +15,7 @@ dependencies:
|
|||||||
- matplotlib
|
- matplotlib
|
||||||
- dask
|
- dask
|
||||||
- distributed
|
- distributed
|
||||||
|
- graphviz
|
||||||
- python-graphviz
|
- python-graphviz
|
||||||
- hypothesis
|
- hypothesis
|
||||||
- astroid
|
- astroid
|
||||||
|
|||||||
@ -57,15 +57,13 @@ class TestLinear:
|
|||||||
param['updater'] = 'shotgun'
|
param['updater'] = 'shotgun'
|
||||||
param = dataset.set_params(param)
|
param = dataset.set_params(param)
|
||||||
result = train_result(param, dataset.get_dmat(), num_rounds)['train'][dataset.metric]
|
result = train_result(param, dataset.get_dmat(), num_rounds)['train'][dataset.metric]
|
||||||
# shotgun is non-deterministic, so we relax the test by sampling
|
# shotgun is non-deterministic, so we relax the test by only using first and last
|
||||||
# result.
|
# iteration.
|
||||||
if len(result) > 2:
|
if len(result) > 2:
|
||||||
sampled_result = [score for i, score in enumerate(result)
|
sampled_result = (result[0], result[-1])
|
||||||
if i % 2 == 0]
|
|
||||||
sampled_result[-1] = result[-1] # make sure the last one is used
|
|
||||||
else:
|
else:
|
||||||
sampled_result = result
|
sampled_result = result
|
||||||
assert tm.non_increasing(sampled_result, 1e-3)
|
assert tm.non_increasing(sampled_result)
|
||||||
|
|
||||||
@given(parameter_strategy, strategies.integers(10, 50),
|
@given(parameter_strategy, strategies.integers(10, 50),
|
||||||
tm.dataset_strategy, strategies.floats(1e-5, 2.0),
|
tm.dataset_strategy, strategies.floats(1e-5, 2.0),
|
||||||
|
|||||||
@ -1023,7 +1023,17 @@ class TestWithDask:
|
|||||||
evals=[(m, 'train')])['history']
|
evals=[(m, 'train')])['history']
|
||||||
note(history)
|
note(history)
|
||||||
history = history['train'][dataset.metric]
|
history = history['train'][dataset.metric]
|
||||||
assert tm.non_increasing(history)
|
|
||||||
|
def is_stump():
|
||||||
|
return params["max_depth"] == 1 or params["max_leaves"] == 1
|
||||||
|
|
||||||
|
def minimum_bin():
|
||||||
|
return "max_bin" in params and params["max_bin"] == 2
|
||||||
|
|
||||||
|
if minimum_bin() and is_stump():
|
||||||
|
assert tm.non_increasing(history, tolerance=1e-3)
|
||||||
|
else:
|
||||||
|
assert tm.non_increasing(history)
|
||||||
# Make sure that it's decreasing
|
# Make sure that it's decreasing
|
||||||
assert history[-1] < history[0]
|
assert history[-1] < history[0]
|
||||||
|
|
||||||
|
|||||||
@ -272,6 +272,8 @@ def eval_error_metric(predt, dtrain: xgb.DMatrix):
|
|||||||
label = dtrain.get_label()
|
label = dtrain.get_label()
|
||||||
r = np.zeros(predt.shape)
|
r = np.zeros(predt.shape)
|
||||||
gt = predt > 0.5
|
gt = predt > 0.5
|
||||||
|
if predt.size == 0:
|
||||||
|
return "CustomErr", 0
|
||||||
r[gt] = 1 - label[gt]
|
r[gt] = 1 - label[gt]
|
||||||
le = predt <= 0.5
|
le = predt <= 0.5
|
||||||
r[le] = label[le]
|
r[le] = label[le]
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
make -f dmlc-core/scripts/packages.mk lz4
|
|
||||||
|
|
||||||
source $HOME/miniconda/bin/activate
|
source $HOME/miniconda/bin/activate
|
||||||
|
|
||||||
if [ ${TASK} == "python_sdist_test" ]; then
|
if [ ${TASK} == "python_sdist_test" ]; then
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/27
|
||||||
|
brew install cmake libomp lz4
|
||||||
|
|
||||||
|
|
||||||
if [ ${TASK} == "python_test" ] || [ ${TASK} == "python_sdist_test" ]; then
|
if [ ${TASK} == "python_test" ] || [ ${TASK} == "python_sdist_test" ]; then
|
||||||
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
|
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
|
||||||
wget --no-verbose -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
|
wget --no-verbose -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user