From c8f5d190c6b0d444ee71663ce1f053892756345d Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Wed, 24 Jan 2024 22:54:21 -0800 Subject: [PATCH] [CI] Stop Windows pipeline upon a failing pytest (#10003) --- src/data/device_adapter.cuh | 8 +++----- src/data/ellpack_page.cu | 4 ++-- src/data/simple_dmatrix.cuh | 4 ++-- tests/buildkite/test-win64-gpu.ps1 | 2 ++ tests/python-gpu/test_gpu_prediction.py | 1 + tests/python-gpu/test_gpu_with_sklearn.py | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/data/device_adapter.cuh b/src/data/device_adapter.cuh index 67ceb92f2..a5156f585 100644 --- a/src/data/device_adapter.cuh +++ b/src/data/device_adapter.cuh @@ -260,12 +260,10 @@ bool NoInfInData(AdapterBatchT const& batch, IsValidFunctor is_valid) { auto counting = thrust::make_counting_iterator(0llu); auto value_iter = dh::MakeTransformIterator(counting, [=] XGBOOST_DEVICE(std::size_t idx) { auto v = batch.GetElement(idx).value; - if (!is_valid(v)) { - // discard the invalid elements. - return true; + if (is_valid(v) && isinf(v)) { + return false; } - // check that there's no inf in data. - return !std::isinf(v); + return true; }); dh::XGBCachingDeviceAllocator alloc; // The default implementation in thrust optimizes any_of/none_of/all_of by using small diff --git a/src/data/ellpack_page.cu b/src/data/ellpack_page.cu index 44b9c8dd6..c60fe8389 100644 --- a/src/data/ellpack_page.cu +++ b/src/data/ellpack_page.cu @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 by XGBoost contributors + * Copyright 2019-2024, XGBoost contributors */ #include #include @@ -13,7 +13,7 @@ #include "../common/hist_util.cuh" #include "../common/transform_iterator.h" // MakeIndexTransformIter #include "./ellpack_page.cuh" -#include "device_adapter.cuh" // for HasInfInData +#include "device_adapter.cuh" // for NoInfInData #include "ellpack_page.h" #include "gradient_index.h" #include "xgboost/data.h" diff --git a/src/data/simple_dmatrix.cuh b/src/data/simple_dmatrix.cuh index 47d736050..528bea8be 100644 --- a/src/data/simple_dmatrix.cuh +++ b/src/data/simple_dmatrix.cuh @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 by XGBoost Contributors + * Copyright 2019-2024, XGBoost Contributors * \file simple_dmatrix.cuh */ #ifndef XGBOOST_DATA_SIMPLE_DMATRIX_CUH_ @@ -11,7 +11,7 @@ #include "../common/device_helpers.cuh" #include "../common/error_msg.h" // for InfInData -#include "device_adapter.cuh" // for HasInfInData +#include "device_adapter.cuh" // for NoInfInData namespace xgboost::data { diff --git a/tests/buildkite/test-win64-gpu.ps1 b/tests/buildkite/test-win64-gpu.ps1 index fcc6e8436..95a51b502 100644 --- a/tests/buildkite/test-win64-gpu.ps1 +++ b/tests/buildkite/test-win64-gpu.ps1 @@ -32,6 +32,8 @@ Foreach-Object { Write-Host "--- Run Python tests" python -X faulthandler -m pytest -v -s -rxXs --fulltrace tests/python +if ($LASTEXITCODE -ne 0) { throw "Last command failed" } Write-Host "--- Run Python tests with GPU" python -X faulthandler -m pytest -v -s -rxXs --fulltrace -m "(not slow) and (not mgpu)"` tests/python-gpu +if ($LASTEXITCODE -ne 0) { throw "Last command failed" } diff --git a/tests/python-gpu/test_gpu_prediction.py b/tests/python-gpu/test_gpu_prediction.py index ec7c45ca2..a1bc13cb8 100644 --- a/tests/python-gpu/test_gpu_prediction.py +++ b/tests/python-gpu/test_gpu_prediction.py @@ -152,6 +152,7 @@ class TestGPUPredict: @pytest.mark.parametrize("device", ["cpu", "cuda"]) @pytest.mark.skipif(**tm.no_cupy()) + @pytest.mark.skipif(**tm.no_cudf()) def test_inplace_predict_device_type(self, device: str) -> None: """Test inplace predict with different device and data types. diff --git a/tests/python-gpu/test_gpu_with_sklearn.py b/tests/python-gpu/test_gpu_with_sklearn.py index 650c0a047..a01e79ccc 100644 --- a/tests/python-gpu/test_gpu_with_sklearn.py +++ b/tests/python-gpu/test_gpu_with_sklearn.py @@ -249,7 +249,7 @@ def test_custom_objective( clf.fit(X, y) -@pytest.mark.skipif(**tm.no_pandas()) +@pytest.mark.skipif(**tm.no_cudf()) def test_ranking_qid_df(): import cudf