diff --git a/.github/workflows/gpu_test.yaml b/.github/workflows/gpu_test.yaml new file mode 100644 index 000000000..02e3f0cd7 --- /dev/null +++ b/.github/workflows/gpu_test.yaml @@ -0,0 +1,48 @@ +name: gpu-tests +on: + push: + branches: + - main + pull_request: + branches: + - '*' + workflow_dispatch: + schedule: + - cron: '0 16 * * SUN' + +jobs: + gpu: + name: GPU Tests on self-hosted machine + runs-on: ['self-hosted'] + strategy: + fail-fast: false + timeout-minutes: 180 + defaults: + run: + shell: bash -l {0} + env: + OMP_NUM_THREADS: 1 + OPENBLAS_NUM_THREADS: 1 + MKL_NUM_THREADS: 1 + VECLIB_MAXIMUM_THREADS: 1 + NUMEXPR_NUM_THREADS: 1 + PYDEVD_DISABLE_FILE_VALIDATION: 1 + AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache + CONDA: /home/philippjfr/miniconda3/ + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: "100" + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-activate-base: true + activate-environment: "" + - name: Install environment + run: | + conda create -n datashader-gh-gpu -c conda-forge -c nvidia -c rapidsai -c pyviz python=3.10 cudf cupy numba dask spatialpandas xarray param pyct pillow toolz pytest geodatasets fastparquet pyarrow pytest-benchmark pyctdev + conda activate datashader-gh-gpu + pip install -e . --no-deps --no-build-isolation + - name: doit test_unit_gpu + run: | + conda activate datashader-gh-gpu + doit test_unit_gpu \ No newline at end of file diff --git a/setup.py b/setup.py index 050e9feb7..64da2f08d 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,10 @@ 'scikit-image', 'spatialpandas', ], + 'gpu': [ + 'cudf', + 'cupy' + ], 'examples': examples, 'examples_extra': examples + [ 'networkx', diff --git a/tox.ini b/tox.ini index 678860750..923d9444e 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ [tox] # python version test group extra envs extra commands -envlist = {py39,py310,py311}-{lint,unit,unit_nojit,unit_deploy,examples,all,examples_extra}-{default}-{dev,pkg} +envlist = {py39,py310,py311}-{lint,unit,unit_nojit,unit_gpu,unit_deploy,examples,all,examples_extra}-{default}-{dev,pkg} build = wheel [_lint] @@ -19,6 +19,11 @@ description = Run unit tests deps = .[tests] commands = pytest datashader --cov=./datashader --cov-append +[_unit_gpu] +description = Run unit tests including GPU +deps = .[tests,gpu] +commands = pytest datashader + [_unit_deploy] description = Run unit tests without coverage deps = .[tests] @@ -57,6 +62,7 @@ changedir = {envtmpdir} commands = pkg: {[_pkg]commands} unit: {[_unit]commands} unit_nojit: {[_unit_nojit]commands} + unit_gpu: {[_unit_gpu]commands} unit_deploy: {[_unit_deploy]commands} lint: {[_lint]commands} examples: {[_examples]commands}