Reduce weighted CGS and CPU multigrid operator costs #1450
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Containers | |
| # Build OCI/SIF containers. | |
| # | |
| # Non-tag events (push to main, PRs, manual dispatch) build the runner's native | |
| # microarchitecture plus a CUDA container: | |
| # - sapphirerapids (x64, c7i) | |
| # - neoverse_v1 (arm64, c7g) | |
| # - x86_64_v3_cuda (gpu, c7i) | |
| # | |
| # Release tags (vX.Y.Z) build a full microarchitecture matrix instead | |
| # (build-containers-release): | |
| # - x86_64_v3, x86_64_v4, sapphirerapids on the x64 (sapphirerapids) host | |
| # - aarch64, neoverse_v2 on the arm64-8g (neoverse_v2) host | |
| # - neoverse_v1 on the arm64 (neoverse_v1) host | |
| # - x86_64_v3_cuda on the gpu (x86_64_v3) host | |
| # Each target is at or below its host's native ISA, so build-time binaries run | |
| # on the host (no cross-compile-up). neoverse_v1 builds on its own native V1 | |
| # host: the target pin is only a preference, and on the V2 host Spack ignored it | |
| # and concretized to neoverse_v2 (publishing a V2 binary under the V1 tag). | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| # 'labeled' so adding the `push-containers` label triggers a prototype | |
| # deploy; the rest are the usual PR-build triggers. | |
| types: [opened, reopened, synchronize, labeled] | |
| # Manual run from a branch. Dispatching IS a publish request: the trusted | |
| # publish-containers workflow (which runs from `main`) authorizes it — the | |
| # actor must have write access (GitHub gates dispatch), the ref must be a | |
| # branch, and it publishes a moving `dev-<branch>` prototype. This build | |
| # workflow itself holds no credentials and makes no publish decision. | |
| workflow_dispatch: | |
| permissions: | |
| packages: write | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GITHUB_USER: ${{ github.actor }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| # Filter to allow skipping the test if no relevant changes occurred. | |
| filter: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| test: ${{ steps.filter.outputs.test }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| test: | |
| - 'palace/**' | |
| - 'cmake/**' | |
| - 'scripts/schema/**' | |
| - 'extern/**' | |
| - 'spack_repo/**' | |
| - '.github/actions/**' | |
| - '.github/workflows/containers.yml' | |
| # Non-tag events (push to main, PRs, manual dispatch): build the native CPU | |
| # containers and the CUDA container. Release tags are handled by | |
| # build-containers-release below, so this job is gated off for them. | |
| build-containers: | |
| needs: filter | |
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - {runner: arm64} | |
| - {runner: x64} | |
| - {runner: gpu, target: x86_64_v3} | |
| runs-on: [self-hosted, '${{ matrix.runner }}'] | |
| steps: | |
| # Two events bypass the paths-filter: | |
| # | |
| # - workflow_dispatch: dispatching is an explicit publish request, so it | |
| # must build regardless of what changed. | |
| # - push to main: every commit on main must produce artifacts, because the | |
| # `main` channel publishes at an exact SHA. If a docs-only push skipped | |
| # the build, its `Containers` run would still succeed and trigger a | |
| # publisher with nothing to publish — and worse, it would move `main` off | |
| # the SHA a real container build is still publishing, so that build's | |
| # re-verify would fail and the rolling channel would stay stale until the | |
| # next container change landed. The cost is three cached builds on | |
| # docs-only pushes; the benefit is that a genuine build failure on main | |
| # also shows up as a red `Containers` run. | |
| # | |
| # (Release tags are handled by build-containers-release, which has no | |
| # filter.) | |
| - uses: actions/checkout@v6 | |
| if: needs.filter.outputs.test == 'true' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' | |
| - uses: ./.github/actions/build-container | |
| if: needs.filter.outputs.test == 'true' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' | |
| with: | |
| target: ${{ matrix.target }} | |
| # Release tags (vX.Y.Z): build the full microarchitecture matrix. No paths- | |
| # filter — a tag is usually cut on a commit already on main, so the diff is | |
| # empty and the filter would skip, silently dropping the versioned publish. | |
| # Each target is at or below its host's native ISA (see header comment). | |
| build-containers-release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - {runner: x64, target: x86_64_v3} | |
| - {runner: x64, target: x86_64_v4} | |
| - {runner: x64, target: sapphirerapids} | |
| - {runner: arm64-8g, target: aarch64} | |
| - {runner: arm64, target: neoverse_v1} | |
| - {runner: arm64-8g, target: neoverse_v2} | |
| - {runner: gpu, target: x86_64_v3} | |
| runs-on: [self-hosted, '${{ matrix.runner }}'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Fetch tags so the release channel can derive the version from the ref. | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/build-container | |
| with: | |
| target: ${{ matrix.target }} |