From 3ff2e7c846a23deec74f96aa7dcfca7f575de698 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 26 Sep 2025 12:16:04 -0700 Subject: [PATCH 1/4] Run cudf-polars wheels unit tests with more than 1 process --- ci/run_cudf_polars_pytests.sh | 3 +++ ci/test_python_other.sh | 2 +- ci/test_wheel_cudf_polars.sh | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/run_cudf_polars_pytests.sh b/ci/run_cudf_polars_pytests.sh index 304573d6a85..e7a9837cd66 100755 --- a/ci/run_cudf_polars_pytests.sh +++ b/ci/run_cudf_polars_pytests.sh @@ -18,7 +18,10 @@ python -m pytest --cache-clear "$@" tests --executor streaming python -m pytest --cache-clear "$@" tests --executor streaming --blocksize-mode small # Run experimental tests with Distributed cluster +# Runtime in CI tends to increase when running these tests with multiple processes. +# https://github.com/rapidsai/cudf/pull/19980#issuecomment-3340039980 python -m pytest --cache-clear "$@" "tests/experimental" \ --executor streaming \ --scheduler distributed \ + --numprocesses=0 \ --cov-fail-under=0 # No code-coverage requirement for these tests. diff --git a/ci/test_python_other.sh b/ci/test_python_other.sh index e69fbd52107..dcaa81a1e8b 100755 --- a/ci/test_python_other.sh +++ b/ci/test_python_other.sh @@ -43,7 +43,7 @@ rapids-logger "pytest custreamz" rapids-logger "pytest cudf-polars" ./ci/run_cudf_polars_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cudf-polars.xml" \ - --numprocesses=6 \ + --numprocesses=8 \ --dist=worksteal \ --cov-config=./pyproject.toml \ --cov=cudf_polars \ diff --git a/ci/test_wheel_cudf_polars.sh b/ci/test_wheel_cudf_polars.sh index b2683eeadbc..07ed60e6835 100755 --- a/ci/test_wheel_cudf_polars.sh +++ b/ci/test_wheel_cudf_polars.sh @@ -71,6 +71,8 @@ for version in "${VERSIONS[@]}"; do ./ci/run_cudf_polars_pytests.sh \ "${COVERAGE_ARGS[@]}" \ + --numprocesses=8 \ + --dist=worksteal \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cudf-polars-${version}.xml" if [ $? -ne 0 ]; then From 161d226f9289ccb401be6b06b207a1438b3afda9 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 29 Sep 2025 10:07:30 -0700 Subject: [PATCH 2/4] Change to function scope --- python/cudf_polars/tests/experimental/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cudf_polars/tests/experimental/conftest.py b/python/cudf_polars/tests/experimental/conftest.py index c01c82a4a95..f1f439ce10d 100644 --- a/python/cudf_polars/tests/experimental/conftest.py +++ b/python/cudf_polars/tests/experimental/conftest.py @@ -7,7 +7,7 @@ import pytest -@pytest.fixture(autouse=True) +@pytest.fixture(scope="session", autouse=True) def dask_cluster(pytestconfig, worker_id): if ( pytestconfig.getoption("--scheduler") == "distributed" From c2d6a05998687cf116c04e9b5d3358feed7b1979 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 29 Sep 2025 10:55:41 -0700 Subject: [PATCH 3/4] comment on session scoping --- python/cudf_polars/tests/experimental/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cudf_polars/tests/experimental/conftest.py b/python/cudf_polars/tests/experimental/conftest.py index f1f439ce10d..3d50e65a6c6 100644 --- a/python/cudf_polars/tests/experimental/conftest.py +++ b/python/cudf_polars/tests/experimental/conftest.py @@ -7,7 +7,9 @@ import pytest -@pytest.fixture(scope="session", autouse=True) +# scope="session" is important to not cause singificant slowdowns in CI +# https://github.com/rapidsai/cudf/pull/20137 +@pytest.fixture(autouse=True, scope="session") def dask_cluster(pytestconfig, worker_id): if ( pytestconfig.getoption("--scheduler") == "distributed" From f4554de361f598d3a58be6363df6ab8afdfe4ec2 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 30 Sep 2025 10:24:44 -0700 Subject: [PATCH 4/4] Try removing 0 processes for distributed tests after session scoping fix --- ci/run_cudf_polars_pytests.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/run_cudf_polars_pytests.sh b/ci/run_cudf_polars_pytests.sh index e7a9837cd66..304573d6a85 100755 --- a/ci/run_cudf_polars_pytests.sh +++ b/ci/run_cudf_polars_pytests.sh @@ -18,10 +18,7 @@ python -m pytest --cache-clear "$@" tests --executor streaming python -m pytest --cache-clear "$@" tests --executor streaming --blocksize-mode small # Run experimental tests with Distributed cluster -# Runtime in CI tends to increase when running these tests with multiple processes. -# https://github.com/rapidsai/cudf/pull/19980#issuecomment-3340039980 python -m pytest --cache-clear "$@" "tests/experimental" \ --executor streaming \ --scheduler distributed \ - --numprocesses=0 \ --cov-fail-under=0 # No code-coverage requirement for these tests.