mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-26 04:03:58 +00:00
* [legacy] remove outdated codes of pipeline (#4692) * [legacy] remove cli of benchmark and update optim (#4690) * [legacy] remove cli of benchmark and update optim * [doc] fix cli doc test * [legacy] fix engine clip grad norm * [legacy] remove outdated colo tensor (#4694) * [legacy] remove outdated colo tensor * [test] fix test import * [legacy] move outdated zero to legacy (#4696) * [legacy] clean up utils (#4700) * [legacy] clean up utils * [example] update examples * [legacy] clean up amp * [legacy] fix amp module * [legacy] clean up gpc (#4742) * [legacy] clean up context * [legacy] clean core, constants and global vars * [legacy] refactor initialize * [example] fix examples ci * [example] fix examples ci * [legacy] fix tests * [example] fix gpt example * [example] fix examples ci * [devops] fix ci installation * [example] fix examples ci
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
name: Test Example on Dispatch
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
example_directory:
|
|
type: string
|
|
description: example directory, separated by space. For example, language/gpt, images/vit. Simply input language or simply gpt does not work.
|
|
required: true
|
|
|
|
jobs:
|
|
matrix_preparation:
|
|
if: |
|
|
github.event.pull_request.draft == false &&
|
|
github.base_ref == 'main' &&
|
|
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
|
|
name: Check the examples user want
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- name: 📚 Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Set up matrix
|
|
id: set-matrix
|
|
env:
|
|
check_dir: ${{ inputs.example_directory }}
|
|
run: |
|
|
res=`python .github/workflows/scripts/example_checks/check_dispatch_inputs.py --fileNameList $check_dir`
|
|
if [ res == "failure" ];then
|
|
exit -1
|
|
fi
|
|
dirs="[${check_dir}]"
|
|
echo "Testing examples in $dirs"
|
|
echo "matrix={\"directory\":$(echo "$dirs")}" >> $GITHUB_OUTPUT
|
|
|
|
test_example:
|
|
if: |
|
|
github.event.pull_request.draft == false &&
|
|
github.base_ref == 'main' &&
|
|
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
|
|
name: Manually check example files
|
|
needs: manual_check_matrix_preparation
|
|
runs-on: [self-hosted, gpu]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{fromJson(needs.manual_check_matrix_preparation.outputs.matrix)}}
|
|
container:
|
|
image: hpcaitech/pytorch-cuda:1.12.0-11.3.0
|
|
options: --gpus all --rm -v /data/scratch/examples-data:/data/
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: 📚 Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Install Colossal-AI
|
|
run: |
|
|
CUDA_EXT=1 pip install -v .
|
|
- name: Test the example
|
|
run: |
|
|
dir=${{ matrix.directory }}
|
|
echo "Testing ${dir} now"
|
|
cd "${PWD}/examples/${dir}"
|
|
bash test_ci.sh
|
|
env:
|
|
NCCL_SHM_DISABLE: 1
|