|
8 | 8 | # any change in the examples folder will trigger check for the corresponding example.
|
9 | 9 | paths:
|
10 | 10 | - "examples/**"
|
| 11 | + - "!examples/**.md" |
11 | 12 |
|
12 | 13 | jobs:
|
13 | 14 | # This is for changed example files detect and output a matrix containing all the corresponding directory name.
|
|
19 | 20 | outputs:
|
20 | 21 | matrix: ${{ steps.setup-matrix.outputs.matrix }}
|
21 | 22 | anyChanged: ${{ steps.setup-matrix.outputs.anyChanged }}
|
| 23 | + anyExtensionFileChanged: ${{ steps.find-extension-change.outputs.any_changed }} |
22 | 24 | name: Detect changed example files
|
23 | 25 | concurrency:
|
24 | 26 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
|
|
37 | 39 | echo $commonCommit
|
38 | 40 | echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
|
39 | 41 |
|
| 42 | + - name: Find the changed extension-related files |
| 43 | + id: find-extension-change |
| 44 | + uses: tj-actions/changed-files@v35 |
| 45 | + with: |
| 46 | + base_sha: ${{ steps.locate-base-sha.outputs.baseSHA }} |
| 47 | + files: | |
| 48 | + op_builder/** |
| 49 | + colossalai/kernel/** |
| 50 | + setup.py |
| 51 | +
|
40 | 52 | - name: Get all changed example files
|
41 | 53 | id: changed-files
|
42 | 54 | uses: tj-actions/changed-files@v35
|
@@ -79,17 +91,28 @@ jobs:
|
79 | 91 | container:
|
80 | 92 | image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
|
81 | 93 | options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
|
82 |
| - timeout-minutes: 20 |
| 94 | + timeout-minutes: 30 |
83 | 95 | concurrency:
|
84 | 96 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-example-${{ matrix.directory }}
|
85 | 97 | cancel-in-progress: true
|
86 | 98 | steps:
|
87 | 99 | - uses: actions/checkout@v3
|
88 | 100 |
|
| 101 | + - name: Restore Colossal-AI Cache |
| 102 | + if: needs.detect.outputs.anyExtensionFileChanged != 'true' |
| 103 | + run: | |
| 104 | + if [ -d /github/home/cuda_ext_cache ] && [ ! -z "$(ls -A /github/home/cuda_ext_cache/)" ]; then |
| 105 | + cp -p -r /github/home/cuda_ext_cache/* /__w/ColossalAI/ColossalAI/ |
| 106 | + fi |
| 107 | +
|
89 | 108 | - name: Install Colossal-AI
|
90 | 109 | run: |
|
91 | 110 | BUILD_EXT=1 pip install -v .
|
92 | 111 |
|
| 112 | + - name: Store Colossal-AI Cache |
| 113 | + run: | |
| 114 | + cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/ |
| 115 | +
|
93 | 116 | - name: Test the example
|
94 | 117 | run: |
|
95 | 118 | example_dir=${{ matrix.directory }}
|
|
0 commit comments