Skip to content

Commit e82542e

Browse files
authored
Merge branch 'metax666:develop' into develop
2 parents 515ee19 + 57305a5 commit e82542e

110 files changed

Lines changed: 2279 additions & 644 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Rerun Workflow'
2+
description: 'Re-run GitHub Actions workflow for a given Pull Request'
3+
inputs:
4+
GITHUB_TOKEN:
5+
description: 'GitHub token with repo scope'
6+
required: true
7+
OWNER:
8+
description: 'Repository owner'
9+
required: true
10+
REPO:
11+
description: 'Repository name'
12+
required: true
13+
PR_ID:
14+
description: 'Pull Request ID'
15+
required: true
16+
JOB_NAME:
17+
description: 'Job name to rerun'
18+
required: true
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- run: bash ./.github/actions/rerun-workflow/rerun.sh
24+
shell: bash
25+
env:
26+
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
27+
OWNER: ${{ inputs.OWNER }}
28+
REPO: ${{ inputs.REPO }}
29+
PR_ID: ${{ inputs.PR_ID }}
30+
JOB_NAME: ${{ inputs.JOB_NAME }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set -e
16+
17+
COMMIT_SHA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
18+
"https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_ID" | jq -r '.head.sha')
19+
20+
echo "Commit SHA: $COMMIT_SHA"
21+
22+
response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
23+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs?head_sha=$COMMIT_SHA&per_page=100")
24+
25+
echo "Response: $response"
26+
27+
run_ids=$(echo "$response" | jq -r '.workflow_runs[].id')
28+
29+
if [ -n "$run_ids" ]; then
30+
echo "Found run_ids for commit $COMMIT_SHA: $run_ids"
31+
32+
for run_id in $run_ids; do
33+
if [ "$JOB_NAME" = "all-failed" ]; then
34+
echo "Rerunning all failed jobs for run_id: $run_id"
35+
36+
rerun_response=$(curl -X POST -s -w "%{http_code}" -o /dev/null \
37+
-H "Accept: application/vnd.github.v3+json" \
38+
-H "Authorization: Bearer $GITHUB_TOKEN" \
39+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/rerun-failed-jobs")
40+
if [ "$rerun_response" -eq 201 ]; then
41+
echo "Successfully requested rerun for all blocked jobs in run_id: $run_id"
42+
else
43+
echo "Failed to request rerun for run_id: $run_id with status code $rerun_response"
44+
fi
45+
46+
else
47+
jobs_response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
48+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/jobs")
49+
50+
echo "Jobs Response for run_id $run_id: $jobs_response"
51+
52+
# if [[ "$JOB_NAME" == *"bypass"* ]]; then
53+
block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
54+
'.jobs[] | select(.name == $job_name) | .id')
55+
# else
56+
# block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
57+
# '.jobs[] | select(.name == $job_name and .conclusion != "success") | .id')
58+
# fi
59+
60+
if [ -n "$block_jobs" ]; then
61+
echo "Found block jobs for run_id $run_id: $block_jobs"
62+
63+
for job_id in $block_jobs; do
64+
echo "Rerunning job_id: $job_id"
65+
curl -X POST -H "Accept: application/vnd.github.v3+json" \
66+
-H "Authorization: token $GITHUB_TOKEN" \
67+
"https://api.github.com/repos/$OWNER/$REPO/actions/jobs/$job_id/rerun"
68+
done
69+
else
70+
echo "No block jobs found for run_id $run_id with name $JOB_NAME."
71+
fi
72+
fi
73+
done
74+
else
75+
echo "No matching workflow runs found for commit $COMMIT_SHA."
76+
exit 1
77+
fi

.github/workflows/CI.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ jobs:
4747
uses: ./.github/workflows/_IXUCA.yml
4848
needs: [Codestyle-Check]
4949

50-
sdaa:
51-
name: sdaa
52-
uses: ./.github/workflows/_SDAA.yml
50+
metax:
51+
name: metax
52+
uses: ./.github/workflows/_Metax-X86.yml
5353
needs: [Codestyle-Check]
5454

