Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
362e4b1
migrate workflows to github actions
Manfredss Jun 15, 2026
b315d25
allow collaborator to rerun
Manfredss Jun 15, 2026
b59b79d
fix install
Manfredss Jun 15, 2026
5e763e2
fix other install issues
Manfredss Jun 15, 2026
db37267
fix codestyle
Manfredss Jun 15, 2026
a071939
fix the EOF with pre-commit
Manfredss Jun 16, 2026
d6b09c6
fix collection error
Manfredss Jun 17, 2026
e73b051
add __init__.py to allow tests import apibase
Manfredss Jun 17, 2026
5c2738a
change download source and change runing machine, as github hosted ma…
Manfredss Jun 17, 2026
b902e61
add no proxy to gpu related workflow, enable downloading
Manfredss Jun 17, 2026
601ac9a
add test info
Manfredss Jun 17, 2026
28994aa
fix gpu proxy issue
Manfredss Jun 17, 2026
693c398
delete debug job
Manfredss Jun 18, 2026
60afd0f
remove --no-proxy when download from bcebos.com
Manfredss Jun 18, 2026
3502f38
delete setup python, use python on self-hosted
Manfredss Jun 18, 2026
7943042
remove --no-proxy when download from bcebos.com
Manfredss Jun 18, 2026
543caaf
add non-confidencial info output
Manfredss Jun 18, 2026
4f087f0
print even more info
Manfredss Jun 18, 2026
b2f836c
pre-install torch and torchvision to avoid lond time waiting
Manfredss Jun 18, 2026
d19cb4b
move the CPU CI to docker, test if it works.
Manfredss Jun 22, 2026
f7d9696
add tsinghua source
Manfredss Jun 22, 2026
ba6e2ca
fix downloading errur
Manfredss Jun 22, 2026
02684db
fix and test
Manfredss Jun 22, 2026
a8b298e
remove tsinghua
Manfredss Jun 22, 2026
d863553
add retries and fallback
Manfredss Jun 22, 2026
a4847a8
add no proxy to exempt download bosbce
Manfredss Jun 22, 2026
3ad52d3
adjust proxy setting
Manfredss Jun 22, 2026
128f56e
fix
Manfredss Jun 22, 2026
7c6a2d2
pass the update
Manfredss Jun 23, 2026
590df4d
run the cpu test
Manfredss Jun 23, 2026
e6737a1
fix dir
Manfredss Jun 23, 2026
ae92ec0
fix cmd
Manfredss Jun 23, 2026
edac24d
add tsinghua
Manfredss Jun 23, 2026
64bd74f
add cpu docker, fix cpu CI
Manfredss Jun 23, 2026
0c8091b
download from aliyun
Manfredss Jun 23, 2026
fda60be
implement full CI
Manfredss Jun 23, 2026
1106da0
align the file name and fix typo
Manfredss Jun 23, 2026
7edf38b
fix proxy for modeltest
Manfredss Jun 23, 2026
6c11caf
test fallback to run on physical machine for gpu
Manfredss Jun 23, 2026
73801f3
fix the correct file entry
Manfredss Jun 24, 2026
fa931b3
enable gpu to run on docker
Manfredss Jun 24, 2026
19549cf
fix file dir
Manfredss Jun 24, 2026
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
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Enforce LF line endings for line-ending-sensitive files on every platform,
# so editors on Windows can't introduce CRLF (which breaks shell scripts and
# trips the codestyle / pre-commit checks).
*.sh text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.py text eol=lf
31 changes: 31 additions & 0 deletions .github/actions/rerun-workflow/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Rerun workflow'
description: 'Rerun a failed jobs or a specific named job for a pull request'

inputs:
GITHUB_TOKEN:
description: 'Token with actions:write scope (pass secrets.GITHUB_TOKEN).'
required: true
OWNER:
description: 'Repository owner'
required: true
REPO:
description: 'Repository name'
required: true
PR_ID:
description: 'Pull request ID'
required: true
JOB_NAME:
description: 'Name of the job to rerun'
required: true

runs:
using: 'composite'
steps:
- run: bash ./.github/actions/rerun-workflow/rerun.sh
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
OWNER: ${{ inputs.OWNER }}
REPO: ${{ inputs.REPO }}
PR_ID: ${{ inputs.PR_ID }}
JOB_NAME: ${{ inputs.JOB_NAME }}
77 changes: 77 additions & 0 deletions .github/actions/rerun-workflow/rerun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2026 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

COMMIT_SHA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_ID" | jq -r '.head.sha')

