Repository navigation
213 lines (195 loc) · 8.1 KB
/
Copy pathrelease.yml
File metadata and controls
213 lines (195 loc) · 8.1 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Tagged binaries and a container image. A tag push publishes them; a manual
# run builds the same artifacts on the chosen ref and publishes nothing.
name: release
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
env:
BINARIES: vla-server vlm-server vla-cli vla-bench
jobs:
linux:
runs-on: ${{ matrix.runner }}
container: ${{ matrix.image }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64-cpu
runner: ubuntu-24.04
image: ubuntu:24.04
cmake: -DGGML_CUDA=OFF
- name: linux-x86_64-cuda-12.8
runner: ubuntu-24.04
image: nvidia/cuda:12.8.1-devel-ubuntu24.04
cmake: -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90;120-real"
cuda: true
- name: linux-x86_64-cuda-13.4
runner: ubuntu-24.04
image: nvidia/cuda:13.4.1-devel-ubuntu24.04
cmake: -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90;120-real"
cuda: true
- name: linux-aarch64-cpu
runner: ubuntu-24.04-arm
image: ubuntu:24.04
cmake: -DGGML_CUDA=OFF -DGGML_CPU_ARM_ARCH=armv8.2-a+dotprod+fp16
- name: linux-aarch64-cuda-13.4
runner: ubuntu-24.04-arm
image: nvidia/cuda:13.4.1-devel-ubuntu24.04
cmake: -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="87-real;110-real;121-real" -DGGML_CPU_ARM_ARCH=armv8.2-a+dotprod+fp16
cuda: true
steps:
- name: deps
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
build-essential cmake git ca-certificates pkg-config python3 \
libzmq3-dev cppzmq-dev libprotobuf-dev protobuf-compiler
- uses: actions/checkout@v7
- name: build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF \
-DCMAKE_INSTALL_RPATH='$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
${{ matrix.cuda && '-DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined -DGGML_CUDA_NCCL=OFF' || '' }} ${{ matrix.cmake }}
cmake --build build -j"$(nproc)" --target $BINARIES vla
- name: package
run: |
out="vla.cpp-${GITHUB_REF_NAME//\//-}-${{ matrix.name }}"
mkdir -p "$out/scripts"
for b in $BINARIES; do cp "build/$b" "$out/"; done
cp -P build/*.so* build/bin/*.so* "$out/"
ldd "$out/vla-server" | awk '/libgomp|libprotobuf/ {print $3}' | xargs cp -L -t "$out/"
cp /usr/share/doc/libprotobuf32t64/copyright "$out/LICENSE.protobuf"
cp /usr/share/doc/libgomp1/copyright "$out/LICENSE.libgomp"
cp build/_deps/llama-src/LICENSE "$out/LICENSE.llama.cpp"
cp build/_deps/llama-src/licenses/LICENSE-jsonhpp "$out/LICENSE.jsonhpp"
cp build/_deps/sentencepiece-src/LICENSE "$out/LICENSE.sentencepiece"
cp build/_deps/sentencepiece-src/third_party/darts_clone/LICENSE "$out/LICENSE.darts_clone"
cp include/vla.h LICENSE.md README.md "$out/"
# vla-cli --text finds this in scripts/ next to itself.
cp scripts/tokenize_prompt.py "$out/scripts/"
tar -czf "$out.tar.gz" "$out"
- name: smoke
run: |
out="vla.cpp-${GITHUB_REF_NAME//\//-}-${{ matrix.name }}"
mv build build.moved
ldd "$out"/vl*-* "$out"/*.so* > ldd.txt
if grep -v libcuda.so.1 ldd.txt | grep 'not found'; then exit 1; fi
LD_LIBRARY_PATH=/usr/local/cuda/compat "$out/vla-cli" --help
- name: cuda runtime
if: matrix.cuda
run: |
out="vla.cpp-${GITHUB_REF_NAME//\//-}-${{ matrix.name }}"
mkdir cudart
cp -L /usr/local/cuda/lib64/lib{cudart,cublas,cublasLt}.so."${CUDA_VERSION%%.*}" cudart/
tar -czf "cudart-$out.tar.gz" --transform "s,^cudart,$out," cudart
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}
path: '*.tar.gz'
if-no-files-found: error
macos:
runs-on: macos-15
env:
BINARIES: vla-cli vla-bench
steps:
- uses: actions/checkout@v7
- name: deps
run: brew install cmake
- name: build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_METAL=ON -DGGML_NATIVE=OFF \
-DVLA_BUILD_SERVER=OFF -DVLA_SPM=OFF \
-DCMAKE_INSTALL_RPATH='@loader_path' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
cmake --build build -j"$(sysctl -n hw.ncpu)" --target $BINARIES vla
- name: package
run: |
out="vla.cpp-${GITHUB_REF_NAME//\//-}-macos-arm64-metal"
mkdir -p "$out/scripts"
for b in $BINARIES; do cp "build/$b" "$out/"; done
cp -a build/*.dylib build/bin/*.dylib "$out/"
cp build/_deps/llama-src/LICENSE "$out/LICENSE.llama.cpp"
cp build/_deps/llama-src/licenses/LICENSE-jsonhpp "$out/LICENSE.jsonhpp"
cp include/vla.h LICENSE.md README.md "$out/"
cp scripts/tokenize_prompt.py "$out/scripts/"
# Metal needs the shader library next to the binary.
find build -name 'default.metallib' -exec cp {} "$out/" \;
tar -czf "$out.tar.gz" "$out"
- name: smoke
run: |
out="vla.cpp-${GITHUB_REF_NAME//\//-}-macos-arm64-metal"
mv build build.moved
otool -L "$out"/vl*-* "$out"/*.dylib
if otool -L "$out"/vl*-* "$out"/*.dylib | grep -E '/opt/homebrew|/usr/local/'; then exit 1; fi
for lib in $(otool -L "$out"/vl*-* "$out"/*.dylib | awk '/@rpath\//{print $1}' | sort -u); do
test -e "$out/${lib#@rpath/}" || { echo "missing $lib"; exit 1; }
done
"$out/vla-cli" --help
- uses: actions/upload-artifact@v7
with:
name: macos-arm64-metal
path: '*.tar.gz'
if-no-files-found: error
docker:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: free disk
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: image name
run: |
echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
echo "REF=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_ENV"
- uses: docker/build-push-action@v7
with:
context: .
push: ${{ github.event_name == 'push' }}
build-args: |
CUDA_ARCH=75-real;80-real;86-real;89-real;90;120-real
GGML_NATIVE=OFF
tags: |
${{ env.IMAGE }}:${{ env.REF }}
${{ env.IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
publish:
needs: [linux, macos, docker]
if: github.event_name == 'push'
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v7
# The release body is this tag's CHANGELOG.md section; a tag with none
# fails here rather than publishing an empty release.
- name: release notes
run: |
ver="${GITHUB_REF_NAME#v}"
awk -v h="## [$ver]" 'index($0, h) == 1 {on=1; next} on && /^## \[/ {exit} on' \
CHANGELOG.md > notes.md
test -s notes.md || { echo "no CHANGELOG.md section for $ver"; exit 1; }
# Tarballs only. The docker job also leaves a .dockerbuild build record
# artifact behind, and pulling that one fails the whole download.
- uses: actions/download-artifact@v8
with: { path: dist, pattern: '{linux,macos}-*', merge-multiple: true }
- uses: softprops/action-gh-release@v3
with:
files: dist/*.tar.gz
fail_on_unmatched_files: true
body_path: notes.md
generate_release_notes: true