-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
182 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.github/workflows/publish_image.yml → .github/workflows/publish_base_image.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Publish devel docker image | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish_base: | ||
runs-on: [self-hosted, linux, release] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USER }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Build devel image for cuda 12.1 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./docker | ||
file: ./docker/Dockerfile.devel | ||
push: true | ||
build-args: | | ||
UBUNTU_VERSION=22.04 | ||
CUDA_VERSION=12.1 | ||
GCC_VERSION=12 | ||
CMAKE_VERSION=3.18.5 | ||
NINJA_VERSION=1.9.0 | ||
tags: | | ||
vectorchai/scalellm_devel:cuda12.1-ubuntu22.04 | ||
vectorchai/scalellm_devel:latest | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release wheel | ||
# Build & Push scalellm docker image on creation of tags to https://hub.docker.com/r/vectorchai/scalellm | ||
# Push events to matching v*, i.e. v1.0.0, v1.0.0-rc1, v20.15.10-rc5, etc. | ||
# on: | ||
# push: | ||
# tags: | ||
# - v[0-9]+.[0-9]+.[0-9]+* | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to build and push' | ||
required: true | ||
type: string | ||
env: | ||
# Tells where to store caches. | ||
CI_CACHE_DIR: ${{ github.workspace }}/../../ci_cache | ||
|
||
jobs: | ||
build_wheel: | ||
strategy: | ||
matrix: | ||
python: ["3.9"] | ||
cuda: ["12.1"] | ||
torch: ["2.3"] | ||
runs-on: [self-hosted, linux, release] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Build wheel | ||
run: | | ||
docker run --rm -t \ | ||
-v "$CI_CACHE_DIR":/ci_cache \ | ||
-v "$GITHUB_WORKSPACE":/ScaleLLM \ | ||
-e PYTHON_VERSION=${{ matrix.python }} \ | ||
-e CUDA_VERSION=${{ matrix.cuda }} \ | ||
-e TORCH_VERSION=${{ matrix.torch }} \ | ||
-e VCPKG_DEFAULT_BINARY_CACHE=/ci_cache/.vcpkg/bincache \ | ||
-e CCACHE_DIR=/ci_cache/.ccache \ | ||
vectorchai/scalellm_builder:cuda${{ matrix.cuda }}-ubuntu22.04 \ | ||
bash /ScaleLLM/scripts/build_wheel.sh | ||
timeout-minutes: 60 | ||
|
||
- name: show wheel size | ||
run: du -h python/dist/* | ||
|
||
# - uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }} | ||
# path: python/dist/* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
ensure_env() { | ||
local var_name="$1" | ||
if [ -z "${!var_name}" ]; then | ||
echo "Error: Environment variable '$var_name' is not set." | ||
exit 1 | ||
fi | ||
} | ||
|
||
ensure_env PYTHON_VERSION | ||
ensure_env TORCH_VERSION | ||
ensure_env CUDA_VERSION | ||
# ensure_env BUILD_VERSION | ||
|
||
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)" | ||
|
||
export HOME=/tmp/home | ||
mkdir -p $HOME | ||
export PATH="$HOME/.local/bin:$PATH" | ||
CUDA_MAJOR="${CUDA_VERSION%.*}" | ||
CUDA_MINOR="${CUDA_VERSION#*.}" | ||
TORCH_MAJOR="${TORCH_VERSION%.*}" | ||
TORCH_MINOR="${TORCH_VERSION#*.}" | ||
|
||
# choose the right python version | ||
PYVER="${PYTHON_VERSION//./}" | ||
export PATH="/opt/python/cp${PYVER}-cp${PYVER}/bin:$PATH" | ||
|
||
|
||
echo "::group::Install PyTorch" | ||
pip install torch==$TORCH_VERSION --index-url "https://download.pytorch.org/whl/cu${CUDA_MAJOR}${CUDA_MINOR}" | ||
echo "::endgroup::" | ||
|
||
|
||
echo "::group::Build wheel for ScaleLLM" | ||
cd "$PROJECT_ROOT/python" | ||
python setup.py bdist_wheel | ||
echo "::endgroup::" |