* First push to downloading and converting llm models for testing (Gondolin runner, avx2 for now) * Change yml file name
102 lines
4.4 KiB
YAML
102 lines
4.4 KiB
YAML
name: LLM Unit Tests Basic on Linux
|
|
|
|
# Cancel previous runs in the PR when you push new commits
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
# Controls when the action will run.
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the main branch
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'python/llm/**'
|
|
- '.github/workflows/llm_unit_tests_linux.yml'
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'python/llm/**'
|
|
- '.github/workflows/llm_unit_tests_linux.yml'
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
llm-unit-test-linux:
|
|
runs-on: [ self-hosted, Gondolin, 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
|
|
INT4_CKPT_DIR: ./llm/ggml
|
|
LLAMA_INT4_CKPT_PATH: ./llm/ggml/bigdl_llm_llama_q4_0.bin
|
|
GPTNEOX_INT4_CKPT_PATH: ./llm/ggml/bigdl_llm_gptneox_q4_0.bin
|
|
BLOOM_INT4_CKPT_PATH: ./llm/ggml/bigdl_llm_bloom_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: Run LLM-init test
|
|
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 -c ${GONDOLIN_CONDA_CHANNEL} --override-channels
|
|
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
|
|
pip install -i https://pypi.python.org/simple python/llm/dist/bigdl_llm*.whl
|
|
source $CONDA_HOME/bin/deactivate
|
|
$CONDA_HOME/bin/conda remove -n bigdl-init-llm --all
|
|
env:
|
|
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
|
|
|
|
- name: Download original models
|
|
env:
|
|
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
|
|
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
|
run: |
|
|
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 --ftp-user=$FTP_USERNAME --ftp-password=$FTP_PASSWORD ftp://10.112.231.51:8821/llm/llama-7b-hf -P $ORIGIN_DIR
|
|
fi
|
|
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 --ftp-user=$FTP_USERNAME --ftp-password=$FTP_PASSWORD ftp://10.112.231.51:8821/llm/gptneox-7b-redpajama-bf16 -P $ORIGIN_DIR
|
|
fi
|
|
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 --ftp-user=$FTP_USERNAME --ftp-password=$FTP_PASSWORD ftp://10.112.231.51:8821/llm/bloomz-7b1 -P $ORIGIN_DIR
|
|
fi
|
|
|
|
- name: Run LLM basic test (native install & convert)
|
|
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 -c ${GONDOLIN_CONDA_CHANNEL} --override-channels
|
|
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
|
|
bash python/llm/test/run-llm-basic-tests.sh
|
|
source $CONDA_HOME/bin/deactivate
|
|
$CONDA_HOME/bin/conda remove -n bigdl-init-llm --all
|
|
env:
|
|
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
|
|
|
|
# new test steps should be added here
|