Skip to content

Commit 87ddf70

Browse files
authored
[ci] Adding rocm-less docker image for tests (ROCm#1218)
Ensuring that the tests work without ROCm and get ROCm from `TheRock`, this PR ensures this! Changes: - Adding container for pytorch tests and CI tests - Doing some organization for workflows, to ensure that sanity checks is indeed checking from TheRock PyTorch run: https://github.com/ROCm/TheRock/actions/runs/16951040104/job/48043659985
1 parent bc413b6 commit 87ddf70

File tree

4 files changed

+43
-14
lines changed

4 files changed

+43
-14
lines changed

.github/workflows/test_packages.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,14 @@ on:
2424
- ADHOCBUILD
2525

2626
jobs:
27-
test_sanity_check:
28-
name: 'Test Sanity Check'
29-
if: ${{ inputs.test_runs_on != '' }} # if there is a test machine available
30-
uses: './.github/workflows/test_sanity_check.yml'
31-
with:
32-
artifact_run_id: ${{ inputs.artifact_run_id }}
33-
amdgpu_families: ${{ inputs.amdgpu_families }}
34-
test_runs_on: ${{ inputs.test_runs_on }}
35-
3627
configure_test_matrix:
3728
name: "Configure test matrix"
38-
needs: test_sanity_check
29+
# if there is a test machine available
30+
if: ${{ inputs.test_runs_on != '' }}
3931
runs-on: ${{ inputs.test_runs_on }}
4032
outputs:
4133
components: ${{ steps.configure.outputs.components }}
34+
platform: ${{ steps.configure.outputs.platform }}
4235
steps:
4336
- name: "Checking out repository"
4437
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -52,10 +45,28 @@ jobs:
5245
id: configure
5346
run: python ./build_tools/github_actions/fetch_test_configurations.py
5447

48+
test_sanity_check:
49+
name: 'Test Sanity Check'
50+
needs: configure_test_matrix
51+
uses: './.github/workflows/test_sanity_check.yml'
52+
with:
53+
artifact_run_id: ${{ inputs.artifact_run_id }}
54+
amdgpu_families: ${{ inputs.amdgpu_families }}
55+
test_runs_on: ${{ inputs.test_runs_on }}
56+
platform: ${{ needs.configure_test_matrix.outputs.platform }}
57+
5558
test_components:
5659
name: 'Test ${{ matrix.components.job_name }}'
5760
runs-on: ${{ inputs.test_runs_on }}
58-
needs: configure_test_matrix
61+
container:
62+
image: ${{ needs.configure_test_matrix.outputs.platform == 'linux' && 'ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:405945a40deaff9db90b9839c0f41d4cba4a383c1a7459b28627047bf6302a26' || null }}
63+
options: --ipc host
64+
--group-add video
65+
--device /dev/kfd
66+
--device /dev/dri
67+
--group-add 992
68+
--env-file /etc/podinfo/gha-gpu-isolation-settings
69+
needs: [test_sanity_check, configure_test_matrix]
5970
# skip tests if no test matrix to run
6071
if: ${{ needs.configure_test_matrix.outputs.components != '[]' }}
6172
strategy:

.github/workflows/test_pytorch_wheels.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ jobs:
5757
test_wheels:
5858
name: Test PyTorch Wheels | ${{ inputs.amdgpu_family }}
5959
runs-on: ${{ inputs.test_runs_on }}
60+
container:
61+
image: ${{ contains(inputs.test_runs_on, 'linux') && 'ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:405945a40deaff9db90b9839c0f41d4cba4a383c1a7459b28627047bf6302a26' || null }}
62+
options: --ipc host
63+
--group-add video
64+
--device /dev/kfd
65+
--device /dev/dri
66+
--group-add 992
67+
--env-file /etc/podinfo/gha-gpu-isolation-settings
6068
defaults:
6169
run:
6270
shell: bash

.github/workflows/test_sanity_check.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
default: ""
1212
test_runs_on:
1313
type: string
14+
platform:
15+
type: string
1416
workflow_call:
1517
inputs:
1618
artifact_run_id:
@@ -21,6 +23,8 @@ on:
2123
default: ""
2224
test_runs_on:
2325
type: string
26+
platform:
27+
type: string
2428
push:
2529
branches:
2630
- ADHOCBUILD
@@ -32,8 +36,14 @@ jobs:
3236
test_sanity_check:
3337
name: "Sanity ROCM Test"
3438
runs-on: ${{ inputs.test_runs_on }}
35-
strategy:
36-
fail-fast: false
39+
container:
40+
image: ${{ inputs.platform == 'linux' && 'ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:405945a40deaff9db90b9839c0f41d4cba4a383c1a7459b28627047bf6302a26' || null }}
41+
options: --ipc host
42+
--group-add video
43+
--device /dev/kfd
44+
--device /dev/dri
45+
--group-add 992
46+
--env-file /etc/podinfo/gha-gpu-isolation-settings
3747
defaults:
3848
run:
3949
shell: bash

build_tools/github_actions/fetch_test_configurations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def run():
130130
logging.info(f"Including job {job_name}")
131131
output_matrix.append(test_matrix[key])
132132

133-
gha_set_output({"components": json.dumps(output_matrix)})
133+
gha_set_output({"components": json.dumps(output_matrix), "platform": platform})
134134

135135

136136
if __name__ == "__main__":

0 commit comments

Comments
 (0)