Gaudi HPU Test Suite #202
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Gaudi HPU Test Suite' | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '.github/workflows/gaudi_hpu_test.yml' | |
- '.github/workflows/_gaudi_hpu_build_torch.yml' | |
- '.github/workflows/_gaudi_hpu_build_torch_hpu.yml' | |
- '.github/workflows/_gaudi_hpu_ut.yml' | |
- '.github/workflows/_gaudi_hpu_benchmark.yml' | |
- '.ci/**' | |
- 'gaudi_hpu/**' | |
- 'src/**' | |
- '!**/*.md' | |
pull_request: | |
branches: | |
- 'main' | |
paths: | |
- '.github/workflows/gaudi_hpu_test.yml' | |
- '.github/workflows/_gaudi_hpu_build_torch.yml' | |
- '.github/workflows/_gaudi_hpu_build_torch_hpu.yml' | |
- '.github/workflows/_gaudi_hpu_ut.yml' | |
- '.github/workflows/_gaudi_hpu_benchmark.yml' | |
- '.ci/**' | |
- 'gaudi_hpu/**' | |
- 'src/**' | |
- '!**/*.md' | |
release: | |
types: | |
- 'published' | |
schedule: | |
- cron: '0 12 * * *' | |
repository_dispatch: | |
types: [pytorch-nightly-event-dispatch] | |
workflow_dispatch: | |
inputs: | |
runner: | |
required: true | |
type: choice | |
options: | |
- linux-gaudi3 | |
- linux-gaudi3-0 | |
- linux-gaudi3-1 | |
default: 'linux-gaudi3' | |
description: 'The runner selected to run on' | |
image: | |
required: true | |
type: choice | |
options: | |
- vault.habana.ai/gaudi-docker/1.21.0/ubuntu24.04/habanalabs/pytorch-installer-2.6.0:latest | |
- vault.habana.ai/gaudi-docker/1.20.0/ubuntu24.04/habanalabs/pytorch-installer-2.6.0:latest | |
- vault.habana.ai/gaudi-docker/1.19.2/ubuntu22.04/habanalabs/pytorch-installer-2.5.1:latest | |
default: 'vault.habana.ai/gaudi-docker/1.21.0/ubuntu24.04/habanalabs/pytorch-installer-2.6.0:latest' | |
description: 'The docker image which will be loaded' | |
device: | |
required: true | |
type: choice | |
# TODO: Need modify for hpu | |
options: | |
- 1 | |
- 2 | |
- 3 | |
- 4 | |
- 5 | |
- 6 | |
- 7 | |
- 8 | |
default: '0' | |
description: 'The device selected to run on' | |
skip_run: | |
required: true | |
type: boolean | |
default: true | |
description: 'Skip the run of the workflow' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
prepare: | |
name: Prepare | |
if: ${{ github.event.inputs.skip_run == 'false' }} | |
runs-on: ubuntu-latest | |
env: | |
REL_VERSION: "1.21.0" | |
outputs: | |
runner: ${{ steps.set-env.outputs.runner }} | |
image: ${{ steps.set-env.outputs.image }} | |
device: ${{ steps.set-env.outputs.device }} | |
rel_ver: ${{ steps.set-env.outputs.rel_ver }} | |
ref: ${{ steps.list-ref.outputs.ref }} | |
pr-number: ${{ steps.list-ref.outputs.pr_number }} | |
steps: | |
- name: Set environment params | |
id: set-env | |
run: | | |
echo "runner=${{ github.event.inputs.runner || 'linux-gaudi3' }}" >> $GITHUB_OUTPUT | |
echo "device=${{ github.event.inputs.device || '0' }}" >> $GITHUB_OUTPUT | |
echo "image=${{ github.event.inputs.image || 'vault.habana.ai/gaudi-docker/1.21.0/ubuntu24.04/habanalabs/pytorch-installer-2.6.0:latest' }}" >> $GITHUB_OUTPUT | |
echo "rel_ver=$REL_VERSION" >> $GITHUB_OUTPUT | |
- name: List ref to the PyTorch branch | |
id: list-ref | |
run: | | |
if ${{ github.event_name == 'repository_dispatch' }}; then | |
echo "ref=${{ github.event.client_payload.ref }}" >> $GITHUB_OUTPUT | |
echo "sha=${{ github.event.client_payload.sha }}" >> $GITHUB_OUTPUT | |
else | |
ref=refs/heads/release/2.6 | |
echo "ref=$ref" >> $GITHUB_OUTPUT | |
echo "sha=$(git ls-remote -h https://github.com/pytorch/pytorch.git $ref | awk '{print $1}')" >> $GITHUB_OUTPUT | |
fi | |
build-torch: | |
name: Build torch | |
needs: | |
- prepare | |
if: ${{ github.event.inputs.skip_run == 'false' }} | |
# if: ${{ needs.prepare.outputs.ref }} | |
uses: ./.github/workflows/_build_torch.yml | |
with: | |
runner: ${{ needs.prepare.outputs.runner }} | |
image: ${{ needs.prepare.outputs.image }} | |
ref: ${{ needs.prepare.outputs.ref }} | |
build: | |
name: Build torch_hpu | |
needs: | |
- prepare | |
- build-torch | |
if: ${{ !cancelled() && (success() || needs.build-torch.result == 'skipped') && github.event.inputs.skip_run == 'false' }} | |
uses: ./.github/workflows/_gaudi_hpu_build_torch_hpu.yml | |
with: | |
runner: ${{ needs.prepare.outputs.runner }} | |
image: ${{ needs.prepare.outputs.image }} | |
device: ${{ needs.prepare.outputs.device }} | |
torch-artifact: ${{ needs.build-torch.outputs.torch-artifact }} | |
rel_ver: ${{ needs.prepare.outputs.rel_ver }} | |
test: | |
name: Test torch_hpu | |
needs: | |
- prepare | |
- build-torch | |
- build | |
if: | | |
!cancelled() && github.event_name != 'repository_dispatch' && | |
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) && | |
github.event.inputs.skip_run == 'false' | |
uses: ./.github/workflows/_gaudi_hpu_ut.yml | |
with: | |
ref: ${{ needs.prepare.outputs.ref }} | |
runner: ${{ needs.prepare.outputs.runner }} | |
image: ${{ needs.prepare.outputs.image }} | |
device: ${{ needs.prepare.outputs.device }} | |
torch-artifact: ${{ needs.build-torch.outputs.torch-artifact }} | |
torch-hpu-artifact: ${{ needs.build.outputs.torch-hpu-artifact }} | |
torch-hpu-dl-artifact: ${{ needs.build.outputs.torch-hpu-dl-artifact }} | |
rel_ver: ${{ needs.prepare.outputs.rel_ver }} | |
benchmark: | |
name: Run benchmarks | |
needs: | |
- prepare | |
- build-torch | |
- build | |
- test | |
if: | | |
!cancelled() && github.event_name != 'repository_dispatch' && | |
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) && | |
github.event.inputs.skip_run == 'false' | |
uses: ./.github/workflows/_gaudi_hpu_benchmark.yml | |
with: | |
ref: ${{ needs.prepare.outputs.ref }} | |
runner: ${{ needs.prepare.outputs.runner }} | |
image: ${{ needs.prepare.outputs.image }} | |
device: ${{ needs.prepare.outputs.device }} | |
torch-artifact: ${{ needs.build-torch.outputs.torch-artifact }} | |
torch-hpu-artifact: ${{ needs.build.outputs.torch-hpu-artifact }} | |
torch-hpu-dl-artifact: ${{ needs.build.outputs.torch-hpu-dl-artifact }} | |
rel_ver: ${{ needs.prepare.outputs.rel_ver }} |