-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
2e3e759
commit 290724f
Showing
7 changed files
with
202 additions
and
41 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
.github/workflows/llm_conda_nightly_apple_silicon_mac.yaml
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,43 @@ | ||
# GH actions. | ||
name: MLC-Chat-CLI-Conda-Nightly-Apple-Silicon-Mac | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 8 * * *' # 8 AM UTC -> 4 AM EDT | ||
|
||
|
||
jobs: | ||
Build: | ||
strategy: | ||
matrix: | ||
pkg: ['mlc-chat-cli-nightly'] | ||
sys: | ||
- conda_pkg_path: osx-arm64 | ||
shell: 'bash -l {0}' | ||
|
||
runs-on: [self-hosted, macOS, ARM64] | ||
defaults: | ||
run: | ||
shell: ${{ matrix.sys.shell }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
- name: Build Conda | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_chat_cli_conda_apple_silicon.sh | ||
- name: Conda-Deploy | ||
if: github.ref == 'refs/heads/main' | ||
env: | ||
ANACONDA_API_TOKEN: ${{ secrets.MLC_ANACONDA_TOKEN }} | ||
run: >- | ||
anaconda upload --force --label main conda/pkg/${{ matrix.sys.conda_pkg_path }}/*.tar.bz2 |
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,85 @@ | ||
# GH actions. | ||
name: Wheel-AppleSiliconMac-Nightly | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 8 * * *' # 8 AM UTC -> 4 AM EDT | ||
|
||
jobs: | ||
Build: | ||
runs-on: [self-hosted, macOS, ARM64] | ||
defaults: | ||
run: | ||
shell: 'bash -l {0}' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
- name: Setup script env | ||
run: | | ||
mv conda/tvm-unity/build-environment.yaml 3rdparty/tlcpack/conda/build-environment.yaml | ||
rm -rf conda | ||
ln -s 3rdparty/tlcpack/conda conda | ||
- name: Checkout source | ||
run: | | ||
git clone https://github.com/mlc-ai/relax tvm --recursive --single-branch --branch mlc | ||
git clone https://github.com/mlc-ai/mlc-llm mlc-llm --recursive --single-branch --branch main | ||
- name: Build mlc-ai @ 3.8 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_ai_wheel_single_python_apple_silicon.sh wheel-3-8 | ||
- name: Build mlc-ai @ 3.9 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_ai_wheel_single_python_apple_silicon.sh wheel-3-9 | ||
- name: Build mlc-ai @ 3.10 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_ai_wheel_single_python_apple_silicon.sh wheel-3-10 | ||
- name: Build mlc-ai @ 3.11 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_ai_wheel_single_python_apple_silicon.sh wheel-3-11 | ||
- name: Build mlc-chat @ 3.8 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_chat_wheel_single_python_apple_silicon.sh wheel-3-8 | ||
- name: Build mlc-chat @ 3.9 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_chat_wheel_single_python_apple_silicon.sh wheel-3-9 | ||
- name: Build mlc-chat @ 3.10 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_chat_wheel_single_python_apple_silicon.sh wheel-3-10 | ||
- name: Build mlc-chat @ 3.11 | ||
env: | ||
CONDA_HOME: ${{ secrets.M1_MAC_CONDA_HOME }} | ||
run: | | ||
scripts/build_mlc_chat_wheel_single_python_apple_silicon.sh wheel-3-11 | ||
# Use system python instead of conda for upload | ||
- name: Wheel-Deploy | ||
if: github.ref == 'refs/heads/main' | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.MLC_GITHUB_TOKEN }} | ||
with: | ||
files: | | ||
tvm/python/dist/*.whl | ||
mlc-llm/python/dist/*.whl | ||
tag_name: v0.9.dev0 | ||
prerelease: true |
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,27 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
eval "$(command conda 'shell.bash' 'hook' 2> /dev/null)" | ||
|
||
CONDA_ENV_NAME=$1 | ||
deploy="${DEPLOY_WHEEL:-0}" | ||
|
||
source $CONDA_HOME/etc/profile.d/conda.sh | ||
|
||
echo "Start build for $CONDA_ENV_NAME" | ||
|
||
# conda activate | ||
conda activate $CONDA_ENV_NAME | ||
|
||
# sync package | ||
python scripts/sync_package.py --package tvm --package-name mlc-ai-nightly --revision origin/mlc --skip-checkout --skip-conda | ||
# build tvm | ||
./scripts/build_mlc_ai_lib_apple_silicon.sh | ||
|
||
# build wheel | ||
cd tvm/python && python setup.py bdist_wheel && cd - | ||
|
||
# deploy wheel | ||
if [ "$deploy" -eq "1" ]; then | ||
python scripts/wheel_upload.py --repo mlc-ai/package --tag v0.9.dev0 tvm/python/dist | ||
fi |
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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
set -e | ||
set -u | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
PKG="mlc-chat-nightly" | ||
PKG="mlc-chat-cli-nightly" | ||
CONDA_ENV_NAME="mlc-llm-build" | ||
export CONDA_PKG_PATH="osx-arm64" | ||
deploy="${DEPLOY_WHEEL:-0}" | ||
|
||
rm -rf mlc-llm | ||
git clone git@github.com:mlc-ai/mlc-llm.git mlc-llm --recursive | ||
git clone https://github.com/mlc-ai/mlc-llm.git mlc-llm --recursive | ||
|
||
python3 scripts/sync_package.py --package mlc-llm --package-name $PKG | ||
|
||
source "$CONDA_HOME/etc/profile.d/conda.sh" | ||
conda deactivate | ||
conda env remove -n ${CONDA_ENV_NAME} | ||
conda env create --file conda/mlc-llm/osx-build-environment.yaml | ||
conda activate ${CONDA_ENV_NAME} | ||
conda build -c conda-forge --output-folder=conda/pkg -m conda/mlc-llm/build_config.yaml conda/mlc-llm/recipe | ||
anaconda upload -u mlc-ai --force --label main conda/pkg/${CONDA_PKG_PATH}/*.tar.bz2 | ||
|
||
if [ "$deploy" -eq "1" ]; then | ||
anaconda upload -u mlc-ai --force --label main conda/pkg/${CONDA_PKG_PATH}/*.tar.bz2 | ||
fi |
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
27 changes: 27 additions & 0 deletions
27
scripts/build_mlc_chat_wheel_single_python_apple_silicon.sh
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,27 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
eval "$(command conda 'shell.bash' 'hook' 2> /dev/null)" | ||
|
||
CONDA_ENV_NAME=$1 | ||
deploy="${DEPLOY_WHEEL:-0}" | ||
|
||
source $CONDA_HOME/etc/profile.d/conda.sh | ||
|
||
echo "Start build for $CONDA_ENV_NAME" | ||
|
||
# conda activate | ||
conda activate $CONDA_ENV_NAME | ||
|
||
# sync package | ||
python scripts/sync_package.py --package mlc-llm --package-name mlc-chat-nightly --revision origin/main --skip-checkout --skip-conda | ||
# build mlc-llm | ||
./scripts/build_mlc_chat_lib_apple_silicon.sh | ||
|
||
# build wheel | ||
cd mlc-llm/python && python setup.py bdist_wheel && cd - | ||
|
||
# deploy wheel | ||
if [ "$deploy" -eq "1" ]; then | ||
python scripts/wheel_upload.py --repo mlc-ai/package --tag v0.9.dev0 mlc-llm/python/dist | ||
fi |