-
Notifications
You must be signed in to change notification settings - Fork 30
136 lines (119 loc) · 3.84 KB
/
build_wheel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build wheel
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build and update whl index'
required: true
type: string
workflow_call:
inputs:
tag:
description: 'Tag to build and update whl index'
required: true
type: string
env:
# Tells where to store caches.
CI_CACHE_DIR: ${{ github.workspace }}/../../ci_cache
jobs:
build_wheel:
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
cuda: ["11.8", "12.1", "12.4"]
torch: ["2.4.1", "2.5.1"]
exclude: # torch 2.5.1 dropped support for python 3.8
- python: "3.8"
torch: "2.5.1"
runs-on: [self-hosted, linux, release]
env:
PYTHON_VERSION: ${{ matrix.python }}
CUDA_VERSION: ${{ matrix.cuda }}
TORCH_VERSION: ${{ matrix.torch }}
SCALELLM_VERSION: ${{ inputs.tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Create cache directory
run: |
mkdir -p $CI_CACHE_DIR/.vcpkg/bincache
mkdir -p $CI_CACHE_DIR/.ccache
mkdir -p $CI_CACHE_DIR/.pip
- name: Build wheel
timeout-minutes: 60
run: |
docker pull vectorchai/scalellm_manylinux:cuda${CUDA_VERSION}
docker run --rm -t \
-v "$CI_CACHE_DIR":/ci_cache \
-v "$GITHUB_WORKSPACE":/ScaleLLM \
-e PYTHON_VERSION=${PYTHON_VERSION} \
-e CUDA_VERSION=${CUDA_VERSION} \
-e TORCH_VERSION=${TORCH_VERSION} \
-e SCALELLM_VERSION=${SCALELLM_VERSION} \
-e SCALELLM_VERSION_SUFFIX="+cu${CUDA_VERSION//./}torch${TORCH_VERSION}" \
-e VCPKG_DEFAULT_BINARY_CACHE=/ci_cache/.vcpkg/bincache \
-e CCACHE_DIR=/ci_cache/.ccache \
-e PIP_CACHE_DIR=/ci_cache/.pip \
-u $(id -u):$(id -g) \
vectorchai/scalellm_manylinux:cuda${CUDA_VERSION} \
bash /ScaleLLM/scripts/build_wheel.sh
- name: show wheel size
run: du -h dist/*
- uses: actions/upload-artifact@v4
with:
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }}
path: dist/*
create_release:
needs: build_wheel
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download wheel
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
pattern: wheel-*
- name: Show wheels
run: ls -lha dist
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: dist/scalellm-*.whl
tag_name: ${{ inputs.tag }}
generate_release_notes: true
draft: false
prerelease: false
make_latest: true
commit_whl_index:
needs: build_wheel
runs-on: ubuntu-latest
steps:
- name: Download wheel
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
pattern: wheel-*
- name: Show wheels
run: ls -lha dist
- name: Clone whl repo
run: |
git clone https://oauth2:${WHL_TOKEN}@github.com/vectorch-ai/whl.git
env:
WHL_TOKEN: ${{ secrets.WHL_TOKEN }}
- name: Append new whls into whl index
run: |
cd whl
python ./publish_whl.py --whl_path=../dist
- name: Commit whl index change
run: |
cd whl
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Update whl index for version ${{ inputs.tag }}"
git push