diff --git a/.github/scripts/therock_configure_ci.py b/.github/scripts/therock_configure_ci.py deleted file mode 100644 index c892941fc6..0000000000 --- a/.github/scripts/therock_configure_ci.py +++ /dev/null @@ -1,146 +0,0 @@ -# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. -# SPDX-License-Identifier: MIT - -import fnmatch -import json -import os -from pathlib import Path -import subprocess -import sys -from typing import Iterable, Optional, Mapping - - -def gha_set_output(vars: Mapping[str, str | Path]): - """Sets values in a step's output parameters. - - This appends to the file located at the $GITHUB_OUTPUT environment variable. - - See - * https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter - * https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/passing-information-between-jobs - """ - print(f"Setting github output:\n{vars}") - - step_output_file = os.getenv("GITHUB_OUTPUT") - if not step_output_file: - print(" Warning: GITHUB_OUTPUT env var not set, can't set github outputs") - return - - with open(step_output_file, "a") as f: - f.writelines(f"{k}={str(v)}" + "\n" for k, v in vars.items()) - - -def get_modified_paths(base_ref: str) -> Optional[Iterable[str]]: - """Returns the paths of modified files relative to the base reference.""" - try: - return subprocess.run( - ["git", "diff", "--name-only", base_ref], - stdout=subprocess.PIPE, - check=True, - text=True, - timeout=60, - ).stdout.splitlines() - except TimeoutError: - print( - "Computing modified files timed out. Not using PR diff to determine" - " jobs to run.", - file=sys.stderr, - ) - return None - - -GITHUB_WORKFLOWS_CI_PATTERNS = [ - "therock*", -] - - -def is_path_workflow_file_related_to_ci(path: str) -> bool: - return any( - fnmatch.fnmatch(path, ".github/workflows/" + pattern) - for pattern in GITHUB_WORKFLOWS_CI_PATTERNS - ) or any( - fnmatch.fnmatch(path, ".github/scripts/" + pattern) - for pattern in GITHUB_WORKFLOWS_CI_PATTERNS - ) - - -def check_for_workflow_file_related_to_ci(paths: Optional[Iterable[str]]) -> bool: - if paths is None: - return False - return any(is_path_workflow_file_related_to_ci(p) for p in paths) - - -# Paths matching any of these patterns are considered to have no influence over -# build or test workflows so any related jobs can be skipped if all paths -# modified by a commit/PR match a pattern in this list. -SKIPPABLE_PATH_PATTERNS = [ - "docs/*", - "*.gitignore", - "*.md", - "*.pre-commit-config.*", - "*LICENSE", - "Jenkinsfile", - ".github/ISSUE_TEMPLATE/*", - ".github/CODEOWNERS", - ".github/*.md", - ".github/dependabot.yml", -] - - -def is_path_skippable(path: str) -> bool: - """Determines if a given relative path to a file matches any skippable patterns.""" - return any(fnmatch.fnmatch(path, pattern) for pattern in SKIPPABLE_PATH_PATTERNS) - - -def check_for_non_skippable_path(paths: Optional[Iterable[str]]) -> bool: - """Returns true if at least one path is not in the skippable set.""" - if paths is None: - return False - return any(not is_path_skippable(p) for p in paths) - - -def should_ci_run_given_modified_paths(paths: Optional[Iterable[str]]) -> bool: - """Returns true if CI workflows should run given a list of modified paths.""" - - if paths is None: - print("No files were modified, skipping TheRock CI jobs") - return False - - paths_set = set(paths) - github_workflows_paths = set( - [p for p in paths if p.startswith(".github/workflows")] - ) - other_paths = paths_set - github_workflows_paths - - related_to_ci = check_for_workflow_file_related_to_ci(github_workflows_paths) - contains_other_non_skippable_files = check_for_non_skippable_path(other_paths) - - print("should_ci_run_given_modified_paths findings:") - print(f" contains_other_non_skippable_files: {contains_other_non_skippable_files}") - - if related_to_ci: - print("Enabling build jobs since a related workflow file was modified") - return True - elif contains_other_non_skippable_files: - print("Enabling TheRock CI jobs since a non-skippable path was modified") - return True - else: - print( - "Only unrelated and/or skippable paths were modified, skipping TheRock CI jobs" - ) - return False - - -def main(args): - base_ref = args.get("base_ref") - modified_paths = get_modified_paths(base_ref) - print("modified_paths (max 200):", modified_paths[:200]) - enable_jobs = should_ci_run_given_modified_paths(modified_paths) - output = {"enable_therock_ci": json.dumps(enable_jobs)} - gha_set_output(output) - - -if __name__ == "__main__": - args = {} - args["base_ref"] = os.environ.get("BASE_REF", "HEAD^1") - main(args) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 16f7e2539c..0000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: [develop] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - with: - python-version: '3.12' - - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/therock-ci-linux.yml b/.github/workflows/therock-ci-linux.yml deleted file mode 100644 index cc6178b08c..0000000000 --- a/.github/workflows/therock-ci-linux.yml +++ /dev/null @@ -1,146 +0,0 @@ -name: TheRock CI Linux - -on: - workflow_call: - inputs: - cmake_options: - type: string - amdgpu_families: - type: string - test_runs_on: - type: string - -permissions: - contents: read - -jobs: - therock-build-linux: - name: Build Linux Packages - runs-on: azure-linux-scale-rocm - permissions: - id-token: write - container: - image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:583d473f263a289222c48d4b493e2956b2354a45796f09dee6f2c8ecd4504ab6 - options: -v /runner/config:/home/awsconfig/ - env: - AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }} - TEATIME_FORCE_INTERACTIVE: 0 - AWS_SHARED_CREDENTIALS_FILE: /home/awsconfig/credentials.ini - CACHE_DIR: ${{ github.workspace }}/.container-cache - # The ccache.conf will be written by setup_ccache.py before this gets used. - CCACHE_CONFIGPATH: ${{ github.workspace }}/.ccache/ccache.conf - steps: - - name: "Checking out repository for rocm-libraries" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: "ROCm/rocm-libraries" - - - name: Pull DVC files for rocm-libraries # LOGNAME details here https://github.com/ROCm/rocm-libraries/pull/1617 - run: | - if command -v dvc &> /dev/null; then - echo "dvc detected" - else - echo "Warning, dvc not detected!" - fi - LOGNAME=github-runner dvc pull -v - - - name: Checkout composable_kernel repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - path: "composable_kernel" - - - name: Checkout TheRock repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: "ROCm/TheRock" - path: "TheRock" - ref: e4d4316c3c20819045722f60fc63928944ebc397 # 2026-01-01 commit - - - name: Setup ccache - run: | - ./TheRock/build_tools/setup_ccache.py \ - --config-preset "github-oss-presubmit" \ - --dir "$(dirname $CCACHE_CONFIGPATH)" \ - --local-path "$CACHE_DIR/ccache" - echo "namespace = ext_composable_kernel" >> $CCACHE_CONFIGPATH - echo "[*] ccache_config contents:" - cat $CCACHE_CONFIGPATH - - - name: Runner Health Settings - run: | - ./TheRock/build_tools/health_status.py - - - name: Fetch sources - run: | - ./TheRock/build_tools/fetch_sources.py --jobs 12 --no-include-rocm-libraries --no-include-ml-frameworks - - - name: Patch rocm-libraries - run: | - git config --global --add safe.directory '*' - # Remove patches here if they cannot be applied cleanly, and they have not been deleted from TheRock repo - rm ./TheRock/patches/amd-mainline/rocm-libraries/0003-Find-rocm_smi-via-config-files.patch - rm ./TheRock/patches/amd-mainline/rocm-libraries/0007-Remove-Windows-third_party_dlls-copying-code.patch - # git -c user.name="therockbot" -c "user.email=therockbot@amd.com" am --whitespace=nowarn ./TheRock/patches/amd-mainline/rocm-libraries/*.patch - - - name: Install python deps - run: | - pip install -r TheRock/requirements.txt - pip freeze - - - name: Configure Projects - env: - amdgpu_families: ${{ env.AMDGPU_FAMILIES }} - package_version: ADHOCBUILD - extra_cmake_options: ${{ inputs.cmake_options }} - BUILD_DIR: build - run: | - python3 TheRock/build_tools/github_actions/build_configure.py - - - name: Build TheRock - run: cmake --build TheRock/build - - - name: Build therock-archives - run: cmake --build TheRock/build --target therock-archives - - - name: Report - if: ${{ !cancelled() }} - run: | - echo "Full SDK du:" - echo "------------" - du -h -d 1 TheRock/build/dist/rocm - echo "Artifact Archives:" - echo "------------------" - ls -lh TheRock/build/artifacts/*.tar.xz - echo "Artifacts:" - echo "----------" - du -h -d 1 TheRock/build/artifacts - echo "CCache Stats:" - echo "-------------" - ccache -s -v - tail -v -n +1 .ccache/compiler_check_cache/* > TheRock/build/logs/ccache_compiler_check_cache.log - - - name: Configure AWS Credentials for non-forked repos - if: ${{ always() && !github.event.pull_request.head.repo.fork }} - uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1 - with: - aws-region: us-east-2 - role-to-assume: arn:aws:iam::692859939525:role/therock-artifacts-external - - - name: Post Build Upload - if: always() - run: | - python3 TheRock/build_tools/github_actions/post_build_upload.py \ - --run-id ${{ github.run_id }} \ - --artifact-group ${{ env.AMDGPU_FAMILIES }} \ - --build-dir TheRock/build \ - --upload - - therock-test-linux: - name: "Test" - needs: [therock-build-linux] - uses: ./.github/workflows/therock-test-packages.yml - with: - project_to_test: "miopen" - amdgpu_families: ${{ inputs.amdgpu_families }} - test_runs_on: ${{ inputs.test_runs_on }} - platform: "linux" diff --git a/.github/workflows/therock-ci.yml b/.github/workflows/therock-ci.yml deleted file mode 100644 index 0951244f31..0000000000 --- a/.github/workflows/therock-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: TheRock CI for composable_kernel - -on: - push: - branches: - - develop - workflow_dispatch: - pull_request: - types: - - opened - - synchronize - branches: - - mainline - - release/* - - release-staging/* - - develop - -permissions: - contents: read - -concurrency: - # A PR number if a pull request and otherwise the commit hash. This cancels - # queued and in-progress runs for the same PR (presubmit) or commit - # (postsubmit). The workflow name is prepended to avoid conflicts between - # different workflows. - group: ${{ github.workflow }}-${{ github.event.number || github.sha }} - cancel-in-progress: true - -jobs: - setup: - runs-on: ubuntu-24.04 - env: - # The commit being checked out is the merge commit for a PR. Its first - # parent will be the tip of the base branch. - BASE_REF: HEAD^ - outputs: - enable_therock_ci: ${{ steps.configure.outputs.enable_therock_ci }} - steps: - - name: "Checking out repository" - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - # We need the parent commit to do a diff - fetch-depth: 2 - - - name: "Configuring CI options" - id: configure - run: python .github/scripts/therock_configure_ci.py - - therock-ci-linux: - name: TheRock CI Linux - needs: setup - if: ${{ needs.setup.outputs.enable_therock_ci == 'true' }} - permissions: - contents: read - id-token: write - uses: ./.github/workflows/therock-ci-linux.yml - secrets: inherit - with: - cmake_options: >- - -DTHEROCK_ENABLE_COMPOSABLE_KERNEL=ON - -DTHEROCK_ENABLE_MIOPEN=ON - -DTHEROCK_ENABLE_ALL=OFF - -DTHEROCK_USE_EXTERNAL_COMPOSABLE_KERNEL=ON - -DTHEROCK_COMPOSABLE_KERNEL_SOURCE_DIR=../composable_kernel - -DTHEROCK_USE_EXTERNAL_ROCM_LIBRARIES=ON - -DTHEROCK_ROCM_LIBRARIES_SOURCE_DIR=../ - amdgpu_families: "gfx94X-dcgpu" - test_runs_on: "linux-mi325-1gpu-ossci-rocm-frac" - - therock_ci_summary: - name: TheRock CI Summary - if: always() - needs: - - setup - - therock-ci-linux - runs-on: ubuntu-24.04 - steps: - - name: Output failed jobs - run: | - echo '${{ toJson(needs) }}' - FAILED_JOBS="$(echo '${{ toJson(needs) }}' \ - | jq --raw-output \ - 'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \ - )" - if [[ "${FAILED_JOBS}" != "" ]]; then - echo "The following jobs failed: ${FAILED_JOBS}" - exit 1 - fi diff --git a/.github/workflows/therock-test-component.yml b/.github/workflows/therock-test-component.yml deleted file mode 100644 index 8c1e94bc89..0000000000 --- a/.github/workflows/therock-test-component.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Test component - -on: - workflow_call: - inputs: - artifact_run_id: - type: string - default: "" - amdgpu_families: - type: string - test_runs_on: - type: string - platform: - type: string - component: - type: string - - -permissions: - contents: read - -jobs: - test_component: - name: 'Test ${{ fromJSON(inputs.component).job_name }} (shard ${{ matrix.shard }} of ${{ fromJSON(inputs.component).total_shards }})' - runs-on: ${{ inputs.test_runs_on }} - container: - image: ${{ inputs.platform == 'linux' && 'ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:4150afe4759d14822f0e3f8930e1124f26e11f68b5c7b91ec9a02b20b1ebbb98' || null }} - options: --ipc host - --group-add video - --device /dev/kfd - --device /dev/dri - --group-add 992 - --group-add 110 - --env-file /etc/podinfo/gha-gpu-isolation-settings - strategy: - fail-fast: false - matrix: - # The shard array is based on "total_shards" from "fetch_test_configurations.py" - # The test executable will shard based on the array. (ex: [1, 2, 3, 4] = four test shards) - shard: ${{ fromJSON(inputs.component).shard_arr }} - defaults: - run: - shell: bash - env: - VENV_DIR: ${{ github.workspace }}/.venv - ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}" - OUTPUT_ARTIFACTS_DIR: "./build" - THEROCK_BIN_DIR: "./build/bin" - AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }} - steps: - - name: Checkout Repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - repository: "ROCm/TheRock" - ref: e4d4316c3c20819045722f60fc63928944ebc397 # 2026-01-01 commit - - - name: Run setup test environment workflow - uses: './.github/actions/setup_test_environment' - with: - ARTIFACT_RUN_ID: ${{ env.ARTIFACT_RUN_ID }} - ARTIFACT_GROUP: ${{ inputs.amdgpu_families }} - OUTPUT_ARTIFACTS_DIR: ${{ env.OUTPUT_ARTIFACTS_DIR }} - VENV_DIR: ${{ env.VENV_DIR }} - FETCH_ARTIFACT_ARGS: ${{ fromJSON(inputs.component).fetch_artifact_args }} - IS_PR_FROM_FORK: ${{ github.event.pull_request.head.repo.fork }} - - - name: Test - timeout-minutes: ${{ fromJSON(inputs.component).timeout_minutes }} - env: - SHARD_INDEX: ${{ matrix.shard }} - TOTAL_SHARDS: ${{ fromJSON(inputs.component).total_shards }} - run: | - ${{ fromJSON(inputs.component).test_script }} diff --git a/.github/workflows/therock-test-packages.yml b/.github/workflows/therock-test-packages.yml deleted file mode 100644 index e4bd295c95..0000000000 --- a/.github/workflows/therock-test-packages.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: TheRock Test Packages - -on: - workflow_call: - inputs: - project_to_test: - type: string - amdgpu_families: - type: string - test_runs_on: - type: string - platform: - type: string - -permissions: - contents: read - -jobs: - configure_test_matrix: - name: "Configure test matrix" - runs-on: ubuntu-24.04 - if: ${{ inputs.test_runs_on != '' }} - outputs: - components: ${{ steps.configure.outputs.components }} - steps: - - name: "Checking out repository" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: "ROCm/TheRock" - ref: e4d4316c3c20819045722f60fc63928944ebc397 # 2026-01-01 commit - - - name: "Configuring CI options" - env: - PLATFORM: ${{ inputs.platform }} - project_to_test: ${{ inputs.project_to_test }} - id: configure - run: python ./build_tools/github_actions/fetch_test_configurations.py - - test_components: - name: 'Test ${{ matrix.components.job_name }}' - needs: [configure_test_matrix] - # skip tests if no test matrix to run - if: ${{ needs.configure_test_matrix.outputs.components != '[]' }} - strategy: - fail-fast: false - matrix: - components: ${{ fromJSON(needs.configure_test_matrix.outputs.components) }} - uses: './.github/workflows/therock-test-component.yml' - with: - artifact_run_id: ${{ github.run_id }} - amdgpu_families: ${{ inputs.amdgpu_families }} - test_runs_on: ${{ inputs.test_runs_on }} - platform: ${{ inputs.platform }} - component: ${{ toJSON(matrix.components) }}