Skip to content

Add ci to check validation for modified models. #5

Add ci to check validation for modified models.

Add ci to check validation for modified models. #5

Workflow file for this run

name: Validate-GPU
on:
pull_request:
branches:
- develop
env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
work_dir: /workspace
TASK: GraphNet-CI-${{ github.event.pull_request.number }}-Validate
BRANCH: ${{ github.event.pull_request.base.ref }}
CI_name: ci-graphnet-validate
CFS_DIR: /home/data/cfs
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/ci/paddle:4251d0b615371e0d0ed9040d7455e2b4" # cuda11.7
defaults:
run:
shell: bash
jobs:
validate:
name: Validate
if: ${{ inputs.can-skip != 'true' }}
runs-on:
group: BD_BJ-V100
steps:
- name: Check docker image and run container
env:
CACHE_DIR: /home/data/cfs/.cache
run: |
container_name=${TASK}-${core_index}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker container ls -a --filter "name=GraphNet-CI-*-Validate-${core_index}*" --format "{{.ID}}" | xargs -r docker rm -f
docker run -d -t --gpus all --name ${container_name} --shm-size=128g \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/cfs/.cache:/root/.cache" \
-v "/home/data/cfs/.ccache:/root/.ccache" \
-v "/dev/shm:/dev/shm" \
-v ${{ github.workspace }}:/workspace/GraphNet \
-e python \
-e core_index \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e work_dir \
-e no_proxy \
-e CI_name \
-e CACHE_DIR \
-e GITHUB_API_TOKEN \
-e CFS_DIR \
-w /workspace/GraphNet --network host ${docker_image}
- name: Check bypass
id: check-bypass
uses: ./.github/actions/check-bypass
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
workflow-name: ci-graphnet-validate
- name: Determine ci trigger
if: steps.check-bypass.outputs.can-skip != 'true'
env:
work_dir: ${{ github.workspace }}
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
source ${{ github.workspace }}/../../../proxy
source ${ci_scripts}/ce_cinn_diff.sh
if [ ${sum_num} -eq 0 ];then
echo "The modified files does not affect LayerCase in CE-CINN-Framework, so skip this ci."
echo "skip_ci=true" >> ${{ github.env }}
fi
'
- name: Run check
if: ${{ steps.check-bypass.outputs.can-skip != 'true' && env.skip_ci != 'true' }}
env:
work_dir: ${{ github.workspace }}
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
source ~/.bashrc
pip config set global.cache-dir "$CACHE_DIR/pip"
pip install /paddle/build/pr_whl/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
cd /PaddleTest/framework/e2e/PaddleLT_new
pip install -r requirement.txt
source ./scene/set_ci_dy^dy2stcinn_train^dy2stcinn_eval_inputspec_env.sh
python support/dict_to_yml.py --filename apibm_config.yml --data_str "$(cat $CACHE_DIR/cinn_config)"
set -e
python run.py
exit $(head -n 1 "exit_code.txt")
'
- name: Terminate and delete the container
if: always()
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
docker rm -f ${{ env.container_name }}