Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
uses: ./.github/workflows/_IXUCA.yml
needs: [Codestyle-Check]

metax:
name: metax
uses: ./.github/workflows/_Metax-X86.yml
needs: [Codestyle-Check]

#sdaa:
#name: sdaa
#uses: ./.github/workflows/_SDAA.yml
Expand Down
96 changes: 0 additions & 96 deletions .github/workflows/_Metax-X86.yaml

This file was deleted.

95 changes: 95 additions & 0 deletions .github/workflows/_Metax-X86.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: PR-CI-METAX

on:
workflow_call:
inputs:
workflow-name:
type: string
required: false
clone_dir:
type: string
required: false
default: 'PaddlecustomDevice'
is_pr:
type: string
required: false
default: 'true'

defaults:
run:
shell: bash

jobs:
metax-gpu-test:
runs-on: paddle-metax-runner-set
env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
BRANCH: develop

steps:
- name: Checkout repository
run: |
set -x
wget -q --tries=5 --no-proxy https://paddle-github-action.bj.bcebos.com/PaddleCustomDevice/PR/${PR_ID}/${COMMIT_ID}/PaddleCustomDevice.tar.gz --no-check-certificate
echo "Extracting PaddleCustomDevice.tar.gz"
tar -xf PaddleCustomDevice.tar.gz
cd PaddleCustomDevice
git config --global --add safe.directory "*"
git remote add upstream https://github.com/PaddlePaddle/PaddleCustomDevice.git
git merge ${BRANCH} --no-edit
git --no-pager log --pretty=oneline -5

- name: Check bypass
id: check-bypass
uses: ./PaddleCustomDevice/.github/actions/check-bypass
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
workflow-name: metax

- name: RUN METAX-GPU
id: run-metax
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
cd PaddleCustomDevice
# !!!!! SKIP IF NO METAX CHANGE !!!!
echo "=========== Checking PR Changes If METAX FULL CI Needed ==========="
change_numbers=$(git diff --name-only remotes/origin/${BRANCH} | wc -l)
change_backend=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/"| wc -l)
change_metax_only=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/metax_gpu"| wc -l)
git --no-pager diff --name-only remotes/origin/${BRANCH}
if [ $change_numbers -ne $change_backend ]; then
echo "Common file changed, continue to run METAX FULL CI test ..."
echo "should_skip=false" >> $GITHUB_OUTPUT
elif [ $change_metax_only -eq 0 ] ; then
echo "NO METAX backend changes found, skip METAX FULL CI ...."
echo "should_skip=true" >> $GITHUB_OUTPUT
exit 0
else
echo "should_skip=false" >> $GITHUB_OUTPUT
fi

- name: compile
run: |
cd PaddleCustomDevice/backends/metax_gpu
bash build.sh

- name: run test
run: |
cd PaddleCustomDevice/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 PaddleCustomDevice/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}
Loading