Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

[Device][Backend] refactor: extract methods and deviceguard #13

[Device][Backend] refactor: extract methods and deviceguard

[Device][Backend] refactor: extract methods and deviceguard #13

Workflow file for this run

name: Build source
on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- 'v*'
paths:
- '.github/workflows/ci_build.yml'
- '**/*.py'
- '**/*.h'
- '**/*.cpp'
- '**/*.sh'
- '**/*.cmake'
- '**/CMakeLists.txt'
- '**/.gitmodules'
- '!**/*.md'
pull_request:
branches:
- 'main'
paths:
- '.github/workflows/ci_build.yml'
- '**/*.py'
- '**/*.h'
- '**/*.cpp'
- '**/*.sh'
- '**/*.cmake'
- '**/CMakeLists.txt'
- '**/.gitmodules'
- '!**/*.md'
release:
types:
- 'published'
concurrency:
group: '${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ !contains(github.ref, 'release/')}}
jobs:
build:
name: Build for Python${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Miniconda with Python${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: torchnpu
python-version: ${{ matrix.python-version }}
- name: Show versions
run: |
conda --version
python --version
pip --version
- name: Install dependencies
run: |
conda install -y cmake ninja
pip install -r requirements.txt
- name: Install PyTorch
run: |
pip install --index-url https://download.pytorch.org/whl/nightly/cpu \
torch==2.5.0.dev20240614 \
torchvision==0.19.0.dev20240614 \
torchaudio==2.4.0.dev20240614
- name: Compile source
run: |
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
python setup.py develop