55+
#sdaa:
56+
#name: sdaa
57+
#uses: ./.github/workflows/_SDAA.yml
58+
#needs: [Codestyle-Check]
59+
5560
npu-910b-arm:
5661
name: npu-910B-ARM
5762
uses: ./.github/workflows/_910B-ARM.yml
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: paddle metax build and publish
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 18 * * *' # 2:00 AM China Standard Time (UTC+8)
7+
push:
8+
tags:
9+
- '*'
10+
11+
permissions: read-all
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
jobs:
18+
metax-gpu-publish:
19+
environment: PublishUploadUse
20+
env:
21+
PaddleCustomDeviceVersion: ${{ vars.PaddleCustomDeviceVersion }}
22+
runs-on: paddle-metax-runner-set
23+
steps:
24+
- name: Checkout repository
25+
run: |
26+
git config --global user.name "GitHub Actions"
27+
git config --global user.email "actions@github.com"
28+
29+
git clone \
30+
--reference-if-able /home/runner/PaddleCustomDevice \
31+
--depth=1 \
32+
--shallow-submodules \
33+
--jobs=8 \
34+
--branch ${{ github.base_ref || github.ref_name}} \
35+
--recurse-submodules \
36+
https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git .
37+
38+
39+
- name: compile
40+
run: |
41+
if [[ "${{ github.ref_name }}" == "develop" ]];then
42+
GIT_COMMIT_TIME=$(git --no-pager show -s --format=%ci HEAD)
43+
DATE_ONLY=$(echo $GIT_COMMIT_TIME | sed "s/ .*//;s/-//g")
44+
echo "Git Commit Time: $GIT_COMMIT_TIME"
45+
echo "Date Only: $DATE_ONLY"
46+
export PADDLE_VERSION="${PaddleCustomDeviceVersion}.dev${DATE_ONLY}"
47+
export PLUGIN_VERSION="${PaddleCustomDeviceVersion}.dev${DATE_ONLY}"
48+
else
49+
TAG_REF="${{ github.ref_name }}"
50+
VERSION="${TAG_REF#v}"
51+
echo "VERSION=$VERSION"
52+
export PADDLE_VERSION="${VERSION}"
53+
export PLUGIN_VERSION="${VERSION}"
54+
fi
55+
cd backends/metax_gpu
56+
bash build.sh
57+
58+
- name: push whl
59+
env:
60+
AK: ${{ secrets.BOS_AK }}
61+
SK: ${{ secrets.BOS_SK }}
62+
run: |
63+
if [[ "${{ github.ref_name }}" == "develop" ]];then
64+
target_path="paddle-whl/nightly/maca/paddle-metax-gpu"
65+
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
66+
target_path="paddle-whl/stable/maca/paddle-metax-gpu"
67+
else
68+
echo "Not develop or tag, do nothing"
69+
fi
70+
pip install bce-python-sdk==0.8.74
71+
72+
if [ ! -f "BosClient.py}" ]; then
73+
wget -q --no-proxy https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate
74+
tar xf bos_retry.tar.gz
75+
fi
76+
cp backends/metax_gpu/build/dist/paddle_metax_gpu*.whl .
77+
python BosClient.py paddle_metax_gpu*.whl ${target_path}

.github/workflows/_910B-ARM.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ jobs:
3939
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
4040

