Skip to content

Commit 87a50a3

Browse files
committed
CI: misc docker deploy fixes
1 parent 51a7df1 commit 87a50a3

4 files changed

Lines changed: 93 additions & 114 deletions

File tree

.github/workflows/docker-bases.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
############## Basic gcc CPU ##########################
4141
#######################################################
4242
deploy-cpu-bases:
43-
if: inputs.cpu
43+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.cpu }}
4444
name: "cpu-base-${{ matrix.arch }}-gcc${{ matrix.gcc }}"
4545
runs-on: ${{ matrix.runner }}
4646
env:
@@ -88,7 +88,7 @@ jobs:
8888
tags: "devitocodes/bases:cpu-gcc${{ matrix.gcc }}-${{ matrix.arch }}"
8989

9090
deploy-cpu-bases-manifest:
91-
if: inputs.cpu
91+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.cpu }}
9292
name: "cpu-base-manifest"
9393
runs-on: ubuntu-latest
9494
needs: deploy-cpu-bases
@@ -123,7 +123,7 @@ jobs:
123123
############## Intel OneApi CPU #######################
124124
#######################################################
125125
deploy-oneapi-bases:
126-
if: inputs.intel
126+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.intel }}
127127
name: "oneapi-base"
128128
runs-on: ubuntu-latest
129129
env:
@@ -181,7 +181,7 @@ jobs:
181181
################### Nvidia nvhpc ######################
182182
#######################################################
183183
deploy-nvidia-bases:
184-
if: inputs.nvidia
184+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.nvidia }}
185185
name: "nvidia-bases-${{ matrix.arch }}"
186186
runs-on: ${{ matrix.runner }}
187187
env:
@@ -270,7 +270,7 @@ jobs:
270270
tags: "devitocodes/bases:cpu-nvc${{ matrix.extra_tag }}-${{ matrix.arch }}"
271271

272272
deploy-nvidia-bases-manifest:
273-
if: inputs.nvidia
273+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.nvidia }}
274274
name: "nvidia-base-manifest"
275275
runs-on: ubuntu-latest
276276
needs: deploy-nvidia-bases
@@ -305,7 +305,7 @@ jobs:
305305
##################### AMD #############################
306306
#######################################################
307307
deploy-amd-bases:
308-
if: inputs.amd
308+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.amd }}
309309
name: "amd-base"
310310
runs-on: ["self-hosted", "amdgpu"]
311311
env:

docker/Dockerfile.intel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FROM base AS oneapi
2626

2727
# Download the key to system keyring
2828
# https://www.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html#apt
29-
SHELL /bin/bash -o pipefail
29+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3030
RUN wget --progress=dot:giga -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor > /usr/share/keyrings/oneapi-archive-keyring.gpg
3131
RUN echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/oneAPI.list
3232

@@ -37,7 +37,7 @@ RUN apt-get update -y && \
3737

3838
# Drivers mandatory for intel gpu
3939
# https://dgpu-docs.intel.com/driver/installation.html#ubuntu-install-steps
40-
SHELL /bin/bash -o pipefail
40+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4141
RUN wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor > /usr/share/keyrings/intel-graphics.gpg
4242
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy unified" > /etc/apt/sources.list.d/intel-gpu-jammy.list
4343

docker/Dockerfile.nvidia

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN apt-get update && \
1919
dh-autoreconf python3-venv python3-dev python3-pip
2020

2121
# nodesource: nvdashboard requires nodejs>=10
22-
SHELL /bin/bash -o pipefail
22+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2323
RUN curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | gpg --yes --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
2424
RUN arch="$(uname -m)" && \
2525
case "$arch" in \
@@ -92,7 +92,7 @@ ENV UCX_TLS=cuda,cuda_copy,cuda_ipc,sm,shm,self
9292
#ENV UCX_TLS=cuda,cuda_copy,cuda_ipc,sm,shm,self,rc_x,gdr_copy
9393

9494
# Make simlink for path setup since ENV doesn't accept shell commands.
95-
SHELL /bin/bash -o pipefail
95+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
9696
RUN arch="$(uname -m)" && \
9797
case "$arch" in \
9898
x86_64) linux=Linux_x86_64 ;; \

examples/userapi/05_conditional_dimension.ipynb

