Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 48 additions & 14 deletions .github/workflows/docker-devito.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ jobs:
tag_suffix: '-amd64'
# Respect CUDA_VISIBLE_DEVICES set by the runner and hard-limit docker to that device.
# (--gpus maps only the selected device from CUDA_VISIBLE_DEVICES)
flag: --init --cpuset-cpus="${AVAILABLE_CPUSET}" --memory="${AVAILABLE_MEM}" --memory-swap="${AVAILABLE_MEM}" --gpus "device=${CUDA_VISIBLE_DEVICES}"
flag: >-
--cpuset-cpus="${AVAILABLE_CPUSET}"
--memory="${AVAILABLE_MEM}"
--memory-swap="${AVAILABLE_MEM}"
--gpus "device=${CUDA_VISIBLE_DEVICES}"
--env CUDA_VISIBLE_DEVICES=0
--env OMP_NUM_THREADS=4
--env PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
runner: ["self-hosted", "NVIDIAGPU"]

Expand All @@ -40,7 +47,7 @@ jobs:
platform: linux/arm64
run_tests: false
tag_suffix: '-arm64'
flag: --init --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
flag: --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
test: ''
runner: ubuntu-24.04-arm

Expand All @@ -52,7 +59,14 @@ jobs:
tag_suffix: '-amd64'
# Respect CUDA_VISIBLE_DEVICES set by the runner and hard-limit docker to that device.
# (--gpus maps only the selected device from CUDA_VISIBLE_DEVICES)
flag: --init --cpuset-cpus="${AVAILABLE_CPUSET}" --memory="${AVAILABLE_MEM}" --memory-swap="${AVAILABLE_MEM}" --gpus "device=${CUDA_VISIBLE_DEVICES}"
flag: >-
--cpuset-cpus="${AVAILABLE_CPUSET}"
--memory="${AVAILABLE_MEM}"
--memory-swap="${AVAILABLE_MEM}"
--gpus "device=${CUDA_VISIBLE_DEVICES}"
--env CUDA_VISIBLE_DEVICES=0
--env OMP_NUM_THREADS=4
--env PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
runner: ["self-hosted", "NVIDIAGPU"]

Expand All @@ -62,7 +76,7 @@ jobs:
platform: linux/arm64
run_tests: false
tag_suffix: '-arm64'
flag: --init --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
flag: --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
test: ''
runner: ubuntu-24.04-arm

Expand All @@ -73,7 +87,18 @@ jobs:
platform: linux/amd64
run_tests: true
tag_suffix: ''
flag: '--init --cpuset-cpus="${AVAILABLE_CPUSET}" --memory="${AVAILABLE_MEM}" --memory-swap="${AVAILABLE_MEM}" --network=host --device=/dev/kfd --device=/dev/dri/${HIP_DEVICE_NAME} --ipc=host --group-add video --group-add $(getent group render | cut -d: -f3) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined'
flag: >-
--cpuset-cpus="${AVAILABLE_CPUSET}"
--memory="${AVAILABLE_MEM}"
--memory-swap="${AVAILABLE_MEM}"
--device=/dev/kfd --device=/dev/dri/${HIP_DEVICE_NAME}
--network=host
--ipc=host
--group-add video --group-add $(getent group render | cut -d: -f3)
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined
--env HIP_VISIBLE_DEVICES=0
--env OMP_NUM_THREADS=4
--env PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
test: 'tests/test_gpu_openmp.py'
runner: ["self-hosted", "AMDGPU"]

Expand All @@ -83,7 +108,6 @@ jobs:
platform: linux/amd64
run_tests: false
tag_suffix: '-amd64'
flag: '--init -t'
test: 'tests/test_operator.py'
runner: ubuntu-latest

Expand All @@ -93,7 +117,6 @@ jobs:
platform: linux/arm64
run_tests: false
tag_suffix: '-arm64'
flag: '--init -t'
test: 'tests/test_operator.py'
runner: ubuntu-24.04-arm

Expand All @@ -103,7 +126,6 @@ jobs:
platform: linux/amd64
run_tests: true
tag_suffix: ''
flag: '--init -t'
test: 'tests/test_operator.py'
runner: ubuntu-latest

Expand Down Expand Up @@ -182,7 +204,7 @@ jobs:
- name: Run tests
if: ${{ matrix.run_tests }}
run: |
docker run ${{ matrix.flag }} --rm -t --name "${CONTAINER_NAME}" \
docker run ${{ matrix.flag }} --init -t --rm --name "${CONTAINER_NAME}" \
devitocodes/devito:${{ matrix.tag }}-dev \
pytest -n auto --dist loadscope -v ${{ matrix.test }}

