This repository has been archived by the owner on Feb 7, 2025. It is now read-only.
Optimize memory pool (#6) #16
This file contains 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: 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' | |
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 |