Skip to content

Commit 53c08f8

Browse files
authored
Release/2.0.4 (#2)
1 parent 3262466 commit 53c08f8

File tree

106 files changed

+3182
-769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3182
-769
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore = E203, E402, E501, E731, E741, W503, W605, E722
2+
ignore = E203, E402, E501, E731, E741, W503, W605, E722, E231, W604, E702, E226, E221, E713, E271
33
max-line-length = 119
44

55
# E402: module level import not at top of file

.github/workflows/Codestyle-Check.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Codestyle-Check
2+
3+
on:
4+
pull_request:
5+
branches: ["develop"]
6+
7+
jobs:
8+
pre-commit:
9+
name: Pre Commit
10+
if: ${{ github.repository_owner == 'PaddlePaddle' }}
11+
runs-on: ubuntu-latest
12+
env:
13+
PR_ID: ${{ github.event.pull_request.number }}
14+
BRANCH: develop
15+
16+
steps:
17+
- name: Cleanup
18+
run: |
19+
rm -rf * .[^.]*
20+
21+
- name: Checkout base repo
22+
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.pull_request.base.ref }}
25+
fetch-depth: 1000
26+
27+
- name: Merge PR to test branch
28+
run: |
29+
git fetch origin pull/${PR_ID}/merge
30+
git checkout -b test FETCH_HEAD
31+
32+
- name: Setup python3.10
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.10'
36+
cache: 'pip'
37+
38+
- name: Install dependencies
39+
run: |
40+
pip install pre-commit==4.2.0 cpplint==1.6.0 clang-format==13.0.0
41+
42+
- name: Check pre-commit
43+
env:
44+
SKIP_CLANG_TIDY_CHECK: "ON"
45+
run: |
46+
set +e
47+
bash -x tools/codestyle/pre_commit.sh;EXCODE=$?
48+
exit $EXCODE

