Skip to content

Commit df67476

Browse files
[Colossal-Inference] (v0.1.0) Merge pull request #5739 from hpcaitech/feature/colossal-infer
[Inference] Merge feature/colossal-infer
2 parents 22ce873 + 498f42c commit df67476

File tree

226 files changed

+20482
-9722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+20482
-9722
lines changed

.github/workflows/build_on_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
container:
9292
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
9393
options: --gpus all --rm -v /dev/shm -v /data/scratch/llama-tiny:/data/scratch/llama-tiny
94-
timeout-minutes: 60
94+
timeout-minutes: 90
9595
defaults:
9696
run:
9797
shell: bash
@@ -140,7 +140,7 @@ jobs:
140140
141141
- name: Install Colossal-AI
142142
run: |
143-
pip install -v -e .
143+
BUILD_EXT=1 pip install -v -e .
144144
pip install -r requirements/requirements-test.txt
145145
146146
- name: Store Colossal-AI Cache

.github/workflows/doc_test_on_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
container:
5959
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
6060
options: --gpus all --rm
61-
timeout-minutes: 20
61+
timeout-minutes: 30
6262
defaults:
6363
run:
6464
shell: bash

.github/workflows/example_check_on_pr.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
# any change in the examples folder will trigger check for the corresponding example.
99
paths:
1010
- "examples/**"
11+
- "!examples/**.md"
1112

1213
jobs:
1314
# This is for changed example files detect and output a matrix containing all the corresponding directory name.
@@ -19,6 +20,7 @@ jobs:
1920
outputs:
2021
matrix: ${{ steps.setup-matrix.outputs.matrix }}
2122
anyChanged: ${{ steps.setup-matrix.outputs.anyChanged }}
23+
anyExtensionFileChanged: ${{ steps.find-extension-change.outputs.any_changed }}
2224
name: Detect changed example files
2325
concurrency:
2426
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
@@ -37,6 +39,16 @@ jobs:
3739
echo $commonCommit
3840
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
3941
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+
4052
- name: Get all changed example files
4153
id: changed-files
4254
uses: tj-actions/changed-files@v35
@@ -79,17 +91,28 @@ jobs:
7991
container:
8092
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
8193
options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
82-
timeout-minutes: 20
94+
timeout-minutes: 30
8395
concurrency:
8496
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-example-${{ matrix.directory }}
8597
cancel-in-progress: true
8698
steps:
8799
- uses: actions/checkout@v3
88100

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+
89108
- name: Install Colossal-AI
90109
run: |
91110
BUILD_EXT=1 pip install -v .
92111
112+
- name: Store Colossal-AI Cache
113+
run: |
114+
cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/
115+
93116
- name: Test the example
94117
run: |
95118
example_dir=${{ matrix.directory }}

.github/workflows/example_check_on_schedule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
container:
3737
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
3838
options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
39-
timeout-minutes: 10
39+
timeout-minutes: 30
4040
steps:
4141
- name: 📚 Checkout
4242
uses: actions/checkout@v3

colossalai/inference/README.md

Lines changed: 185 additions & 165 deletions
Large diffs are not rendered by default.

colossalai/inference/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .engine import InferenceEngine
2-
from .engine.policies import BloomModelInferPolicy, ChatGLM2InferPolicy, LlamaModelInferPolicy
1+
from .config import InferenceConfig
2+
from .core import InferenceEngine
33

4-
__all__ = ["InferenceEngine", "LlamaModelInferPolicy", "BloomModelInferPolicy", "ChatGLM2InferPolicy"]
4+
__all__ = ["InferenceConfig", "InferenceEngine"]

0 commit comments

Comments
 (0)