echo "Commit SHA: $COMMIT_SHA"

response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/actions/runs?head_sha=$COMMIT_SHA&per_page=100")

echo "Response: $response"

run_ids=$(echo "$response" | jq -r '.workflow_runs[].id')

if [ -n "$run_ids" ]; then
echo "Found run_ids for commit $COMMIT_SHA: $run_ids"

for run_id in $run_ids; do
if [ "$JOB_NAME" = "all-failed" ]; then
echo "Rerunning all failed jobs for run_id: $run_id"

rerun_response=$(curl -X POST -s -w "%{http_code}" -o /dev/null \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/rerun-failed-jobs")
if [ "$rerun_response" -eq 201 ]; then
echo "Successfully requested rerun for all blocked jobs in run_id: $run_id"
else
echo "Failed to request rerun for run_id: $run_id with status code $rerun_response"
fi

else
jobs_response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/jobs")

echo "Jobs Response for run_id $run_id: $jobs_response"

# if [[ "$JOB_NAME" == *"bypass"* ]]; then
block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
'.jobs[] | select(.name == $job_name) | .id')
# else
# block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
# '.jobs[] | select(.name == $job_name and .conclusion != "success") | .id')
# fi

if [ -n "$block_jobs" ]; then
echo "Found block jobs for run_id $run_id: $block_jobs"

for job_id in $block_jobs; do
echo "Rerunning job_id: $job_id"
curl -X POST -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/actions/jobs/$job_id/rerun"
done
else
echo "No block jobs found for run_id $run_id with name $JOB_NAME."
fi
fi
done
else
echo "No matching workflow runs found for commit $COMMIT_SHA."
exit 1
fi
93 changes: 93 additions & 0 deletions .github/workflows/Install_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Install Check

on:
# Nightly: re-validate master against the freshly built nightly paddle
# Cron is UTC: '0 21 * * *' => 05:00 UTC+8
# schedule:
# - cron: '0 21 * * *'
pull_request:
branches: [master, develop, "release/**"]
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.pre-commit-config.yaml'

push:
branches: [master, develop]
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.pre-commit-config.yaml'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
install-check:
name: Install Check
# TODO: replace with the actual self-hosted CPU runner group name
runs-on: ubuntu-24.04
timeout-minutes: 20

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: |
requirements.txt
tests/requirements.txt

- name: Install Latest Release CPU Version Torch
run: |
python -m pip install --upgrade pip
python -m pip install -U torch torchvision --index-url https://download.pytorch.org/whl/cpu
python -c "import torch; print('torch version information:', torch.__version__)"

- name: Install Latest develop CPU Version Paddle
run: |
python -m pip uninstall -y paddlepaddle
python -m pip uninstall -y paddlepaddle-gpu
python -m pip install --force-reinstall --no-cache-dir -U --pre paddlepaddle \
-i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ \
--extra-index-url https://pypi.org/simple \
--timeout 120 --retries 3
python -c "import paddle; print('paddle version information:', paddle.__version__); print('paddle commit information:', paddle.__git_commit__)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
if [ -f tests/requirements.txt ]; then
python -m pip install -r tests/requirements.txt
fi

- name: Install Check
run: |
python setup.py sdist bdist_wheel
python -m pip install dist/*.whl --force-reinstall
paconvert -V
paconvert --run_check

- name: Upload dist on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: install-dist-${{ github.run_id }}
path: dist/
if-no-files-found: ignore
retention-days: 14
181 changes: 181 additions & 0 deletions .github/workflows/Modeltest_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: Modeltest Check

on:
# Nightly: re-validate master against the freshly built nightly paddle
# Cron is UTC: '0 21 * * *' => 05:00 UTC+8
# schedule:
# - cron: '0 21 * * *'
pull_request:
branches: [master, develop, 'release/**']
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.pre-commit-config.yaml'

push:
branches: [master, develop]
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.pre-commit-config.yaml'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
modeltest:
name: Modeltest Check
runs-on:
group: PaConvert
timeout-minutes: 120
env:
TORCH_PROJECT_PATH: /workspace/torch_project

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Ensure CI image Exists
run: |
docker image inspect paconvert-ci:cu118 >/dev/null 2>&1 || \
docker build --pull -t paconvert-ci:cu118 -f tools/docker/Dockerfile tools/docker

- name: Start Container
run: |
container_name="paconvert-modeltest-${{ github.run_id }}-${{ github.run_attempt }}"
echo "container_name=${container_name}" >> "$GITHUB_ENV"
docker run -d --name "${container_name}" \
-e http_proxy=$http_proxy \
-e https_proxy=$https_proxy \
-e no_proxy="localhost,127.0.0.1" \
-e NVIDIA_VISIBLE_DEVICES=void \
-e TORCH_PROJECT_PATH="${TORCH_PROJECT_PATH}" \
--network host \
-v /dev/shm:/dev/shm \
-v "${{ github.workspace }}:/ws" \
-v "${TORCH_PROJECT_PATH}:${TORCH_PROJECT_PATH}:ro" \
-w /ws \
paconvert-ci:cu118 sleep infinity

- name: Run Modeltest
run: docker exec "${container_name}" bash scripts/ci/run_modeltest.sh

- name: Upload modeltest logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: modeltest-log-${{ github.run_id }}
path: |
failed_projects.txt
tests/code_library/model_case/**/convert_paddle_code*
if-no-files-found: ignore
retention-days: 14

