# Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT # Multi-Arch Build - Sharded Pipeline for Windows # # This workflow builds TheRock in stages: # 1. compiler-runtime (generic) - sysdeps, base, compiler, runtimes # 2. runtime-tests (generic) - hip-tests (parallel to math-libs) # 3. math-libs (per-arch) - BLAS, FFT, etc. # # Stages disabled on Windows: comm-libs, dctools-core, profiler-apps, media # (see BUILD_TOPOLOGY.toml disable_platforms) # # Artifacts flow between stages via S3 using the artifact_manager.py tool. name: Multi-Arch Build (Windows) on: workflow_call: inputs: artifact_group: type: string matrix_per_family_json: type: string description: "JSON array of {amdgpu_family, test-runs-on} objects for per-arch stages" dist_amdgpu_families: type: string description: "Semicolon-separated list of all GPU families for dist targets" build_variant_label: type: string build_variant_cmake_preset: type: string build_variant_suffix: type: string expect_failure: type: boolean prebuilt_stages: type: string default: "" description: "Comma-separated build stages to skip (artifacts already copied by the orchestrator)" rocm_package_version: type: string release_type: description: 'Release type: "" for CI, or "dev", "nightly", "prerelease".' type: string default: "" test_type: type: string # Temp addiiton until release type is fixed permissions: contents: read jobs: # ========================================================================== # STAGE: compiler-runtime (generic) # ========================================================================== compiler-runtime: if: ${{ !cancelled() && !failure() && !contains(inputs.prebuilt_stages, 'compiler-runtime') }} uses: ./.github/workflows/multi_arch_build_windows_artifacts.yml secrets: inherit with: stage_name: compiler-runtime stage_display_name: "Stage - Compiler Runtime" timeout_minutes: 480 # 8 hours (compiler is big) dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }} build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }} rocm_package_version: ${{ inputs.rocm_package_version }} release_type: ${{ inputs.release_type }} test_type: ${{ inputs.test_type }} permissions: contents: read id-token: write # ========================================================================== # STAGE: runtime-tests (generic, parallel to math-libs) # ========================================================================== runtime-tests: needs: compiler-runtime if: ${{ !cancelled() && !failure() && !contains(inputs.prebuilt_stages, 'runtime-tests') }} uses: ./.github/workflows/multi_arch_build_windows_artifacts.yml secrets: inherit with: stage_name: runtime-tests stage_display_name: "Stage - Runtime Tests" timeout_minutes: 120 # 2 hours dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }} build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }} rocm_package_version: ${{ inputs.rocm_package_version }} release_type: ${{ inputs.release_type }} test_type: ${{ inputs.test_type }} permissions: contents: read id-token: write # ========================================================================== # STAGE: math-libs (per-arch) # ========================================================================== math-libs: needs: compiler-runtime if: ${{ !cancelled() && !failure() && !contains(inputs.prebuilt_stages, 'math-libs') }} strategy: # `fail-fast: false` lets all families complete even if one fails. # This is useful for CI (to see all failures at once), but for releases # this risks publishing incomplete packages. Release pipelines may want # to either set `fail-fast: true` or add a validation step that blocks # promotion unless all jobs succeeded. fail-fast: false matrix: family_info: ${{ fromJSON(inputs.matrix_per_family_json) }} uses: ./.github/workflows/multi_arch_build_windows_artifacts.yml secrets: inherit with: stage_name: math-libs stage_display_name: "Stage - Math Libs (${{ matrix.family_info.amdgpu_family }})" timeout_minutes: 480 # 8 hours amdgpu_family: ${{ matrix.family_info.amdgpu_family }} dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }} build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }} rocm_package_version: ${{ inputs.rocm_package_version }} release_type: ${{ inputs.release_type }} test_type: ${{ inputs.test_type }} permissions: contents: read id-token: write