Skip to content

Commit 1c123cf

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

4 files changed

Lines changed: 104 additions & 119 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: 94 additions & 109 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,77 @@
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",
182+
" relation: Or/And, default=And\n",
183+
" How this ConditionalDimension will be combined with other ones.\n",
185184
"\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",
185+
" Examples\n",
186+
" --------\n",
187+
" Among the other things, ConditionalDimensions are indicated to implement\n",
188+
" Function subsampling. In the following example, an Operator evaluates the\n",
189+
" Function ``g`` and saves its content into ``f`` every ``factor=4`` iterations.\n",
191190
"\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",
191+
" >>> from devito import Dimension, ConditionalDimension, Function, Eq, Operator\n",
192+
" >>> size, factor = 16, 4\n",
193+
" >>> i = Dimension(name='i')\n",
194+
" >>> ci = ConditionalDimension(name='ci', parent=i, factor=factor)\n",
195+
" >>> g = Function(name='g', shape=(size,), dimensions=(i,))\n",
196+
" >>> f = Function(name='f', shape=(int(size/factor),), dimensions=(ci,))\n",
197+
" >>> op = Operator([Eq(g, 1), Eq(f, g)])\n",
199198
"\n",
200-
"The Operator generates the following for-loop (pseudocode)\n",
199+
" The Operator generates the following for-loop (pseudocode)\n",
201200
"\n",
202-
".. code-block:: C\n",
201+
" .. code-block:: C\n",
203202
"\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",
203+
" for (int i = i_m; i <= i_M; i += 1) {\n",
204+
" g[i] = 1;\n",
205+
" if (i%4 == 0) {\n",
206+
" f[i / 4] = g[i];\n",
207+
" }\n",
208+
" }\n",
210209
"\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",
210+
" Another typical use case is when one needs to constrain the execution of\n",
211+
" loop iterations so that certain conditions are honoured. The following\n",
212+
" artificial example uses ConditionalDimension to guard against out-of-bounds\n",
213+
" accesses in indirectly accessed arrays.\n",
215214
"\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",
215+
" >>> from sympy import And\n",
216+
" >>> ci = ConditionalDimension(name='ci', parent=i,\n",
217+
" ... condition=And(g[i] > 0, g[i] < 4, evaluate=False))\n",
218+
" >>> f = Function(name='f', shape=(int(size/factor),), dimensions=(ci,))\n",
219+
" >>> op = Operator(Eq(f[g[i]], f[g[i]] + 1))\n",
221220
"\n",
222-
"The Operator generates the following for-loop (pseudocode)\n",
221+
" The Operator generates the following for-loop (pseudocode)\n",
223222
"\n",
224-
".. code-block:: C\n",
223+
" .. code-block:: C\n",
225224
"\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",
225+
" for (int i = i_m; i <= i_M; i += 1) {\n",
226+
" if (g[i] > 0 && g[i] < 4) {\n",
227+
" f[g[i]] = f[g[i]] + 1;\n",
228+
" }\n",
229+
" }\n",
231230
"\n",
232-
"\n"
231+
" \n"
233232
]
234233
}
235234
],
@@ -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:64)\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:64)\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",
@@ -564,6 +551,21 @@
564551
"execution_count": 9,
565552
"metadata": {},
566553
"outputs": [
554+
{
555+
"name": "stdout",
556+
"output_type": "stream",
557+
"text": [
558+
"START(section0)\n",
559+
"for (int i = i_m; i <= i_M; i += 1)\n",
560+
"{\n",
561+
" if ((i)%(cif) == 0)\n",
562+
" {\n",
563+
" f[i / cif] = g[i];\n",
564+
" }\n",
565+
"}\n",
566+
"STOP(section0,timers)\n"
567+
]
568+
},
567569
{
568570
"name": "stderr",
569571
"output_type": "stream",
@@ -575,19 +577,6 @@
575577
"name": "stdout",
576578
"output_type": "stream",
577579
"text": [
578-
"START(section0)\n",
579-
"#pragma omp parallel num_threads(nthreads)\n",
580-
"{\n",
581-
" #pragma omp for schedule(static,1)\n",
582-
" for (int i = i_m; i <= i_M; i += 1)\n",
583-
" {\n",
584-
" if ((i)%(cif) == 0)\n",
585-
" {\n",
586-
" f[i / cif] = g[i];\n",
587-
" }\n",
588-
" }\n",
589-
"}\n",
590-
"STOP(section0,timers)\n",
591580
"\n",
592581
" Data in g \n",
593582
" [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.]\n",
@@ -695,17 +684,13 @@
695684
"output_type": "stream",
696685
"text": [
697686
"START(section0)\n",
698-
"#pragma omp parallel num_threads(nthreads)\n",
687+
"for (int x = x_m; x <= x_M; x += 1)\n",
699688
"{\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",
689+
" for (int y = y_m; y <= y_M; y += 1)\n",
702690
" {\n",
703-
" for (int y = y_m; y <= y_M; y += 1)\n",
691+
" if (f[x][y] != 0)\n",
704692
" {\n",
705-
" if (f[x][y] != 0)\n",
706-
" {\n",
707-
" g[1] += 1;\n",
708-
" }\n",
693+
" g[1] += 1;\n",
709694
" }\n",
710695
" }\n",
711696
"}\n",
@@ -715,7 +700,7 @@
715700
{
716701
"data": {
717702
"text/plain": [
718-
"np.int32(10)"
703+
"10"
719704
]
720705
},
721706
"execution_count": 11,
@@ -852,7 +837,7 @@
852837
"name": "python",
853838
"nbconvert_exporter": "python",
854839
"pygments_lexer": "ipython3",
855-
"version": "3.13.11"
840+
"version": "3.11.0rc1"
856841
}
857842
},
858843
"nbformat": 4,

0 commit comments

Comments
 (0)