Expand Down Expand Up @@ -276,19 +298,31 @@ jobs:
matrix:
include:
- tag: 'nvidia-nvc'
flag: --init --cpuset-cpus="${AVAILABLE_CPUSET}" --memory="${AVAILABLE_MEM}" --memory-swap="${AVAILABLE_MEM}" --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
flag: >-
--cpuset-cpus="${AVAILABLE_CPUSET}"
--memory="${AVAILABLE_MEM}"
--memory-swap="${AVAILABLE_MEM}"
--gpus "device=${CUDA_VISIBLE_DEVICES}"
--env CUDA_VISIBLE_DEVICES=0
--env OMP_NUM_THREADS=4
--env PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
runner: ["self-hosted", "NVIDIAGPU"]
- tag: 'nvidia-nvc12'
flag: --init --cpuset-cpus="${AVAILABLE_CPUSET}" --memory="${AVAILABLE_MEM}" --memory-swap="${AVAILABLE_MEM}" --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
flag: >-
--cpuset-cpus="${AVAILABLE_CPUSET}"
--memory="${AVAILABLE_MEM}"
--memory-swap="${AVAILABLE_MEM}"
--gpus "device=${CUDA_VISIBLE_DEVICES}"
--env CUDA_VISIBLE_DEVICES=0
--env OMP_NUM_THREADS=4
--env PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
runner: ["self-hosted", "NVIDIAGPU"]
- tag: 'gcc'
flag: '--init -t'
test: 'tests/test_operator.py'
runner: ubuntu-latest
- tag: 'gcc'
flag: '--init -t'
test: 'tests/test_operator.py'
runner: ubuntu-24.04-arm

Expand All @@ -305,6 +339,6 @@ jobs:

- name: Run tests against multi-arch image
run: |
docker run ${{ matrix.flag }} --rm -t --name "${CONTAINER_NAME}" \
docker run ${{ matrix.flag }} --init -t --rm --name "${CONTAINER_NAME}" \
devitocodes/devito:${{ matrix.tag }}-dev \
pytest -n auto --dist loadscope -v ${{ matrix.test }}
14 changes: 11 additions & 3 deletions .github/workflows/pytest-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ jobs:
--cpuset-cpus="${AVAILABLE_CPUSET}"
--memory="${AVAILABLE_MEM}"
--memory-swap="${AVAILABLE_MEM}"
--network=host
--device=/dev/kfd --device=/dev/dri/${HIP_DEVICE_NAME}
--ipc=host
--group-add video --group-add "$(getent group render | cut -d: -f3)"
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined

Expand Down Expand Up @@ -106,6 +104,9 @@ jobs:
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
DEVITO_LOGGING=DEBUG
PYTHONFAULTHANDLER=1
CUDA_VISIBLE_DEVICES=0
HIP_VISIBLE_DEVICES=0
OMP_NUM_THREADS=4
PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
command: |
pytest \
Expand All @@ -128,7 +129,11 @@ jobs:
uid: ${{ steps.build.outputs.unique }}
tag: ${{ matrix.name }}
args: ${{ matrix.dockerflags }}
env: PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
env: |
CUDA_VISIBLE_DEVICES=0
HIP_VISIBLE_DEVICES=0
OMP_NUM_THREADS=4
PYTEST_XDIST_AUTO_NUM_WORKERS=${PYTEST_XDIST_AUTO_NUM_WORKERS}
command: |
pytest \
-n auto --dist loadscope \
Expand All @@ -145,6 +150,9 @@ jobs:
CI=true
DEVITO_LOGGING=DEBUG
DEVITO_MPI=1
CUDA_VISIBLE_DEVICES=0
HIP_VISIBLE_DEVICES=0
OMP_NUM_THREADS=4
command: |
mpiexec -n 2 \
pytest \
Expand Down
5 changes: 5 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ def decoupler(item, m):
if isinstance(m, int):
env_vars['DEVITO_DECOUPLER_WORKERS'] = str(m)

# Map by and bind to should be respected if set in the environment
for key in ['DEVITO_DECOUPLER_MAP_BY', 'DEVITO_DECOUPLER_BIND_TO']:
if os.environ.get(key) is not None:
env_vars[key] = os.environ[key]

testname = get_testname(item)

pyversion = sys.executable
Expand Down
Loading