Skip to content

paddle metax gpu private test #9

paddle metax gpu private test

paddle metax gpu private test #9

name: paddle metax gpu private test
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
branches: [develop, release/**]
schedule:
- cron: "0 16 * * *"
permissions: read-all
defaults:
run:
shell: bash
jobs:
metax-gpu-test:
runs-on: paddle-metax-runner-set
steps:
- name: Checkout repository
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git clone \
--reference-if-able /home/runner/PaddleCustomDevice \
--depth=1 \
--shallow-submodules \
--jobs=8 \
--branch ${{ github.base_ref || github.ref_name}} \
--recurse-submodules \
https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git .
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/head
git checkout pull/${{ github.event.pull_request.number }}/head
paddle_branch=${{ github.base_ref || github.ref_name}}
echo $paddle_branch
# sleep 10000
change_numbers=$(git diff --name-only remotes/origin/${paddle_branch} | wc -l)
echo $change_numbers
change_backend=$(git diff --name-only remotes/origin/${paddle_branch} | grep -c "backends/" || true)
echo $change_backend
change_metax_only=$(git diff --name-only remotes/origin/${paddle_branch} | grep -c "backends/metax_gpu" || true)
echo $change_metax_only
# change_backend=$(git diff --name-only remotes/origin/${paddle_branch} | grep "backends/"| wc -l)
# echo $change_backend
# change_metax_only=$(git diff --name-only remotes/origin/${paddle_branch} | grep "backends/metax_gpu"| wc -l)
# echo $change_metax_only
git diff --name-only remotes/origin/${paddle_branch}
if [ $change_numbers -ne $change_backend ]; then
echo "Common file changed, continue to run metax FULL CI test ..."
elif [ $paddle_branch -eq 0 ] ; then
echo "NO metax backend changes found, skip metax FULL CI ....."
exit 0
fi
# git submodule update --init --recursive
fi
- name: compile
run: |
# sleep 10000
cd backends/metax_gpu
bash build_private_CI.sh
- name: run test
run: |
cd backends/metax_gpu/tests
bash run_test.sh -j 8
- name: push whl
env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
run: |
pip install bce-python-sdk==0.8.74
export AK=paddle
export SK=paddle
if [ ! -f "BosClient.py}" ]; then
wget -q --no-proxy https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate
tar xf bos_retry.tar.gz
fi
cp backends/metax_gpu/build/dist/paddle_metax_gpu*.whl .
python BosClient.py paddle_metax_gpu*.whl paddle-github-action/PaddleCustomDevice/metax_gpu/${PR_ID}/${COMMIT_ID}
cd backends/metax_gpu/build/dist/
ossutil ls oss://opensource-ci/paddle/
ossutil cat oss://opensource-ci/paddle/
ossutil cp ./paddle_metax_gpu-*.whl oss://opensource-ci/paddle/ -f