4141
steps:
42-
- name: Cleanup
43-
run: |
44-
rm -rf * .[^.]*
45-
4642
- name: Check docker image and run container
4743
env:
4844
GIT_PR_ID: ${{ github.event.pull_request.number || '0' }}
@@ -91,6 +87,7 @@ jobs:
9187
- name: Download Code
9288
run: |
9389
docker exec -t ${{ env.container_name }} /bin/bash -c '
90+
rm -rf /PaddleCustomDevice/* /PaddleCustomDevice/.[^.]* 2>/dev/null || true
9491
source ${{ github.workspace }}/../../../proxy
9592
set -x
9693
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
@@ -109,7 +106,7 @@ jobs:
109106
change_numbers=$(git diff --name-only remotes/origin/${BRANCH} | wc -l)
110107
change_backend=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/"| wc -l)
111108
change_npu_only=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/npu"| wc -l)
112-
git diff --name-only remotes/origin/${BRANCH}
109+
git --no-pager diff --name-only remotes/origin/${BRANCH}
113110
114111
if [ $change_numbers -ne $change_backend ]; then
115112
echo "Common file changed, continue to run NPU FULL CI test ..."
@@ -132,14 +129,15 @@ jobs:
132129
# Install python packages required for incremental coverage
133130
python -m pip install PyGithub
134131
export LD_PRELOAD=/lib/aarch64-linux-gnu/libgomp.so.1:$LD_PRELOAD
135-
132+
export PADDLE_VERSION=0.0.0
136133
bash backends/npu/tools/pr_ci_npu.sh'
137134
138135
- name: Terminate and delete the container
139136
if: always()
140137
run: |
141138
docker exec -t ${{ env.container_name }} /bin/bash -c '
142139
rm -rf * .[^.]*
140+
chmod -R 777 . || true
143141
'
144142
docker stop ${container_name}
145143
docker rm ${container_name}

.github/workflows/_910B-X86.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ jobs:
3838
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
3939

4040
steps:
41-
- name: Cleanup
42-
run: |
43-
rm -rf * .[^.]*
44-
4541
- name: Check docker image and run container
4642
env:
4743
GIT_PR_ID: ${{ github.event.pull_request.number || '0' }}
@@ -90,6 +86,7 @@ jobs:
9086
- name: Download Code
9187
run: |
9288
docker exec -t ${{ env.container_name }} /bin/bash -c '
89+
rm -rf /PaddleCustomDevice/* /PaddleCustomDevice/.[^.]* 2>/dev/null || true
9390
source ${{ github.workspace }}/../../../proxy
9491
set -x
9592
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
@@ -108,7 +105,7 @@ jobs:
108105
change_numbers=$(git diff --name-only remotes/origin/${BRANCH} | wc -l)
109106
change_backend=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/"| wc -l)
110107
change_npu_only=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/npu"| wc -l)
111-
git diff --name-only remotes/origin/${BRANCH}
108+
git --no-pager diff --name-only remotes/origin/${BRANCH}
112109
113110
if [ $change_numbers -ne $change_backend ]; then
114111
echo "Common file changed, continue to run NPU FULL CI test ..."
@@ -130,14 +127,15 @@ jobs:
130127
python -c "import paddle; print(paddle.version.commit)"
131128
# Install python packages required for incremental coverage
132129
python -m pip install PyGithub
133-
130+
export PADDLE_VERSION=0.0.0
134131
bash backends/npu/tools/pr_ci_npu.sh'
135132
136133
- name: Terminate and delete the container
137134
if: always()
138135
run: |
139136
docker exec -t ${{ env.container_name }} /bin/bash -c '
140137
rm -rf * .[^.]*
138+
chmod -R 777 . || true
141139
'
142140
docker stop ${container_name}
143141
docker rm ${container_name}

.github/workflows/_Clone-linux.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ jobs:
6262
git merge --no-edit ${BRANCH}
6363
git submodule sync
6464
git submodule update --init --recursive --force
65+
cd Paddle/third_party/protobuf
66+
git fetch --tags
67+
cd ../pybind
68+
git fetch --tags
69+
cd ../../..
6570
6671
- name: Download bos client
6772
env:

.github/workflows/_GCU.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
change_numbers=$(git diff --name-only remotes/origin/${BRANCH} | wc -l)
8484
change_backend=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/"| wc -l)
8585
change_gcu_only=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/gcu"| wc -l)
86-
git diff --name-only remotes/origin/${BRANCH}
86+
git --no-pager diff --name-only remotes/origin/${BRANCH}
8787
8888
if [ $change_numbers -ne $change_backend ]; then
8989
echo "Common file changed, continue to run GCU FULL CI test ..."

.github/workflows/_HPU.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Download Code
6767
run: |
6868
docker exec -t ${{ env.container_name }} /bin/bash -c '
69-
rm -rf * .[^.]*
69+
rm -rf /workspace/* /workspace/.[^.]* 2>/dev/null || true
7070
source ${{ github.workspace }}/../../../proxy
7171
set -x
7272
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
@@ -87,7 +87,7 @@ jobs:
8787
change_numbers=$(git diff --name-only remotes/origin/${BRANCH} | wc -l)
8888
change_backend=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/"| wc -l)
8989
change_hpu_only=$(git diff --name-only remotes/origin/${BRANCH} | grep "backends/intel_hpu"| wc -l)
90-
git diff --name-only remotes/origin/${BRANCH}
90+
git --no-pager diff --name-only remotes/origin/${BRANCH}
9191
if [ $change_numbers -ne $change_backend ]; then
9292
echo "Common file changed, continue to run HPU FULL CI test ..."
9393
elif [ $change_hpu_only -eq 0 ] ; then
@@ -96,6 +96,7 @@ jobs:
9696
fi
9797
mkdir -p /workspace/PaddleCustomDevice/backends/intel_hpu/build/
9898
export GC_KERNEL_PATH=/workspace/PaddleCustomDevice/backends/intel_hpu/build/libcustom_tpc_perf_lib.so:/usr/lib/habanalabs/libtpc_kernels.so
99+
export PADDLE_VERSION=0.0.0
99100
cd /workspace
100101
bash /workspace/PaddleCustomDevice/backends/intel_hpu/tools/pr_hpu_ci.sh'
101102
@@ -104,6 +105,7 @@ jobs:
104105
run: |
105106
docker exec -t ${{ env.container_name }} /bin/bash -c '
106107
rm -rf * .[^.]*
108+
chmod -R 777 . || true
107109
'
108110
docker stop ${container_name}
109111
docker rm ${container_name}

0 commit comments

Comments
 (0)