Skip to content

Commit

Permalink
[ci] [dask] test lightgbm.dask on macOS (#6677)
Browse files Browse the repository at this point in the history
* [ci] [Dask] enable Dask tests on macOS

* fix windows condition

* fix merge conflicts
  • Loading branch information
jameslamb authored Mar 2, 2025
1 parent 6b624fb commit f7c641d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ jobs:
- script: |
git clean -d -f -x
displayName: 'Clean source directory'
# LGBM_SKIP_DASK_TESTS=true is set below only because running the tests under emulation is so slow...
# in theory, 'lightgbm.dask' should work without issue on aarch64 Linux systems.
# That could probably be removed as part of https://github.com/microsoft/LightGBM/issues/6788
- script: |
cat > docker-script.sh <<EOF
export CONDA=\$HOME/miniforge
Expand All @@ -273,6 +276,7 @@ jobs:
--env BUILD_ARTIFACTSTAGINGDIRECTORY=$BUILD_ARTIFACTSTAGINGDIRECTORY \
--env BUILD_DIRECTORY=$BUILD_DIRECTORY \
--env COMPILER=$COMPILER \
--env LGBM_SKIP_DASK_TESTS=true \
--env METHOD=$METHOD \
--env OS_NAME=linux \
--env PRODUCES_ARTIFACTS=$PRODUCES_ARTIFACTS \
Expand Down
2 changes: 1 addition & 1 deletion docs/Parallel-Learning-Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ LightGBM's Python-package supports distributed learning via `Dask`_. This integr

.. warning::

Dask integration is only tested on Linux.
Dask integration is only tested on macOS and Linux.

Dask Examples
'''''''''''''
Expand Down
11 changes: 6 additions & 5 deletions tests/python_package_test/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import socket
from itertools import groupby
from os import getenv
from platform import machine
from sys import platform
from urllib.parse import urlparse

Expand All @@ -16,10 +15,8 @@

from .utils import sklearn_multiclass_custom_objective

if not platform.startswith("linux"):
pytest.skip("lightgbm.dask is currently supported in Linux environments", allow_module_level=True)
if machine() != "x86_64":
pytest.skip("lightgbm.dask tests are currently skipped on some architectures like arm64", allow_module_level=True)
if platform in {"cygwin", "win32"}:
pytest.skip("lightgbm.dask is not currently supported on Windows", allow_module_level=True)
if not lgb.compat.DASK_INSTALLED:
pytest.skip("Dask is not installed", allow_module_level=True)

Expand Down Expand Up @@ -58,6 +55,10 @@
pytest.mark.skipif(getenv("TASK", "") == "mpi", reason="Fails to run with MPI interface"),
pytest.mark.skipif(getenv("TASK", "") == "gpu", reason="Fails to run with GPU interface"),
pytest.mark.skipif(getenv("TASK", "") == "cuda", reason="Fails to run with CUDA interface"),
pytest.mark.skipif(
getenv("LGBM_SKIP_DASK_TESTS", "") == "true",
reason="Skipping lightgbm.dask tests (found env variable LGBM_SKIP_DASK_TESTS=true)",
),
]


Expand Down

0 comments on commit f7c641d

Please sign in to comment.