Skip to content

Commit

Permalink
compiler: prevent adding breaking guard to nokey
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 7, 2023
1 parent 474b10c commit 7219254
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 22 deletions.
73 changes: 53 additions & 20 deletions .github/workflows/docker-bases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ jobs:
fail-fast: false
matrix:
include:
- tag: 'devitocodes/bases:nvidia-nvc'
arch: 'arch=nvc'
version: 'ver=nvhpc-22-7'
dockerfile: './docker/Dockerfile.nvidia'
runner: ["self-hosted", "nvidiagpu"]

- tag: 'devitocodes/bases:nvidia-nvcc'
arch: 'arch=nvcc'
version: 'ver=nvhpc-22-7'
Expand All @@ -52,12 +46,6 @@ jobs:
version: ''
dockerfile: './docker/Dockerfile.amd'
runner: ["self-hosted", "amdgpu"]

- tag: 'devitocodes/bases:amd-hip'
arch: 'arch=hip'
version: ''
dockerfile: './docker/Dockerfile.amd'
runner: ["self-hosted", "amdgpu"]

# These ones are tiny runs on default
- tag: 'devitocodes/bases:cpu-gcc'
Expand All @@ -66,18 +54,12 @@ jobs:
dockerfile: './docker/Dockerfile.cpu'
runner: ubuntu-latest

- tag: 'devitocodes/bases:cpu-icc, devitocodes/bases:cpu-icx'
arch: 'arch=icc'
- tag: 'devitocodes/bases:cpu-icx'
arch: 'arch=icx'
version: ''
dockerfile: './docker/Dockerfile.cpu'
runner: ubuntu-latest

- tag: 'devitocodes/bases:cpu-nvc'
arch: 'arch=nvc-host'
version: ''
dockerfile: './docker/Dockerfile.nvidia'
runner: ["self-hosted", "nvidiagpu"]

steps:
- name: Checkout devito
uses: actions/checkout@v3
Expand Down Expand Up @@ -110,3 +92,54 @@ jobs:
${{ matrix.arch }}
${{ matrix.version }}
tags: ${{ matrix.tag }}

deploy-docker-extra-configs:
name: ${{ matrix.tag }}
runs-on: ${{ matrix.runner }}
env:
DOCKER_BUILDKIT: "1"
needs: deploy-docker-bases

strategy:
fail-fast: false
matrix:
include:
- tag: 'devitocodes/bases:nvidia-nvc'
arch: 'arch=nvc'
base: 'devitocodes/bases:nvidia-nvcc'
version: 'ver=nvhpc-22-7'
dockerfile: './docker/Dockerfile.nvidia'
runner: ["self-hosted", "nvidiagpu"]

- tag: 'devitocodes/bases:cpu-nvc'
arch: 'arch=nvc-host'
base: 'devitocodes/bases:nvidia-nvcc'
version: ''
dockerfile: './docker/Dockerfile.nvidia'
runner: ["self-hosted", "nvidiagpu"]

- tag: 'devitocodes/bases:amd-hip'
base: 'devitocodes/bases:amd'
arch: 'arch=hip'
version: ''
dockerfile: './docker/Dockerfile.amd'
runner: ["self-hosted", "amdgpu"]

- tag: 'devitocodes/bases:cpu-icc'
base: 'devitocodes/bases:cpu-icx'
arch: 'arch=icc'
version: ''
dockerfile: './docker/Dockerfile.cpu'
runner: ubuntu-latest

steps:
- name: Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
build-args: |
${{ matrix.arch }}
${{ matrix.version }}
tags: ${{ matrix.tag }}
13 changes: 13 additions & 0 deletions devito/ir/support/guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ def andg(self, d, guard):

return Guards(m)

def xandg(self, d, guard):
m = dict(self)

if guard == true:
return Guards(m)

try:
m[d] = And(m[d], guard)
except KeyError:
pass

return Guards(m)

def impose(self, d, guard):
m = dict(self)

Expand Down
10 changes: 8 additions & 2 deletions devito/passes/clusters/buffering.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ def callback(self, clusters, prefix, cache=None):

expr = lower_exprs(Eq(lhs, rhs))
ispace = b.readfrom
guards = c.guards.andg(b.xd, GuardBound(0, b.firstidx.f))
try:
guards = c.guards.xandg(b.xd, GuardBound(0, b.firstidx.f))
except KeyError:
guards = c.guards
properties = c.properties.sequentialize(d)

processed.append(
Expand Down Expand Up @@ -262,7 +265,10 @@ def callback(self, clusters, prefix, cache=None):

expr = lower_exprs(uxreplace(Eq(lhs, rhs), b.subdims_mapper))
ispace = b.written
guards = c.guards.andg(b.xd, GuardBound(0, b.firstidx.f))
try:
guards = c.guards.xandg(b.xd, GuardBound(0, b.firstidx.f))
except KeyError:
guards = c.guards
properties = c.properties.sequentialize(d)

processed.append(
Expand Down

0 comments on commit 7219254

Please sign in to comment.