[ci] Fix example tests (#5714)

* [fix] revise timeout value on example CI

* trivial
pull/5723/head
Yuanheng Zhao 2024-05-14 16:08:51 +08:00 committed by GitHub
parent 121d7ad629
commit 5bbab1533a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View File

@ -58,7 +58,7 @@ jobs:
container:
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
options: --gpus all --rm
timeout-minutes: 20
timeout-minutes: 30
defaults:
run:
shell: bash

View File

@ -8,6 +8,7 @@ on:
# any change in the examples folder will trigger check for the corresponding example.
paths:
- "examples/**"
- "!examples/**.md"
jobs:
# This is for changed example files detect and output a matrix containing all the corresponding directory name.
@ -19,6 +20,7 @@ jobs:
outputs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}
anyChanged: ${{ steps.setup-matrix.outputs.anyChanged }}
anyExtensionFileChanged: ${{ steps.find-extension-change.outputs.any_changed }}
name: Detect changed example files
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
@ -37,6 +39,16 @@ jobs:
echo $commonCommit
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
- name: Find the changed extension-related files
id: find-extension-change
uses: tj-actions/changed-files@v35
with:
base_sha: ${{ steps.locate-base-sha.outputs.baseSHA }}
files: |
op_builder/**
colossalai/kernel/**
setup.py
- name: Get all changed example files
id: changed-files
uses: tj-actions/changed-files@v35
@ -79,17 +91,28 @@ jobs:
container:
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
timeout-minutes: 20
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-example-${{ matrix.directory }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Restore Colossal-AI Cache
if: needs.detect.outputs.anyExtensionFileChanged != 'true'
run: |
if [ -d /github/home/cuda_ext_cache ] && [ ! -z "$(ls -A /github/home/cuda_ext_cache/)" ]; then
cp -p -r /github/home/cuda_ext_cache/* /__w/ColossalAI/ColossalAI/
fi
- name: Install Colossal-AI
run: |
BUILD_EXT=1 pip install -v .
- name: Store Colossal-AI Cache
run: |
cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/
- name: Test the example
run: |
example_dir=${{ matrix.directory }}

View File

@ -36,7 +36,7 @@ jobs:
container:
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
timeout-minutes: 10
timeout-minutes: 30
steps:
- name: 📚 Checkout
uses: actions/checkout@v3