Files
ColossalAI/.github/workflows/build.yml
Frank Lee f1bc2418c4 [setup] make cuda extension build optional (#2336)
* [setup] make cuda extension build optional

* polish code

* polish code

* polish code
2023-01-05 15:13:11 +08:00

77 lines
2.2 KiB
YAML

name: Build
on:
pull_request:
types: [synchronize, labeled]
jobs:
detect:
name: Detect kernel-related file change
if: |
github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' &&
contains( github.event.pull_request.labels.*.name, 'Run Build and Test')
outputs:
changedFiles: ${{ steps.find-changed-files.outputs.changedFiles }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Find the changed files
id: find-changed-files
uses: tj-actions/changed-files@v34
with:
since_last_remote_commit: true
files: |
op_builder/**
colossalai/kernel/**
setup.py
build:
name: Build and Test Colossal-AI
needs: detect
runs-on: [self-hosted, gpu]
container:
image: hpcaitech/pytorch-cuda:1.11.0-11.3.0
options: --gpus all --rm -v /data/scratch/cifar-10:/data/scratch/cifar-10
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
with:
repository: hpcaitech/TensorNVMe
ssh-key: ${{ secrets.SSH_KEY_FOR_CI }}
path: TensorNVMe
- name: Install tensornvme
run: |
cd TensorNVMe
conda install cmake
pip install -r requirements.txt
pip install -v .
- uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.SSH_KEY_FOR_CI }}
- name: Restore cache
if: needs.detect.outputs.anyChanged == 'true'
run: |
[ ! -z "$(ls -A /github/home/cuda_ext_cache/)" ] && cp -r /github/home/cuda_ext_cache/* /__w/ColossalAI/ColossalAI/
- name: Install Colossal-AI
run: |
CUDA_EXT=1 pip install -v -e .
pip install -r requirements/requirements-test.txt
- name: Unit Testing
run: |
PYTHONPATH=$PWD pytest tests
env:
DATA: /data/scratch/cifar-10
NCCL_SHM_DISABLE: 1
LD_LIBRARY_PATH: /github/home/.tensornvme/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
- name: Store Cache
run: |
cp -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/