Skip to content

make compatibility for atbgraph mode (#71) #2

make compatibility for atbgraph mode (#71)

make compatibility for atbgraph mode (#71) #2

Workflow file for this run

name: dlinfer main test ci
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
CI_PATH: '/data2/wugeshui/GitHub/${{ github.repository }}/${GITHUB_RUN_NUMBER}'
LMDEPLOY_PATH: '/data2/wugeshui/GitHub/lmdeploy'
LMDEPLOY_COMMIT_OR_BRANCH: 'main'
REPORT_DIR: /data2/wugeshui/GitHub/ci_log/test_reports
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
AscendEndtoEndTests:
runs-on: Atlas_800T_A2
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create custom directory
run: |
set -ex
echo ${{ env.CI_PATH }}
mkdir -p ${{ env.CI_PATH }}
- name: Clean custom directory
run: |
set -ex
if [ -d "${{ env.CI_PATH }}" ]; then
rm -rf ${{ env.CI_PATH }}/*
rm -rf ${{ env.CI_PATH }}/.github
fi
- name: Move code to custom directory
run: |
set -ex
mv $GITHUB_WORKSPACE/* ${{ env.CI_PATH }}/
mv $GITHUB_WORKSPACE/.github ${{ env.CI_PATH }}/
- name: Build and install dlinfer
run: |
set -ex
source /usr/local/Ascend/ascend-toolkit/set_env.sh
cd ${{ env.CI_PATH }}
pip uninstall -y dlinfer-ascend
pip install -r requirements/ascend/full.txt
DEVICE=ascend python3 setup.py develop --user
- name: Make and clean directory for lmdeploy
run: |
set -ex
echo ${{env.LMDEPLOY_PATH }}
if [ -d "${{env.LMDEPLOY_PATH }}" ]; then
rm -rf ${{env.LMDEPLOY_PATH }}
mkdir -p ${{env.LMDEPLOY_PATH }}
fi
- name: Clone lmdeploy
run: |
set -ex
git clone https://github.com/DeepLink-org/lmdeploy.git ${{ env.LMDEPLOY_PATH }}
cd ${{ env.LMDEPLOY_PATH }} && git checkout ${{ env.LMDEPLOY_COMMIT_OR_BRANCH }}
# git apply ${{env.CI_PATH }}/.github/ci/fix-exit-multi-npu.patch
- name: RunTests
run: |
set -ex
source /usr/local/Ascend/ascend-toolkit/set_env.sh
export PYTHONPATH=${{env.LMDEPLOY_PATH }}:$PYTHONPATH
cd ${{env.CI_PATH }}/tests
export DLINFER_TEST_DIR=${{env.CI_PATH }}/tests
echo $PYTHONPATH && pwd
pytest ./ -m 'lmdeploy' -s -x --alluredir=allure-results --clean-alluredir
python ./test_lmdeploy/e2e/test_model_tp2.py --model_type=chat --device_type=ascend
python ./test_lmdeploy/e2e/test_model_tp2.py --model_type=vl --device_type=ascend
- name: Generate reports
if: always()
run: |
export date_today="$(date +'%Y%m%d-%H%M%S')"
export report_dir="$REPORT_DIR/$date_today"
echo "Save report to $report_dir"
cd ${{env.CI_PATH }}/tests
mv allure-results $report_dir
- name: Uninstall dlinfer
if: always()
run: |
pip uninstall -y dlinfer-ascend
- name: Clear workfile
if: always()
run: |
export workdir=$(pwd)
cd ..
rm -rf $workdir
mkdir $workdir
chmod -R 777 $workdir