.github/workflows/_build_linux.yml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: FastDeploy Linux GPU Build Task
2+
description: "FastDeploy packages build and upload"
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
DOCKER_IMAGE:
8+
description: "Build Images"
9+
required: true
10+
type: string
11+
default: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:cuda126-py310"
12+
FASTDEPLOY_ARCHIVE_URL:
13+
description: "URL of the compressed FastDeploy code archive."
14+
required: true
15+
type: string
16+
COMPILE_ARCH:
17+
description: "Build GPU Archs"
18+
required: true
19+
type: string
20+
default: "80,90"
21+
WITH_NIGHTLY_BUILD:
22+
description: "Enable nightly build mode (e.g. add date suffix to version)"
23+
required: false
24+
type: string
25+
default: "ON"
26+
FD_VERSION:
27+
description: "FastDeploy Package Version"
28+
required: false
29+
type: string
30+
default: ""
31+
UPLOAD:
32+
description: "Upload Package"
33+
required: false
34+
type: string
35+
default: "ON"
36+
CACHE_DIR:
37+
description: "Cache Dir Use"
38+
required: false
39+
type: string
40+
default: ""
41+
outputs:
42+
wheel_path:
43+
description: "Output path of the generated wheel"
44+
value: ${{ jobs.fd-build.outputs.wheel_path }}
45+
jobs:
46+
fd-build:
47+
runs-on: [self-hosted, GPU-h1z1-4Cards]
48+
outputs:
49+
wheel_path: ${{ steps.set_output.outputs.wheel_path }}
50+
steps:
51+
- name: Code Prepare
52+
shell: bash
53+
env:
54+
docker_image: ${{ inputs.DOCKER_IMAGE }}
55+
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
56+
IS_PR: ${{ github.event_name == 'pull_request' }}
57+
run: |
58+
set -x
59+
REPO="https://github.com/${{ github.repository }}.git"
60+
FULL_REPO="${{ github.repository }}"
61+
REPO_NAME="${FULL_REPO##*/}"
62+
BASE_BRANCH="${{ github.base_ref }}"
63+
64+
# Clean the repository directory before starting
65+
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
66+
-e "REPO_NAME=${REPO_NAME}" \
67+
${docker_image} /bin/bash -c '
68+
if [ -d ${REPO_NAME} ]; then
69+
echo "Directory ${REPO_NAME} exists, removing it..."
70+
rm -rf ${REPO_NAME}*
71+
fi
72+
'
73+
74+
wget -q ${fd_archive_url}
75+
tar -xf FastDeploy.tar.gz
76+
rm -rf FastDeploy.tar.gz
77+
cd FastDeploy
78+
git config --global user.name "FastDeployCI"
79+
git config --global user.email "fastdeploy_ci@example.com"
80+
git log -n 3 --oneline
81+
- name: FastDeploy Build
82+
shell: bash
83+
env:
84+
docker_image: ${{ inputs.DOCKER_IMAGE }}
85+
compile_arch: ${{ inputs.COMPILE_ARCH }}
86+
fd_version: ${{ inputs.FD_VERSION }}
87+
CACHE_DIR: ${{ inputs.CACHE_DIR }}
88+
run: |
89+
set -x
90+
runner_name="${{ runner.name }}"
91+
CARD_ID=$(echo "${runner_name}" | cut -d'-' -f2)
92+
gpu_id=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
93+
94+
CACHE_DIR=${CACHE_DIR:-${{ github.workspace }}}
95+
echo "CACHE_DIR is set to ${CACHE_DIR}"
96+
if [ ! -f "${CACHE_DIR}/gitconfig" ]; then
97+
touch "${CACHE_DIR}/gitconfig"
98+
fi
99+
PARENT_DIR=$(dirname "$WORKSPACE")
100+
echo "PARENT_DIR:$PARENT_DIR"
101+
docker run --rm --net=host \
102+
--cap-add=SYS_PTRACE --privileged --shm-size=64G \
103+
-v $(pwd):/workspace -w /workspace \
104+
-v "${CACHE_DIR}/gitconfig:/etc/gitconfig:ro" \
105+
-v "${CACHE_DIR}/.cache:/root/.cache" \
106+
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
107+
-e TZ="Asia/Shanghai" \
108+
-e "COMPILE_ARCH=${compile_arch}" \
109+
-e "FD_VERSION=${fd_version}" \
110+
-e "WITH_NIGHTLY_BUILD=${WITH_NIGHTLY_BUILD}" \
111+
--gpus "\"device=${gpu_id}\"" ${docker_image} /bin/bash -c '
112+
if [[ -n "${FD_VERSION}" ]]; then
113+
export FASTDEPLOY_VERSION=${FD_VERSION}
114+
echo "Custom FastDeploy version: ${FASTDEPLOY_VERSION}"
115+
fi
116+
117+
git config --global --add safe.directory /workspace/FastDeploy
118+
cd FastDeploy
119+
if [[ "${WITH_NIGHTLY_BUILD}" == "ON" ]];then
120+
GIT_COMMIT_TIME=$(git --no-pager show -s --format=%ci HEAD)
121+
DATE_ONLY=$(echo $GIT_COMMIT_TIME | sed "s/ .*//;s/-//g")
122+
echo "Git Commit Time: $GIT_COMMIT_TIME"
123+
echo "Date Only: $DATE_ONLY"
124+
export FASTDEPLOY_VERSION="${FASTDEPLOY_VERSION}.dev${DATE_ONLY}"
125+
fi
126+
pip config set global.index-url http://pip.baidu.com/root/baidu/+simple/
127+
pip config set install.trusted-host pip.baidu.com
128+
pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
129+
130+
python -m pip install --upgrade pip
131+
python -m pip install -r requirements.txt
132+
python -m pip install wheel
133+
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
134+
# 编译RDMA
135+
export ENABLE_FD_RDMA=1
136+
bash build.sh 1 python false [${COMPILE_ARCH}]
137+
ls ./dist/*.whl
138+
'
139+
- name: Package Upload
140+
id: set_output
141+
env:
142+
compile_arch: ${{ inputs.COMPILE_ARCH }}
143+
run: |
144+
set -x
145+
if [[ "${{ github.event_name }}" == "pull_request" ]];then
146+
commit_id=${{ github.event.pull_request.head.sha }}
147+
pr_num=${{ github.event.pull_request.number }}
148+
target_path=paddle-github-action/PR/FastDeploy/${pr_num}/${commit_id}/SM${compile_arch//,/_}
149+
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
150+
commit_id=${{ github.sha }}
151+
tag_name=${{ github.ref_name }}
152+
target_path=paddle-github-action/TAG/FastDeploy/${tag_name}/${commit_id}/SM${compile_arch//,/_}
153+
else
154+
commit_id=${{ github.sha }}
155+
branch_name=${{ github.ref_name }}
156+
target_path=paddle-github-action/BRANCH/FastDeploy/${branch_name}/${commit_id}/SM${compile_arch//,/_}
157+
fi
158+
wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py
159+
push_file=$(realpath bos_tools.py)
160+
python --version
161+
python -m pip install bce-python-sdk==0.9.29
162+
cd FastDeploy/dist/
163+
matches=($(ls fastdeploy*.whl))
164+
if [ ${#matches[@]} -ne 1 ]; then
165+
echo "Error: Found ${#matches[@]} matching files, expected exactly 1"
166+
exit 1
167+
fi
168+
fd_wheel_name=${matches[0]}
169+
echo "Found: $fd_wheel_name"
170+
tree -L 3
171+
python ${push_file} fastdeploy*.whl ${target_path}
172+
target_path_stripped="${target_path#paddle-github-action/}"
173+
WHEEL_PATH=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/${fd_wheel_name}
174+
echo "wheel_path=${WHEEL_PATH}" >> $GITHUB_OUTPUT

.github/workflows/_clone_linux.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: FastDeploy Code Clone
2+
description: "FastDeploy clone and upload"
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
bos_dir:
8+
type: string
9+
required: false
10+
default: 'FastDeploy'
11+
outputs:
12+
repo_archive_url:
13+
description: "Compressed source code archive."
14+
value: ${{ jobs.code-clone.outputs.repo_archive_url }}
15+
jobs:
16+
code-clone:
17+
runs-on:
18+
group: HK-Clone
19+
outputs:
20+
repo_archive_url: ${{ steps.set_output.outputs.repo_archive_url }}
21+
steps:
22+
- name: Clone FastDeploy
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event_name == 'pull_request'
26+
&& github.event.pull_request.base.ref
27+
|| github.ref_name }}
28+
submodules: 'recursive'
29+
fetch-depth: 1000
30+
31+
- name: Merge PR (if needed)
32+
if: ${{ github.event_name == 'pull_request' }}
33+
run: |
34+
git config --global user.name "FastDeployCI"
35+
git config --global user.email "fastdeploy_ci@example.com"
36+
echo "Fetching and merging PR..."
37+
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr/${{ github.event.pull_request.number }}
38+
git merge --no-ff pr/${{ github.event.pull_request.number }}
39+
echo "PR Branch log "
40+
git log --oneline -n 5 pr/${{ github.event.pull_request.number }}
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.10'
44+
- name: Code Info Show and Upload
45+
id: set_output
46+
env:
47+
AK: paddle
48+
SK: paddle
49+
run: |
50+
git config --unset http.https://github.com/.extraheader
51+
git submodule foreach --recursive sh -c "git config --local --unset-all 'http.https://github.com/.extraheader'"
52+
git submodule foreach --recursive sh -c "git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'"
53+
echo "Current HEAD Log:"
54+
git log --oneline -n 5
55+
ls
56+
cd ..
57+
tar -zcf FastDeploy.tar.gz FastDeploy
58+
if [[ "${{ github.event_name }}" == "pull_request" ]];then
59+
commit_id=${{ github.event.pull_request.head.sha }}
60+
pr_num=${{ github.event.pull_request.number }}
61+
target_path=paddle-github-action/PR/FastDeploy/${pr_num}/${commit_id}
62+
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
63+
commit_id=${{ github.sha }}
64+
tag_name=${{ github.ref_name }}
65+
target_path=paddle-github-action/TAG/FastDeploy/${tag_name}/${commit_id}
66+
else
67+
commit_id=${{ github.sha }}
68+
branch_name=${{ github.ref_name }}
69+
target_path=paddle-github-action/BRANCH/FastDeploy/${branch_name}/${commit_id}
70+
fi
71+
wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py
72+
push_file=$(realpath bos_tools.py)
73+
python -m pip install bce-python-sdk==0.9.29
74+
ls
75+
python ${push_file} FastDeploy.tar.gz ${target_path}
76+
target_path_stripped="${target_path#paddle-github-action/}"
77+
REPO_ARCHIVE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/FastDeploy.tar.gz
78+
echo "repo_archive_url=${REPO_ARCHIVE_URL}" >> $GITHUB_OUTPUT
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: PR Build and Test
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
branches: [develop, release/**]
6+
permissions: read-all
7+
8+
concurrency:
9+
group: ${{ github.event.pull_request.number }}-${{ github.workflow }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
clone:
14+
name: FD-Clone-Linux
15+
uses: ./.github/workflows/_clone_linux.yml
16+
17+
build:
18+
name: FD-Build-Linux
19+
needs: clone
20+
uses: ./.github/workflows/_build_linux.yml
21+
with:
22+
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:cuda126-py310
23+
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
24+
COMPILE_ARCH: "90"
25+
WITH_NIGHTLY_BUILD: "OFF"
26+
FD_VERSION: "0.0.0"
27+
28+
resultshow:
29+
name: Use Build Output
30+
needs: build
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Print wheel path
34+
run: |
35+
echo "The built wheel is located at: ${{ needs.build.outputs.wheel_path }}"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default_stages:
77
# - manual # Run in CI
88
repos:
99
- repo: https://github.com/psf/black.git
10-
rev: 22.8.0
10+
rev: 25.1.0
1111
hooks:
1212
- id: black
1313
files: \.(py|pyi)$
@@ -18,7 +18,7 @@ repos:
1818
hooks:
1919
- id: isort
2020
- repo: https://github.com/PyCQA/flake8
21-
rev: 4.0.1
21+
rev: 7.0.0
2222
hooks:
2323
- id: flake8
2424
# 代码检查

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
## News
2828

29+
**[2025-07] 《FastDeploy2.0推理部署实测》专题活动已上线!** 完成文心4.5系列开源模型的推理部署等任务,即可获得骨瓷马克杯等FastDeploy2.0官方周边及丰富奖金!🎁 欢迎大家体验反馈~ 📌[报名地址](https://www.wjx.top/vm/meSsp3L.aspx#) 📌[活动详情](https://github.com/PaddlePaddle/FastDeploy/discussions/2728)
30+
31+
**[2025-07] The FastDeploy 2.0 Inference Deployment Challenge is now live!** Complete the inference deployment task for the ERNIE 4.5 series open-source models to win official FastDeploy 2.0 merch and generous prizes! 🎁 You're welcome to try it out and share your feedback! 📌[Sign up here](https://www.wjx.top/vm/meSsp3L.aspx#) 📌[Event details](https://github.com/PaddlePaddle/FastDeploy/discussions/2728)
32+
2933
**[2025-06] 🔥 Released FastDeploy v2.0:** Supports inference and deployment for ERNIE 4.5. Furthermore, we open-source an industrial-grade PD disaggregation with context caching, dynamic role switching for effective resource utilization to further enhance inference performance for MoE models.
3034

3135
## About

benchmarks/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ python -m pip install -r requirements.txt
4141
--metric-percentiles 80,95,99,99.9,99.95,99.99:性能结果中展示的性能指标分位值
4242
--num-prompts 1:总计发送多少条请求
4343
--max-concurrency 1:压测并发数
44-
--save-result:开启结果保存,结果文件会存入json
44+
--save-result:开启结果保存,结果文件会存入json,默认False不保存
45+
--debug:开启debug模式,逐条打印payload和output内容,默认False
46+
--shuffle:是否打乱数据集,默认False不打乱
47+
--seed:打乱数据集时的随机种子,默认0
4548
```
4649

4750
##### /v1/chat/completions接口压测单条数据调试

0 commit comments

Comments
 (0)