-
Notifications
You must be signed in to change notification settings - Fork 324
[TheRock CI] Adding dynamic selecting of TheRock tests #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| """ | ||
| This script determines which build flag and tests to run based on SUBTREES | ||
|
|
||
| Required environment variables: | ||
| - SUBTREES | ||
| """ | ||
|
|
||
| import json | ||
| from therock_matrix import monorepo_map | ||
| from typing import Mapping | ||
| import os | ||
|
|
||
| SUBTREES = os.getenv("SUBTREES", "") | ||
|
|
||
|
|
||
| def set_github_output(d: Mapping[str, str]): | ||
| """Sets GITHUB_OUTPUT values. | ||
| See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/passing-information-between-jobs | ||
| """ | ||
| print(f"Setting github output:\n{d}") | ||
| step_output_file = os.environ.get("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}={v}" + "\n" for k, v in d.items()) | ||
|
|
||
|
|
||
| def run(): | ||
| subtrees = SUBTREES.split("\n") | ||
| projects = [] | ||
| for subtree in subtrees: | ||
| if subtree in monorepo_map: | ||
| projects.append(monorepo_map.get(subtree)) | ||
| set_github_output({"projects": json.dumps(projects)}) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| run() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| """ | ||
| This dictionary is used to map specific file directory changes to the corresponding build flag and tests | ||
| """ | ||
| monorepo_map = { | ||
| "projects/rocprim": { | ||
| "flag": "-DTHEROCK_ENABLE_PRIM=ON -DTHEROCK_ENABLE_ALL=OFF", | ||
| "test": "test_rocprim", | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: TheRock CI | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This name is shared with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack! good catch, will update in one of the PRs |
||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| flag: | ||
|
geomin12 marked this conversation as resolved.
Outdated
|
||
| type: string | ||
| project_to_test: | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| therock-build-linux: | ||
| name: Build Linux Packages | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| uses: ROCm/TheRock/.github/workflows/build_linux_packages.yml@866f163742246445138d7addff8a4010e86bddee | ||
| with: | ||
| amdgpu_families: "gfx94X-dcgpu" | ||
| expect_failure: false | ||
| extra_cmake_options: "-DTHEROCK_USE_EXTERNAL_ROCM_LIBRARIES=ON -DTHEROCK_ROCM_LIBRARIES_SOURCE_DIR=rocm-libraries ${{ inputs.flag }}" | ||
|
geomin12 marked this conversation as resolved.
Outdated
|
||
|
|
||
| therock-test-linux: | ||
| name: "Test" | ||
| needs: [therock-build-linux] | ||
| uses: ./.github/workflows/therock-test-packages.yml | ||
| with: | ||
| project_to_test: ${{ inputs.project_to_test }} | ||
| amdgpu_families: "gfx94X-dcgpu" | ||
| test_runs_on: "linux-mi300-1gpu-ossci-rocm" | ||
| platform: "linux" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| 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: | ||
| # BLAS tests | ||
| test_hipblaslt: | ||
| name: "hipBLASLt math-lib" | ||
| if: ${{ inputs.project_to_test == 'test_hipblaslt' }} | ||
| uses: ROCm/TheRock/.github/workflows/test_hipblaslt.yml@866f163742246445138d7addff8a4010e86bddee | ||
| with: | ||
| artifact_run_id: "${{ github.run_id }}" | ||
| amdgpu_families: ${{ inputs.amdgpu_families }} | ||
| test_runs_on: ${{ inputs.test_runs_on }} | ||
| platform: ${{ inputs.platform }} | ||
|
|
||
| test_rocblas: | ||
| name: "rocBLAS math-lib" | ||
| if: ${{ inputs.project_to_test == 'test_rocblas' }} | ||
| uses: ROCm/TheRock/.github/workflows/test_rocblas.yml@866f163742246445138d7addff8a4010e86bddee | ||
| with: | ||
| artifact_run_id: "${{ github.run_id }}" | ||
| amdgpu_families: ${{ inputs.amdgpu_families }} | ||
| test_runs_on: ${{ inputs.test_runs_on }} | ||
| platform: ${{ inputs.platform }} | ||
|
|
||
| # PRIM tests | ||
| test_rocprim: | ||
| name: "rocPRIM math-lib" | ||
| if: ${{ inputs.project_to_test == 'test_rocprim' }} | ||
| uses: ROCm/TheRock/.github/workflows/test_rocprim.yml@866f163742246445138d7addff8a4010e86bddee | ||
| with: | ||
| artifact_run_id: "${{ github.run_id }}" | ||
| amdgpu_families: ${{ inputs.amdgpu_families }} | ||
| test_runs_on: ${{ inputs.test_runs_on }} | ||
| platform: ${{ inputs.platform }} | ||
|
|
||
| test_rocthrust: | ||
| name: "rocTHRUST math-lib" | ||
| if: ${{ inputs.project_to_test == 'test_rocthrust' }} | ||
| uses: ROCm/TheRock/.github/workflows/test_rocthrust.yml@866f163742246445138d7addff8a4010e86bddee | ||
| with: | ||
| artifact_run_id: "${{ github.run_id }}" | ||
| amdgpu_families: ${{ inputs.amdgpu_families }} | ||
| test_runs_on: ${{ inputs.test_runs_on }} | ||
| platform: ${{ inputs.platform }} | ||
|
|
||
| test_hipcub: | ||
| name: "hipCUB math-lib" | ||
| if: ${{ inputs.project_to_test == 'test_hipcub' }} | ||
| uses: ROCm/TheRock/.github/workflows/test_hipcub.yml@866f163742246445138d7addff8a4010e86bddee | ||
| with: | ||
| artifact_run_id: "${{ github.run_id }}" | ||
| amdgpu_families: ${{ inputs.amdgpu_families }} | ||
| test_runs_on: ${{ inputs.test_runs_on }} | ||
| platform: ${{ inputs.platform }} |

Uh oh!
There was an error while loading. Please reload this page.