Lines changed: 83 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"name": "stderr",
7272
"output_type": "stream",
7373
"text": [
74-
"NUMA domain count autodetection failed, assuming 1\n",
7574
"Operator `Kernel` ran in 0.01 s\n"
7675
]
7776
},
@@ -159,77 +158,75 @@
159158
"output_type": "stream",
160159
"text": [
161160
"\n",
162-
"Symbol defining a non-convex iteration sub-space derived from a ``parent``\n",
163-
"Dimension, implemented by the compiler generating conditional \"if-then\" code\n",
164-
"within the parent Dimension's iteration space.\n",
161+
" Symbol defining a non-convex iteration sub-space derived from a ``parent``\n",
162+
" Dimension, implemented by the compiler generating conditional \"if-then\" code\n",
163+
" within the parent Dimension's iteration space.\n",
165164
"\n",
166-
"Parameters\n",
167-
"----------\n",
168-
"name : str\n",
169-
" Name of the dimension.\n",
170-
"parent : Dimension\n",
171-
" The parent Dimension.\n",
172-
"factor : int, optional, default=None\n",
173-
" The number of iterations between two executions of the if-branch. If None\n",
174-
" (default), ``condition`` must be provided.\n",
175-
"condition : expr-like, optional, default=None\n",
176-
" An arbitrary SymPy expression, typically involving the ``parent``\n",
177-
" Dimension. When it evaluates to True, the if-branch is executed. If None\n",
178-
" (default), ``factor`` must be provided.\n",
179-
"indirect : bool, optional, default=False\n",
180-
" If True, use `self`, rather than the parent Dimension, to\n",
181-
" index into arrays. A typical use case is when arrays are accessed\n",
182-
" indirectly via the ``condition`` expression.\n",
183-
"relation: Or/And, default=And\n",
184-
" How this ConditionalDimension will be combined with other ones.\n",
165+
" Parameters\n",
166+
" ----------\n",
167+
" name : str\n",
168+
" Name of the dimension.\n",
169+
" parent : Dimension\n",
170+
" The parent Dimension.\n",
171+
" factor : int, optional, default=None\n",
172+
" The number of iterations between two executions of the if-branch. If None\n",
173+
" (default), ``condition`` must be provided.\n",
174+
" condition : expr-like, optional, default=None\n",
175+
" An arbitrary SymPy expression, typically involving the ``parent``\n",
176+
" Dimension. When it evaluates to True, the if-branch is executed. If None\n",
177+
" (default), ``factor`` must be provided.\n",
178+
" indirect : bool, optional, default=False\n",
179+
" If True, use `self`, rather than the parent Dimension, to\n",
180+
" index into arrays. A typical use case is when arrays are accessed\n",
181+
" indirectly via the ``condition`` expression.\n",
185182
"\n",
186-
"Examples\n",
187-
"--------\n",
188-
"Among the other things, ConditionalDimensions are indicated to implement\n",
189-
"Function subsampling. In the following example, an Operator evaluates the\n",
190-
"Function ``g`` and saves its content into ``f`` every ``factor=4`` iterations.\n",
183+
" Examples\n",
184+
" --------\n",
185+
" Among the other things, ConditionalDimensions are indicated to implement\n",
186+
" Function subsampling. In the following example, an Operator evaluates the\n",
187+
" Function ``g`` and saves its content into ``f`` every ``factor=4`` iterations.\n",
191188
"\n",
192-
">>> from devito import Dimension, ConditionalDimension, Function, Eq, Operator\n",
193-
">>> size, factor = 16, 4\n",
194-
">>> i = Dimension(name='i')\n",
195-
">>> ci = ConditionalDimension(name='ci', parent=i, factor=factor)\n",
196-
">>> g = Function(name='g', shape=(size,), dimensions=(i,))\n",
197-
">>> f = Function(name='f', shape=(int(size/factor),), dimensions=(ci,))\n",
198-
">>> op = Operator([Eq(g, 1), Eq(f, g)])\n",
189+
" >>> from devito import Dimension, ConditionalDimension, Function, Eq, Operator\n",
190+
" >>> size, factor = 16, 4\n",
191+
" >>> i = Dimension(name='i')\n",
192+
" >>> ci = ConditionalDimension(name='ci', parent=i, factor=factor)\n",
193+
" >>> g = Function(name='g', shape=(size,), dimensions=(i,))\n",
194+
" >>> f = Function(name='f', shape=(int(size/factor),), dimensions=(ci,))\n",
195+
" >>> op = Operator([Eq(g, 1), Eq(f, g)])\n",
199196
"\n",
200-
"The Operator generates the following for-loop (pseudocode)\n",
197+
" The Operator generates the following for-loop (pseudocode)\n",
201198
"\n",
202-
".. code-block:: C\n",
199+
" .. code-block:: C\n",
203200
"\n",
204-
" for (int i = i_m; i <= i_M; i += 1) {\n",
205-
" g[i] = 1;\n",
206-
" if (i%4 == 0) {\n",
207-
" f[i / 4] = g[i];\n",
208-
" }\n",
209-
" }\n",
201+
" for (int i = i_m; i <= i_M; i += 1) {\n",
202+
" g[i] = 1;\n",
203+
" if (i%4 == 0) {\n",
204+
" f[i / 4] = g[i];\n",
205+
" }\n",
206+
" }\n",
210207
"\n",
211-
"Another typical use case is when one needs to constrain the execution of\n",
212-
"loop iterations so that certain conditions are honoured. The following\n",
213-
"artificial example uses ConditionalDimension to guard against out-of-bounds\n",
214-
"accesses in indirectly accessed arrays.\n",
208+
" Another typical use case is when one needs to constrain the execution of\n",
209+
" loop iterations so that certain conditions are honoured. The following\n",
210+
" artificial example uses ConditionalDimension to guard against out-of-bounds\n",
211+
" accesses in indirectly accessed arrays.\n",
215212
"\n",
216-
">>> from sympy import And\n",
217-
">>> ci = ConditionalDimension(name='ci', parent=i,\n",
218-
"... condition=And(g[i] > 0, g[i] < 4, evaluate=False))\n",
219-
">>> f = Function(name='f', shape=(int(size/factor),), dimensions=(ci,))\n",
220-
">>> op = Operator(Eq(f[g[i]], f[g[i]] + 1))\n",
213+
" >>> from sympy import And\n",
214+
" >>> ci = ConditionalDimension(name='ci', parent=i,\n",
215+
" ... condition=And(g[i] > 0, g[i] < 4, evaluate=False))\n",
216+
" >>> f = Function(name='f', shape=(int(size/factor),), dimensions=(ci,))\n",
217+
" >>> op = Operator(Eq(f[g[i]], f[g[i]] + 1))\n",
221218
"\n",
222-
"The Operator generates the following for-loop (pseudocode)\n",
219+
" The Operator generates the following for-loop (pseudocode)\n",
223220
"\n",
224-
".. code-block:: C\n",
221+
" .. code-block:: C\n",
225222
"\n",
226-
" for (int i = i_m; i <= i_M; i += 1) {\n",
227-
" if (g[i] > 0 && g[i] < 4) {\n",
228-
" f[g[i]] = f[g[i]] + 1;\n",
229-
" }\n",
230-
" }\n",
223+
" for (int i = i_m; i <= i_M; i += 1) {\n",
224+
" if (g[i] > 0 && g[i] < 4) {\n",
225+
" f[g[i]] = f[g[i]] + 1;\n",
226+
" }\n",
227+
" }\n",
231228
"\n",
232-
"\n"
229+
" \n"
233230
]
234231
}
235232
],
@@ -251,7 +248,9 @@
251248
{
252249
"cell_type": "code",
253250
"execution_count": 5,
254-
"metadata": {},
251+
"metadata": {
252+
"scrolled": true
253+
},
255254
"outputs": [
256255
{
257256
"name": "stderr",
@@ -322,18 +321,14 @@
322321
"output_type": "stream",
323322
"text": [
324323
"START(section0)\n",
325-
"#pragma omp parallel num_threads(nthreads)\n",
324+
"for (int x = x_m; x <= x_M; x += 1)\n",
326325
"{\n",
327-
" #pragma omp for schedule(static,1)\n",
328-
" for (int x = x_m; x <= x_M; x += 1)\n",
326+
" #pragma omp simd aligned(f:32)\n",
327+
" for (int y = y_m; y <= y_M; y += 1)\n",
329328
" {\n",
330-
" #pragma omp simd aligned(f:16)\n",
331-
" for (int y = y_m; y <= y_M; y += 1)\n",
329+
" if (f[x + 1][y + 1] > 0)\n",
332330
" {\n",
333-
" if (f[x + 1][y + 1] > 0)\n",
334-
" {\n",
335-
" f[x + 1][y + 1] = f[x + 1][y + 1] + 1;\n",
336-
" }\n",
331+
" f[x + 1][y + 1] = f[x + 1][y + 1] + 1;\n",
337332
" }\n",
338333
" }\n",
339334
"}\n",
@@ -402,18 +397,14 @@
402397
"output_type": "stream",
403398
"text": [
404399
"START(section0)\n",
405-
"#pragma omp parallel num_threads(nthreads)\n",
400+
"for (int x = x_m; x <= x_M; x += 1)\n",
406401
"{\n",
407-
" #pragma omp for schedule(static,1)\n",
408-
" for (int x = x_m; x <= x_M; x += 1)\n",
402+
" #pragma omp simd aligned(f,g:32)\n",
403+
" for (int y = y_m; y <= y_M; y += 1)\n",
409404
" {\n",
410-
" #pragma omp simd aligned(f,g:16)\n",
411-
" for (int y = y_m; y <= y_M; y += 1)\n",
405+
" if (y < 5 && g[x + 1][y + 1] != 0)\n",
412406
" {\n",
413-
" if (y < 5 && g[x + 1][y + 1] != 0)\n",
414-
" {\n",
415-
" f[x + 1][y + 1] = f[x + 1][y + 1] + g[x + 1][y + 1];\n",
416-
" }\n",
407+
" f[x + 1][y + 1] = f[x + 1][y + 1] + g[x + 1][y + 1];\n",
417408
" }\n",
418409
" }\n",
419410
"}\n",
@@ -498,17 +489,13 @@
498489
"output_type": "stream",
499490
"text": [
500491
"START(section0)\n",
501-
"#pragma omp parallel num_threads(nthreads)\n",
492+
"for (int x = x_m; x <= x_M; x += 1)\n",
502493
"{\n",
503-
" #pragma omp for schedule(static,1)\n",
504-
" for (int x = x_m; x <= x_M; x += 1)\n",
494+
" for (int y = y_m; y <= y_M; y += 1)\n",
505495
" {\n",
506-
" for (int y = y_m; y <= y_M; y += 1)\n",
496+
" if (y < 5 && g[x + 1][y + 1] != 0)\n",
507497
" {\n",
508-
" if (y < 5 && g[x + 1][y + 1] != 0)\n",
509-
" {\n",
510-
" h[x + 1][y + 1] = g[x + 1][y + 1] + h[x + 1][y + 1];\n",
511-
" }\n",
498+
" h[x + 1][y + 1] = g[x + 1][y + 1] + h[x + 1][y + 1];\n",
512499
" }\n",
513500
" }\n",
514501
"}\n",
@@ -576,15 +563,11 @@
576563
"output_type": "stream",
577564
"text": [
578565
"START(section0)\n",
579-
"#pragma omp parallel num_threads(nthreads)\n",
566+
"for (int i = i_m; i <= i_M; i += 1)\n",
580567
"{\n",
581-
" #pragma omp for schedule(static,1)\n",
582-
" for (int i = i_m; i <= i_M; i += 1)\n",
568+
" if ((i)%(cif) == 0)\n",
583569
" {\n",
584-
" if ((i)%(cif) == 0)\n",
585-
" {\n",
586-
" f[i / cif] = g[i];\n",
587-
" }\n",
570+
" f[i / cif] = g[i];\n",
588571
" }\n",
589572
"}\n",
590573
"STOP(section0,timers)\n",
@@ -695,17 +678,13 @@
695678
"output_type": "stream",
696679
"text": [
697680
"START(section0)\n",
698-
"#pragma omp parallel num_threads(nthreads)\n",
681+
"for (int x = x_m; x <= x_M; x += 1)\n",
699682
"{\n",
700-
" #pragma omp for collapse(2) schedule(static,1) reduction(+:g[1])\n",
701-
" for (int x = x_m; x <= x_M; x += 1)\n",
683+
" for (int y = y_m; y <= y_M; y += 1)\n",
702684
" {\n",
703-
" for (int y = y_m; y <= y_M; y += 1)\n",
685+
" if (f[x][y] != 0)\n",
704686
" {\n",
705-
" if (f[x][y] != 0)\n",
706-
" {\n",
707-
" g[1] += 1;\n",
708-
" }\n",
687+
" g[1] += 1;\n",
709688
" }\n",
710689
" }\n",
711690
"}\n",
@@ -715,7 +694,7 @@
715694
{
716695
"data": {
717696
"text/plain": [
718-
"np.int32(10)"
697+
"10"
719698
]
720699
},
721700
"execution_count": 11,
@@ -852,7 +831,7 @@
852831
"name": "python",
853832
"nbconvert_exporter": "python",
854833
"pygments_lexer": "ipython3",
855-
"version": "3.13.11"
834+
"version": "3.11.2"
856835
}
857836
},
858837
"nbformat": 4,

0 commit comments

Comments
 (0)