- name: Cleanup Container
if: always()
run: |
if [ -n "${container_name:-}" ]; then
docker exec "${container_name}" chown -R "$(id -u):$(id -g)" /ws 2>/dev/null || true
docker rm -f "${container_name}" || true
fi


# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
# cache: pip
# cache-dependency-path: |
# requirements.txt
# tests/requirements.txt

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install -U torch --index-url https://download.pytorch.org/whl/cpu
# python -m pip uninstall -y paddlepaddle paddlepaddle-gpu

# # Detect current Python ABI tag (e.g. cp310) to avoid installing a mismatched wheel
# PY_ABI=$(python -c "import sys; print('cp{}{}'.format(*sys.version_info[:2]))")
# echo "Current Python ABI: $PY_ABI"

# if ls paddlepaddle-0.0.0-*.whl >/dev/null 2>&1; then
# # Validate the local wheel matches the current Python version before installing
# MATCHED_WHL=$(ls paddlepaddle-0.0.0-*${PY_ABI}*.whl 2>/dev/null | head -1)
# if [ -z "$MATCHED_WHL" ]; then
# echo "WARNING: local wheel found but none matches ABI $PY_ABI; falling back to nightly."
# python -m pip install --force-reinstall --no-cache-dir --pre paddlepaddle \
# -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ \
# --extra-index-url https://pypi.org/simple \
# --timeout 120 --retries 3
# else
# echo "Installing local wheel: $MATCHED_WHL"
# python -m pip install "$MATCHED_WHL"
# fi
# else
# # No local wheel — install from nightly with retry to reduce transient failures
# python -m pip install --force-reinstall --no-cache-dir --pre paddlepaddle \
# -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ \
# --timeout 120 --retries 3
# fi
# python -m pip install -r requirements.txt
# python -m pip install pandas openpyxl
# python -c "import torch; print('torch version information:', torch.__version__)"
# python -c "import paddle; print('paddle version information:', paddle.__version__); print('paddle commit information:', paddle.__git_commit__)"

# - name: Run code set convert check
# shell: bash
# run: |
# if [ ! -d "$TORCH_PROJECT_PATH" ]; then
# echo "$TORCH_PROJECT_PATH does not exist. Please prepare the model code set on the self-hosted runner."
# exit 1
# fi

# shopt -s nullglob
# projects=("$TORCH_PROJECT_PATH"/*)
# if [ ${#projects[@]} -eq 0 ]; then
# echo "$TORCH_PROJECT_PATH is empty. Please prepare the model code set on the self-hosted runner."
# exit 1
# fi

# failed_projects=()
# for project in "${projects[@]}"; do
# if [ -d "$project" ]; then
# project_name=$(basename "$project")
# echo "[code-set-convert] Converting project: $project_name"
# if ! python paconvert/main.py --in_dir "$project" --show_unsupport_api --calculate_speed; then
# failed_projects+=("$project_name")
# fi
# fi
# done

# if [ ${#failed_projects[@]} -ne 0 ]; then
# printf '%s\n' "${failed_projects[@]}" > failed_projects.txt
# echo "[code-set-convert] The following projects failed to convert:"
# cat failed_projects.txt
# exit 1
# fi

# - name: Run modeltest
# run: python tools/modeltest/modeltest_check.py

# - name: Upload modeltest logs on failure
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: modeltest-log-${{ github.run_id }}
# path: |
# failed_projects.txt
# tests/code_library/model_case/**/convert_paddle_code*
# if-no-files-found: ignore
# retention-days: 14
Loading
Loading