Skip to content

Commit

Permalink
WIP: dummay tags for action debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 11, 2023
1 parent dcd6464 commit a61d5a8
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 147 deletions.
104 changes: 71 additions & 33 deletions .github/workflows/docker-bases.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build base compilers docker images

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
paths:
Expand All @@ -16,11 +20,11 @@ on:

jobs:
#######################################################
################### CPU ###############################
############## Basic gcc CPU ##########################
#######################################################
deploy-cpu-bases:
name: ${{ matrix.tag }}
runs-on: ${{ matrix.runner }}
name: "cpu-base"
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"

Expand All @@ -46,35 +50,66 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: GCC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
build-args: |
'arch=gcc'
tags: 'devitocodes/bases:cpu-gcc'
target: 'gcc'
build-args: 'arch=gcc'
tags: 'devitocodes/test-bases:cpu-gcc'

#######################################################
############## Intel OneApi CPU #######################
#######################################################
deploy-oneapi-bases:
name: "oneapi-base"
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"

steps:
- name: Checkout devito
uses: actions/checkout@v3

- name: Check event name
run: echo ${{ github.event_name }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Docker image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: cleanup
run: docker system prune -a -f

- name: ICX image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
build-args: |
'arch=icx'
tags: 'devitocodes/bases:cpu-icx'
target: 'icx'
build-args: 'arch=icx'
tags: 'devitocodes/test-bases:cpu-icx'

- name: Docker image
- name: ICC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
build-args: |
'arch=icc'
tags: 'devitocodes/bases:cpu-icc'
target: 'icc'
build-args: 'arch=icc'
tags: 'devitocodes/test-bases:cpu-icc'

#######################################################
################### Nvidia nvhpc ######################
Expand Down Expand Up @@ -107,35 +142,35 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: NVC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=nvc'
tags: 'devitocodes/bases:nvidia-nvc'
target: 'nvc'
build-args: 'arch=nvc'
tags: 'devitocodes/test-bases:nvidia-nvc'

- name: Docker image
- name: NVCC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=nvcc'
tags: 'devitocodes/bases:nvidia-nvcc'
target: 'nvcc'
build-args: 'arch=nvcc'
tags: 'devitocodes/test-bases:nvidia-nvcc'

- name: Docker image
- name: NVC host image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=nvc-host'
tags: 'devitocodes/bases:cpu-nvc'
target: 'nvc-host'
build-args: 'arch=nvc-host'
tags: 'devitocodes/test-bases:cpu-nvc'

#######################################################
################### Nvidia clang ######################
Expand Down Expand Up @@ -172,16 +207,17 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: Nvidia clang image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
target: 'clang'
build-args: |
'arch=clang'
'ver=nvhpc-21-11'
tags: 'devitocodes/bases:nvidia-clang'
tags: 'devitocodes/test-bases:nvidia-clang'

#######################################################
##################### AMD #############################
Expand Down Expand Up @@ -214,20 +250,22 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: AMD image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.amd'
push: true
tags: devitocodes/bases:amd
target: 'aomp'
tags: devitocodes/test-bases:amd

- name: Docker image
- name: AMD HIP image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.amd'
push: true
target: 'hip'
build-args: |
arch=hip
tags: devitocodes/bases:amd-hip
tags: devitocodes/test-bases:amd-hip
26 changes: 13 additions & 13 deletions .github/workflows/docker-devito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,38 @@ jobs:
fail-fast: false
matrix:
include:
- base: 'bases:nvidia-nvc'
- base: 'test-bases:nvidia-nvc'
tag: 'nvidia-nvc'
flag: '--gpus all'
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
runner: ["self-hosted", "nvidiagpu"]

- base: 'bases:nvidia-clang'
- base: 'test-bases:nvidia-clang'
tag: 'nvidia-clang'
flag: '--gpus all'
test: 'tests/test_gpu_openmp.py tests/test_gpu_common.py'
runner: ["self-hosted", "nvidiagpu"]

# Runtime gpu flags from https://hub.docker.com/r/rocm/tensorflow/
- base: 'bases:amd'
- base: 'test-bases:amd'
tag: 'amd'
flag: '--network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add 109 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined'
test: 'tests/test_gpu_openmp.py'
runner: ["self-hosted", "amdgpu"]

- base: 'bases:cpu-gcc'
- base: 'test-bases:cpu-gcc'
tag: "gcc"
flag: ''
test: 'tests/test_operator.py'
runner: ubuntu-latest

- base: 'bases:cpu-icc'
- base: 'test-bases:cpu-icc'
tag: "icc"
flag: ''
test: 'tests/test_operator.py'
runner: ubuntu-latest

- base: 'bases:cpu-icx'
- base: 'test-bases:cpu-icx'
tag: "icx"
flag: ''
test: 'tests/test_operator.py'
Expand Down Expand Up @@ -90,16 +90,16 @@ jobs:
tags: |
type=raw,value=${{ matrix.tag }}-dev
type=raw,value=${{ matrix.tag }}-latest,enable=${{ github.event_name == 'release' }}
type=raw,value=latest,enable=${{ matrix.base == 'bases:cpu-gcc' }}
type=raw,value=latest,enable=${{ matrix.base == 'test-bases:cpu-gcc' }}
type=semver,pattern={{raw}},prefix=${{ matrix.tag }}-,enable=${{ github.event_name == 'release' }}
# Legacy "gpu" tag
type=raw,value=gpu-dev,enable=${{ matrix.base == 'bases:nvidia-nvc' }}
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
type=raw,value=gpu-dev,enable=${{ matrix.base == 'test-bases:nvidia-nvc' }}
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:nvidia-nvc' }}
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:nvidia-nvc' }}
# Legacy "cpu" tag
type=raw,value=cpu-dev,enable=${{ matrix.base == 'bases:cpu-gcc' }}
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
type=raw,value=cpu-dev,enable=${{ matrix.base == 'test-bases:cpu-gcc' }}
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:cpu-gcc' }}
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:cpu-gcc' }}
- name: Check tags
run: echo "${{ steps.meta.outputs.tags }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ jobs:
- name: Build docker image
if: contains(matrix.name, 'docker')
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/bases:cpu-${{ matrix.arch }}
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/test-bases:cpu-${{ matrix.arch }}
- name: Set run prefix
run: |
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e DEVITO_ARCH=${{ matrix.arch }} --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ jobs:
include:
- name: pytest-gpu-omp-nvidia
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
base: "devitocodes/bases:nvidia-clang"
base: "devitocodes/test-bases:nvidia-clang"
tags: ["self-hosted", "nvidiagpu"]
test_drive_cmd: "nvidia-smi"
flags: '--gpus all --rm --name testrun-clang-nvidia'

- name: pytest-gpu-acc-nvidia
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openacc.py"
base: "devitocodes/bases:nvidia-nvc"
base: "devitocodes/test-bases:nvidia-nvc"
tags: ["self-hosted", "nvidiagpu"]
test_drive_cmd: "nvidia-smi"
flags: '--gpus all --rm --name testrun-nvc'

- name: pytest-gpu-omp-amd
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
tags: ["self-hosted", "amdgpu"]
base: "devitocodes/bases:amd"
base: "devitocodes/test-bases:amd"
test_drive_cmd: "rocm-smi"
# Attach the AMD GPU devices `/dev` and add user to video and render (109 on wampa) group
# Options from https://rocmdocs.amd.com/en/latest/ROCm_Virtualization_Containers/ROCm-Virtualization-&-Containers.html
Expand Down
11 changes: 7 additions & 4 deletions devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def sniff_compiler_version(cc):
compiler = "clang"
elif ver.startswith("icc"):
compiler = "icc"
elif ver.startswith("icx"):
compiler = "icx"
elif ver.startswith("pgcc"):
compiler = "pgcc"
elif ver.startswith("cray"):
Expand All @@ -62,7 +64,7 @@ def sniff_compiler_version(cc):
compiler = "unknown"

ver = Version("0")
if compiler in ["gcc", "icc"]:
if compiler in ["gcc", "icc", "icx"]:
try:
# gcc-7 series only spits out patch level on dumpfullversion.
res = run([cc, "-dumpfullversion"], stdout=PIPE, stderr=DEVNULL)
Expand Down Expand Up @@ -707,7 +709,8 @@ def __init__(self, *args, **kwargs):
if mpi_distro != 'IntelMPI':
warning("Expected Intel MPI distribution with `%s`, but found `%s`"
% (self.__class__.__name__, mpi_distro))
self.cflags.append("-cc=%s" % self.CC)
if self.MPICC == 'mpiicc':
self.cflags.append("-cc=%s" % self.CC)

def __lookup_cmds__(self):
self.CC = 'icc'
Expand Down Expand Up @@ -776,8 +779,8 @@ def __lookup_cmds__(self):
# and icx, which is clang
self.CC = 'icx'
self.CXX = 'icpx'
self.MPICC = 'mpicc'
self.MPICX = 'mpicx'
self.MPICC = 'mpiicc'
self.MPICX = 'mpicxx'


class CustomCompiler(Compiler):
Expand Down
Loading

0 comments on commit a61d5a8

Please sign in to comment.