Skip to content

Commit e8517c0

Browse files
committed
[HPU] use ref parameter instead of hardcode
1 parent b1b469b commit e8517c0

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

.github/workflows/_build_torch.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ jobs:
7272
uses: actions/checkout@v4
7373
with:
7474
repository: pytorch/pytorch
75-
# ref: ${{ inputs.ref }}
76-
ref: v2.6.0
75+
ref: ${{ inputs.ref }}
7776
submodules: recursive
7877
path: pytorch
7978

.github/workflows/_gaudi_hpu_benchmark.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ name: '_gaudi_hpu_benchmark'
44
on:
55
workflow_call:
66
inputs:
7+
ref:
8+
required: false
9+
type: string
10+
default: 'refs/heads/main'
11+
description: 'The branch, tag or SHA to checkout'
712
runner:
813
required: true
914
type: string
@@ -87,8 +92,7 @@ jobs:
8792
uses: actions/checkout@v4
8893
with:
8994
repository: pytorch/pytorch
90-
# ref: ${{ inputs.ref }}
91-
ref: v2.6.0
95+
ref: ${{ inputs.ref }}
9296
submodules: recursive
9397
path: pytorch
9498

.github/workflows/_gaudi_hpu_ut.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ name: '_gaudi_hpu_ut'
44
on:
55
workflow_call:
66
inputs:
7+
ref:
8+
required: false
9+
type: string
10+
default: 'refs/heads/main'
11+
description: 'The branch, tag or SHA to checkout'
712
runner:
813
required: true
914
type: string
@@ -87,8 +92,7 @@ jobs:
8792
uses: actions/checkout@v4
8893
with:
8994
repository: pytorch/pytorch
90-
# ref: ${{ inputs.ref }}
91-
ref: v2.6.0
95+
ref: ${{ inputs.ref }}
9296
submodules: recursive
9397
path: pytorch
9498

.github/workflows/gaudi_hpu_test.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,22 @@ jobs:
8787
- name: Set environment params
8888
id: set-env
8989
run: |
90-
echo "runner=${{ github.event.ihputs.runner || 'linux-gaudi3' }}" >> $GITHUB_OUTPUT
91-
echo "device=${{ github.event.ihputs.device || '0' }}" >> $GITHUB_OUTPUT
92-
echo "image=${{ github.event.ihputs.image || 'vault.habana.ai/gaudi-docker/1.20.0/ubuntu24.04/habanalabs/pytorch-installer-2.6.0:latest' }}" >> $GITHUB_OUTPUT
90+
echo "runner=${{ github.event.inputs.runner || 'linux-gaudi3' }}" >> $GITHUB_OUTPUT
91+
echo "device=${{ github.event.inputs.device || '0' }}" >> $GITHUB_OUTPUT
92+
echo "image=${{ github.event.inputs.image || 'vault.habana.ai/gaudi-docker/1.20.0/ubuntu24.04/habanalabs/pytorch-installer-2.6.0:latest' }}" >> $GITHUB_OUTPUT
9393
9494
- name: List ref to the PyTorch branch
9595
id: list-ref
96-
if: ${{ github.event_name == 'repository_dispatch' }}
9796
run: |
98-
echo "ref=${{ github.event.client_payload.ref }}" >> $GITHUB_OUTPUT
99-
echo "sha=${{ github.event.client_payload.sha }}" >> $GITHUB_OUTPUT
97+
if ${{ github.event_name == 'repository_dispatch' }}; then
98+
echo "ref=${{ github.event.client_payload.ref }}" >> $GITHUB_OUTPUT
99+
echo "sha=${{ github.event.client_payload.sha }}" >> $GITHUB_OUTPUT
100+
else
101+
ref=refs/heads/main
102+
echo "ref=$ref" >> $GITHUB_OUTPUT
103+
echo "sha=$(git ls-remote -h https://github.com/pytorch/pytorch.git $ref | awk '{print $1}')" >> $GITHUB_OUTPUT
104+
fi
105+
100106
101107
build-torch:
102108
name: Build torch
@@ -107,6 +113,7 @@ jobs:
107113
with:
108114
runner: ${{ needs.prepare.outputs.runner }}
109115
image: ${{ needs.prepare.outputs.image }}
116+
ref: ${{ needs.prepare.outputs.ref }}
110117

111118

112119
build:
@@ -133,6 +140,7 @@ jobs:
133140
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success'))
134141
uses: ./.github/workflows/_gaudi_hpu_ut.yml
135142
with:
143+
ref: ${{ needs.prepare.outputs.ref }}
136144
runner: ${{ needs.prepare.outputs.runner }}
137145
image: ${{ needs.prepare.outputs.image }}
138146
device: ${{ needs.prepare.outputs.device }}
@@ -152,6 +160,7 @@ jobs:
152160
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success'))
153161
uses: ./.github/workflows/_gaudi_hpu_benchmark.yml
154162
with:
163+
ref: ${{ needs.prepare.outputs.ref }}
155164
runner: ${{ needs.prepare.outputs.runner }}
156165
image: ${{ needs.prepare.outputs.image }}
157166
device: ${{ needs.prepare.outputs.device }}

0 commit comments

Comments
 (0)