Skip to content

Commit

Permalink
add GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Dec 17, 2024
1 parent 7e0fa56 commit 31b08a1
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/build_zoom_backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: "Build PyTorch"

on:
workflow_dispatch:
inputs:
force_debug_with_tmate:
type: boolean
description: 'Run the build with tmate session'
required: false
default: false
debug_with_tmate:
type: boolean
description: 'Run the build with a tmate session ONLY in case of failure'
required: false
default: false
pull_request:
push:
branches:
- main

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:
build:

strategy:
fail-fast: false
matrix:
include:
- name: "ubuntu-22.04"
# runs-on: "nodai-amdgpu-mi250-x86-64"
runs-on: "nod-ai-shared-cpubuilder-manylinux-x86_64"
# container: "rocm/pytorch:rocm6.2.3_ubuntu22.04_py3.10_pytorch_release_2.3.0"

runs-on: ${{ matrix.runs-on }}

name: ${{ matrix.name }}

defaults:
run:
shell: bash

permissions:
id-token: write
contents: write

container:
image: ${{ matrix.container }}

steps:
- name: "Check out repository"
uses: actions/[email protected]
with:
submodules: true

- name: "Setup ROCm"
id: rocm
run: |
tee --append /etc/yum.repos.d/rocm.repo <<EOF
[ROCm-6.3]
name=ROCm6.3
baseurl=https://repo.radeon.com/rocm/el8/6.3/main
enabled=1
priority=50
gpgcheck=1
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
EOF
dnf clean all
dnf install -y rocm hipblas-common-devel
- name: "Build PyTorch"
id: build
run: |
pip install -r requirements.txt
./build.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}_artifact
path: dist
if-no-files-found: warn

- name: "Setup tmate session"
if: ${{ (failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate }}
uses: mxschmitt/[email protected]
with:
limit-access-to-actor: true
install-dependencies: ${{ startsWith(matrix.runs-on, 'macos') || startsWith(matrix.runs-on, 'windows') }}
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export USE_VULKAN_RELAXED_PRECISI0=0
export USE_XNNPACK=0
export USE_XPU=0

export PYTORCH_ROCM_ARCH="ggfx90a;gfx940;gfx941;gfx942;gfx1100;"
python setup.py develop
python zoom_extension/examples/test.py
PYTORCH_TEST_WITH_SLOW=1 TORCH_TEST_DEVICES=zoom_extension/test/pytorch_test_base.py ./test.sh
Expand Down

0 comments on commit 31b08a1

Please sign in to comment.