From c9cb48203cbd3a1728d427e780570d9bb9692926 Mon Sep 17 00:00:00 2001 From: Joe Schoonover Date: Wed, 10 Jun 2026 17:49:16 -0400 Subject: [PATCH] Add single-precision and MI300X variants to docker-publish workflow Extend the GitHub Actions docker-publish matrix so each published image is available in both single and double precision, and add MI300X (gfx942) as a new published target. - docker/x86_sm100/Dockerfile, docker/x86_gfx942/Dockerfile: add a SELF_DOUBLE_PRECISION build-arg (default ON) wired to the SELF_ENABLE_DOUBLE_PRECISION CMake option, so the same Dockerfile builds either precision. - docker/x86_gfx942/Dockerfile: new, modeled on the gfx90a Dockerfile, targeting gfx942 via the latest-x86-rocm643-gfx942 selfish base image. - docker-publish.yml: pass SELF_DOUBLE_PRECISION through build-args and add matrix entries. Published tags: latest-x86-cuda130-sm100 (double, unchanged) latest-x86-cuda130-sm100-sp (single, new) latest-x86-rocm643-gfx942 (double, new) latest-x86-rocm643-gfx942-sp (single, new) Existing tags are unchanged for backward compatibility; single-precision images use the -sp suffix. Each variant keeps a separate buildcache tag. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/docker-publish.yml | 17 +++++++++++++++ docker/x86_gfx942/Dockerfile | 31 ++++++++++++++++++++++++++++ docker/x86_sm100/Dockerfile | 5 +++++ 3 files changed, 53 insertions(+) create mode 100644 docker/x86_gfx942/Dockerfile diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 71f711a2e..e675dfe60 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -30,6 +30,22 @@ jobs: context: docker/x86_sm100 selfish_image: higherordermethods/selfish:latest-x86-cuda130-sm100 tag_suffix: x86-cuda130-sm100 + double_precision: "ON" + - variant: x86-cuda130-sm100-sp + context: docker/x86_sm100 + selfish_image: higherordermethods/selfish:latest-x86-cuda130-sm100 + tag_suffix: x86-cuda130-sm100-sp + double_precision: "OFF" + - variant: x86-rocm643-gfx942 + context: docker/x86_gfx942 + selfish_image: higherordermethods/selfish:latest-x86-rocm643-gfx942 + tag_suffix: x86-rocm643-gfx942 + double_precision: "ON" + - variant: x86-rocm643-gfx942-sp + context: docker/x86_gfx942 + selfish_image: higherordermethods/selfish:latest-x86-rocm643-gfx942 + tag_suffix: x86-rocm643-gfx942-sp + double_precision: "OFF" steps: - name: Checkout repository @@ -70,5 +86,6 @@ jobs: build-args: | SELFISH_IMAGE=${{ matrix.selfish_image }} SELFISH_SHA=${{ steps.selfish.outputs.sha }} + SELF_DOUBLE_PRECISION=${{ matrix.double_precision }} cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache-${{ matrix.tag_suffix }} cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache-${{ matrix.tag_suffix }},mode=max diff --git a/docker/x86_gfx942/Dockerfile b/docker/x86_gfx942/Dockerfile new file mode 100644 index 000000000..f88d2a4fa --- /dev/null +++ b/docker/x86_gfx942/Dockerfile @@ -0,0 +1,31 @@ +ARG SELFISH_IMAGE=higherordermethods/selfish:latest-x86-rocm643-gfx942 +FROM ${SELFISH_IMAGE} + +ARG SELFISH_SHA="" +LABEL org.opencontainers.image.base.name="${SELFISH_IMAGE}" +LABEL org.opencontainers.image.base.digest="${SELFISH_SHA}" + +# Floating-point precision of the build. ON -> double precision (default), +# OFF -> single precision. Maps to the SELF_ENABLE_DOUBLE_PRECISION CMake option. +ARG SELF_DOUBLE_PRECISION=ON + +COPY . /opt/self/src + +RUN source /opt/spack-environment/activate.sh && \ + mkdir -p /opt/self/build && \ + cd /opt/self/build && \ + FC=gfortran cmake \ + -DCMAKE_INSTALL_PREFIX=/opt/self/install \ + -DCMAKE_BUILD_TYPE=Release \ + -DSELF_ENABLE_GPU=ON \ + -DSELF_GPU_BACKEND=HIP \ + -DSELF_ENABLE_TESTING=ON \ + -DSELF_ENABLE_DOUBLE_PRECISION=${SELF_DOUBLE_PRECISION} \ + -DCMAKE_HIP_ARCHITECTURES="gfx942" \ + -DGPU_TARGETS="gfx942" \ + -DSELF_ENABLE_EXAMPLES=ON \ + /opt/self/src && \ + make -j$(nproc) && \ + make install + +WORKDIR /opt/self/build diff --git a/docker/x86_sm100/Dockerfile b/docker/x86_sm100/Dockerfile index 6d23cedaa..49363b38a 100644 --- a/docker/x86_sm100/Dockerfile +++ b/docker/x86_sm100/Dockerfile @@ -5,6 +5,10 @@ ARG SELFISH_SHA="" LABEL org.opencontainers.image.base.name="${SELFISH_IMAGE}" LABEL org.opencontainers.image.base.digest="${SELFISH_SHA}" +# Floating-point precision of the build. ON -> double precision (default), +# OFF -> single precision. Maps to the SELF_ENABLE_DOUBLE_PRECISION CMake option. +ARG SELF_DOUBLE_PRECISION=ON + COPY . /opt/self/src RUN source /opt/spack-environment/activate.sh && \ @@ -16,6 +20,7 @@ RUN source /opt/spack-environment/activate.sh && \ -DSELF_ENABLE_GPU=ON \ -DSELF_GPU_BACKEND=CUDA \ -DSELF_ENABLE_TESTING=ON \ + -DSELF_ENABLE_DOUBLE_PRECISION=${SELF_DOUBLE_PRECISION} \ -DCMAKE_CUDA_ARCHITECTURES="100" \ -DSELF_ENABLE_EXAMPLES=ON \ /opt/self/src && \