ipex-llm/.github/workflows/llm-nightly-test.yml
Yuwen Hu 372c775cb4 [LLM] Change default runner for LLM Linux tests to the ones with AVX512 (#8448)
* Basic change for AVX512 runner

* Remove conda channel and action rename

* Small fix

* Small fix and reduce peak convert disk space

* Define n_threads based on runner status

* Small thread num fix

* Define thread_num for cli

* test

* Add self-hosted label and other small fix
2023-07-04 14:53:03 +08:00

111 lines
4.7 KiB
YAML

name: LLM Nightly Tests
# Controls when the action will run.
on:
schedule:
- cron: '00 13 * * *' # GMT time, 13:00 GMT == 21:00 China
pull_request:
branches: [ main ]
paths:
- '.github/workflows/llm-nightly-test.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
llm-nightly-convert-test:
runs-on: [ self-hosted, llm, AVX512, ubuntu-20.04-lts ]
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
env:
ORIGIN_DIR: ./llm/models
LLAMA_ORIGIN_PATH: ./llm/models/llama-7b-hf
GPTNEOX_ORIGIN_PATH: ./llm/models/gptneox-7b-redpajama-bf16
BLOOM_ORIGIN_PATH: ./llm/models/bloomz-7b1
STARCODER_ORIGIN_PATH: ./llm/models/gpt_bigcode-santacoder
INT4_CKPT_DIR: ./llm/ggml-actions/nightly
LLAMA_INT4_CKPT_PATH: ./llm/ggml-actions/nightly/bigdl_llm_llama_q4_0.bin
GPTNEOX_INT4_CKPT_PATH: ./llm/ggml-actions/nightly/bigdl_llm_gptneox_q4_0.bin
BLOOM_INT4_CKPT_PATH: ./llm/ggml-actions/nightly/bigdl_llm_bloom_q4_0.bin
STARCODER_INT4_CKPT_PATH: ./llm/ggml-actions/nightly/bigdl_llm_starcoder_q4_0.bin
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools==58.0.4
python -m pip install --upgrade wheel
- name: Install BigDL-LLM
shell: bash
run: |
$CONDA_HOME/bin/conda env remove -y -n bigdl-init-llm || true
$CONDA_HOME/bin/conda create -n bigdl-init-llm -y python==3.9 setuptools==58.0.4
source $CONDA_HOME/bin/activate bigdl-init-llm
$CONDA_HOME/bin/conda info
pip install requests
bash python/llm/dev/release_default_linux.sh default false
whl_name=$(ls python/llm/dist)
pip install -i https://pypi.python.org/simple "python/llm/dist/${whl_name}[all]"
pip install pytest
source $CONDA_HOME/bin/deactivate
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Download original models & convert
shell: bash
run: |
source $CONDA_HOME/bin/activate bigdl-init-llm
if [ ! -d $LLAMA_ORIGIN_PATH ]; then
echo "Directory $LLAMA_ORIGIN_PATH not found. Downloading from FTP server..."
wget -r -nH --no-verbose --cut-dirs=1 $LLM_FTP_URL/llm/llama-7b-hf -P $ORIGIN_DIR
fi
bash python/llm/test/run-llm-convert-tests.sh llama
rm -rf $LLAMA_ORIGIN_PATH
if [ ! -d $GPTNEOX_ORIGIN_PATH ]; then
echo "Directory $GPTNEOX_ORIGIN_PATH not found. Downloading from FTP server..."
wget -r -nH --no-verbose --cut-dirs=1 $LLM_FTP_URL/llm/gptneox-7b-redpajama-bf16 -P $ORIGIN_DIR
fi
bash python/llm/test/run-llm-convert-tests.sh gptneox
rm -rf $GPTNEOX_ORIGIN_PATH
if [ ! -d $BLOOM_ORIGIN_PATH ]; then
echo "Directory $BLOOM_ORIGIN_PATH not found. Downloading from FTP server..."
wget -r -nH --no-verbose --cut-dirs=1 $LLM_FTP_URL/llm/bloomz-7b1 -P $ORIGIN_DIR
fi
bash python/llm/test/run-llm-convert-tests.sh bloom
rm -rf $BLOOM_ORIGIN_PATH
if [ ! -d $STARCODER_ORIGIN_PATH ]; then
echo "Directory $STARCODER_ORIGIN_PATH not found. Downloading from FTP server..."
wget -r -nH --no-verbose --cut-dirs=1 $LLM_FTP_URL/llm/gpt_bigcode-santacoder -P $ORIGIN_DIR
fi
bash python/llm/test/run-llm-convert-tests.sh starcoder
rm -rf $STARCODER_ORIGIN_PATH
source $CONDA_HOME/bin/deactivate
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Upload ckpt to ftp
run: |
apt-get update && apt install tnftp
tnftp -u ${LLM_FTP_URL}/${INT4_CKPT_DIR:1}/bigdl_llm_llama_7b_q4_0.bin $LLAMA_INT4_CKPT_PATH
tnftp -u ${LLM_FTP_URL}/${INT4_CKPT_DIR:1}/bigdl_llm_redpajama_7b_q4_0.bin $GPTNEOX_INT4_CKPT_PATH
tnftp -u ${LLM_FTP_URL}/${INT4_CKPT_DIR:1}/bigdl_llm_bloom_7b_q4_0.bin $BLOOM_INT4_CKPT_PATH
tnftp -u ${LLM_FTP_URL}/${INT4_CKPT_DIR:1}/bigdl_llm_santacoder_1b_q4_0.bin $STARCODER_INT4_CKPT_PATH
- name: Clean up test environment
shell: bash
run: |
$CONDA_HOME/bin/conda env remove -y -n bigdl-init-llm || true
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}