From 0439b4a1d63f4ae8585e2c544435811ad2cd9b2a Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Thu, 5 Dec 2024 15:01:21 +0800 Subject: [PATCH] Freeze dask version. --- python-package/xgboost/compat.py | 2 +- tests/ci_build/conda_env/linux_sycl_test.yml | 2 +- tests/python-sycl/test_sycl_simple_dask.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python-package/xgboost/compat.py b/python-package/xgboost/compat.py index bcd3d8d4ee54..f3f8705b97d9 100644 --- a/python-package/xgboost/compat.py +++ b/python-package/xgboost/compat.py @@ -161,4 +161,4 @@ def concat(value: Sequence[_T]) -> _T: # pylint: disable=too-many-return-statem d_v = arr.device.id assert d_v == d, "Concatenating arrays on different devices." return cupy.concatenate(value, axis=0) - raise TypeError("Unknown type.") + raise TypeError(f"Unknown type: {type(value[0])}") diff --git a/tests/ci_build/conda_env/linux_sycl_test.yml b/tests/ci_build/conda_env/linux_sycl_test.yml index 5b3a15f7e3b1..bec01c4f95fc 100644 --- a/tests/ci_build/conda_env/linux_sycl_test.yml +++ b/tests/ci_build/conda_env/linux_sycl_test.yml @@ -17,7 +17,7 @@ dependencies: - pytest - pytest-timeout - pytest-cov -- dask +- dask=2024.11 - dpcpp_linux-64 - onedpl-devel - intel-openmp diff --git a/tests/python-sycl/test_sycl_simple_dask.py b/tests/python-sycl/test_sycl_simple_dask.py index 19eebebee3e5..2d302573ecd1 100644 --- a/tests/python-sycl/test_sycl_simple_dask.py +++ b/tests/python-sycl/test_sycl_simple_dask.py @@ -1,8 +1,6 @@ from xgboost import dask as dxgb from xgboost import testing as tm -from hypothesis import given, strategies, assume, settings, note - import dask.array as da import dask.distributed @@ -32,10 +30,12 @@ def test_simple(self): param["objective"] = "reg:squarederror" # X and y must be Dask dataframes or arrays - num_obs = 1e4 + num_obs = int(1e4) num_features = 20 - X = da.random.random(size=(num_obs, num_features), chunks=(1000, num_features)) - y = da.random.random(size=(num_obs, 1), chunks=(1000, 1)) + + rng = da.random.RandomState(1994) + X = rng.random_sample((num_obs, num_features), chunks=(1000, -1)) + y = X.sum(axis=1) dtrain = dxgb.DaskDMatrix(client, X, y) result = train_result(client, param, dtrain, 10)