Skip to content

Commit ab70c78

Browse files
authored
Merge branch 'develop' into append_attn_pr
2 parents 971f81e + 56e2d7e commit ab70c78

File tree

273 files changed

+22953
-3158
lines changed

Some content is hidden

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

273 files changed

+22953
-3158
lines changed

.github/workflows/_accuracy_test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,15 @@ jobs:
118118
119119
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
120120
121+
echo "========================================================="
122+
echo "Ensuring no stale container named ${runner_name} ..."
123+
if [ "$(docker ps -a -q -f name=${runner_name})" ]; then
124+
echo "Removing stale container: ${runner_name}"
125+
docker rm -f ${runner_name} || true
126+
fi
127+
121128
docker run --rm --ipc=host --pid=host --net=host \
129+
--name ${runner_name} \
122130
-v $(pwd):/workspace \
123131
-w /workspace \
124132
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
@@ -132,6 +140,7 @@ jobs:
132140
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
133141
-e TZ="Asia/Shanghai" \
134142
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
143+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
135144
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
136145
137146
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

.github/workflows/_base_test.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,15 @@ jobs:
118118
119119
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
120120
121+
echo "========================================================="
122+
echo "Ensuring no stale container named ${runner_name} ..."
123+
if [ "$(docker ps -a -q -f name=${runner_name})" ]; then
124+
echo "Removing stale container: ${runner_name}"
125+
docker rm -f ${runner_name} || true
126+
fi
127+
121128
docker run --rm --ipc=host --pid=host --net=host \
129+
--name ${runner_name} \
122130
-v $(pwd):/workspace \
123131
-w /workspace \
124132
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
@@ -132,6 +140,7 @@ jobs:
132140
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
133141
-e TZ="Asia/Shanghai" \
134142
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
143+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
135144
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
136145
137146
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
@@ -155,7 +164,19 @@ jobs:
155164
-H "Content-Type: application/json" \
156165
-d "{\"--model\": \"/MODELDATA/ERNIE-4.5-0.3B-Paddle\"}"
157166
158-
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
167+
check_service() {
168+
local timeout=${1:-90}
169+
local url="http://localhost:${FLASK_PORT}/wait_for_infer?timeout=${timeout}"
170+
local resp
171+
172+
resp=$(curl -s -X POST "$url")
173+
174+
if echo "$resp" | grep -q "服务启动超时"; then
175+
exit 8
176+
fi
177+
}
178+
179+
check_service 90
159180
popd
160181
161182
pushd tests/ce/server
@@ -166,8 +187,23 @@ jobs:
166187
curl -X POST http://0.0.0.0:${FLASK_PORT}/switch \
167188
-H "Content-Type: application/json" \
168189
-d "{\"--model\": \"/MODELDATA/ERNIE-4.5-0.3B-Paddle\", \"--early-stop-config\": \"{\\\"enable_early_stop\\\":true, \\\"window_size\\\":6, \\\"threshold\\\":0.93}\"}"
169-
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
190+
check_service 90
170191
python -m pytest -sv test_repetition_early_stop.py || TEST_EXIT_CODE=1
192+
193+
curl -X POST http://0.0.0.0:${FLASK_PORT}/switch \
194+
-H "Content-Type: application/json" \
195+
-d "{\"--model\": \"/MODELDATA/ernie-4_5-21b-a3b-bf16-paddle\", \"--config\": \"21b_mtp.yaml\", \"--enable-logprob\": \"False\"}"
196+
check_service 180
197+
export TEMPLATE=TOKEN_NORMAL
198+
python -m pytest -sv test_seed_usage.py -k "not test_seed_stream" || TEST_EXIT_CODE=1
199+
200+
curl -X POST http://0.0.0.0:${FLASK_PORT}/switch \
201+
-H "Content-Type: application/json" \
202+
-d "{\"--model\": \"/MODELDATA/ernie-4_5-21b-a3b-bf16-paddle\", \"--config\": \"21b_sot.yaml\", \"--enable-logprob\": \"False\"}"
203+
check_service 360
204+
export TEMPLATE=TOKEN_NORMAL
205+
python -m pytest -sv test_seed_usage.py -k "not test_seed_stream" || TEST_EXIT_CODE=1
206+
171207
popd
172208
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> /workspace/FastDeploy/exit_code.env
173209
'

.github/workflows/_build_linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ jobs:
148148
elif [[ "${PADDLEVERSION}" != "" ]];then
149149
python -m pip install paddlepaddle-gpu==${PADDLEVERSION} -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
150150
else
151+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
151152
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
152153
fi
153154

.github/workflows/_logprob_test_linux.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,15 @@ jobs:
108108
109109
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
110110
111+
echo "========================================================="
112+
echo "Ensuring no stale container named ${runner_name} ..."
113+
if [ "$(docker ps -a -q -f name=${runner_name})" ]; then
114+
echo "Removing stale container: ${runner_name}"
115+
docker rm -f ${runner_name} || true
116+
fi
117+
111118
docker run --rm --ipc=host --pid=host --net=host \
119+
--name ${runner_name} \
112120
-v $(pwd):/workspace \
113121
-w /workspace \
114122
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
@@ -122,6 +130,7 @@ jobs:
122130
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
123131
-e TZ="Asia/Shanghai" \
124132
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
133+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
125134
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
126135
127136
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

.github/workflows/_pre_ce_test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,17 @@ jobs:
115115
116116
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
117117
118-
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
118+
echo "========================================================="
119+
echo "Ensuring no stale container named ${runner_name} ..."
120+
if [ "$(docker ps -a -q -f name=${runner_name})" ]; then
121+
echo "Removing stale container: ${runner_name}"
122+
docker rm -f ${runner_name} || true
123+
fi
124+
125+
docker run --rm --net=host \
126+
--name ${runner_name} \
127+
-v $(pwd):/workspace \
128+
-w /workspace \
119129
-v "${CACHE_DIR}/gitconfig:/etc/gitconfig:ro" \
120130
-v "${CACHE_DIR}/.cache:/root/.cache" \
121131
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
@@ -129,6 +139,7 @@ jobs:
129139
--gpus "\"device=${DEVICES}\"" ${docker_image} /bin/bash -c '
130140
git config --global --add safe.directory /workspace/FastDeploy
131141
cd FastDeploy
142+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
132143
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
133144
python -m pip install ${fd_wheel_url}
134145
bash scripts/run_pre_ce.sh

.github/workflows/_stable_test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
echo "FD_API_PORT=${FD_API_PORT}"
8989
echo "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}"
9090
echo "FD_METRICS_PORT=${FD_METRICS_PORT}"
91-
echo "FD_INFERENCE_MSG_QUEUE_ID=${INFERENCE_MSG_QUEUE_ID}"
91+
echo "FD_INFERENCE_MSG_QUEUE_ID=${FD_INFERENCE_MSG_QUEUE_ID}"
9292
echo "FD_CACHE_QUEUE_PORT=${FD_CACHE_QUEUE_PORT}"
9393
echo "DEVICES=${DEVICES}"
9494
echo "========================================================="
@@ -122,7 +122,15 @@ jobs:
122122
123123
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
124124
125+
echo "========================================================="
126+
echo "Ensuring no stale container named ${runner_name} ..."
127+
if [ "$(docker ps -a -q -f name=${runner_name})" ]; then
128+
echo "Removing stale container: ${runner_name}"
129+
docker rm -f ${runner_name} || true
130+
fi
131+
125132
docker run --rm --ipc=host --pid=host --net=host \
133+
--name ${runner_name} \
126134
-v $(pwd):/workspace \
127135
-w /workspace \
128136
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
@@ -138,6 +146,7 @@ jobs:
138146
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
139147
-e TZ="Asia/Shanghai" \
140148
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
149+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
141150
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
142151
143152
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

.github/workflows/_unit_test_coverage.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,23 @@ on:
2727
required: false
2828
type: string
2929
default: ""
30+
secrets:
31+
github-token:
32+
required: true
3033

3134
jobs:
35+
check_cov_skip:
36+
uses: ./.github/workflows/check-bypass.yml
37+
secrets:
38+
github-token: ${{ secrets.github-token }}
39+
with:
40+
workflow-name: coverage
41+
3242
run_tests_with_coverage:
3343
runs-on: [self-hosted, GPU-h1z1-2Cards]
3444
timeout-minutes: 60
45+
needs: check_cov_skip
46+
if: needs.check_cov_skip.outputs.can-skip != 'true'
3547
outputs:
3648
diff_cov_file_url: ${{ steps.cov_upload.outputs.diff_cov_file_url }}
3749
unittest_failed_url: ${{ steps.cov_upload.outputs.unittest_failed_url }}
@@ -124,7 +136,15 @@ jobs:
124136
125137
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
126138
139+
echo "========================================================="
140+
echo "Ensuring no stale container named ${runner_name} ..."
141+
if [ "$(docker ps -a -q -f name=${runner_name})" ]; then
142+
echo "Removing stale container: ${runner_name}"
143+
docker rm -f ${runner_name} || true
144+
fi
145+
127146
docker run --rm --net=host \
147+
--name ${runner_name} \
128148
--cap-add=SYS_PTRACE --shm-size=64G \
129149
-v $(pwd):/workspace -w /workspace \
130150
-v "${CACHE_DIR}/gitconfig:/etc/gitconfig:ro" \
@@ -144,12 +164,14 @@ jobs:
144164
145165
git config --global --add safe.directory /workspace/FastDeploy
146166
cd FastDeploy
167+
#python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
147168
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
148169
149170
pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
150171
151172
python -m pip install coverage
152173
python -m pip install diff-cover
174+
python -m pip install pytest-cov
153175
python -m pip install jsonschema aistudio_sdk==0.3.5
154176
python -m pip install ${fd_wheel_url}
155177
if [ -d "tests/plugins" ]; then
@@ -166,7 +188,7 @@ jobs:
166188
bash scripts/coverage_run.sh || TEST_EXIT_CODE=8
167189
git diff origin/${BASE_REF}..HEAD --unified=0 > diff.txt
168190
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> exit_code.env
169-
coverage combine coveragedata/
191+
coverage combine coveragedata/ || echo "No data to combine"
170192
coverage xml -o python_coverage_all.xml
171193
COVERAGE_EXIT_CODE=0
172194
if [[ "$IS_PR" == "true" ]]; then
@@ -267,12 +289,17 @@ jobs:
267289
needs: run_tests_with_coverage
268290
if: always()
269291
runs-on: ubuntu-latest
292+
env:
293+
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
270294
steps:
271295
- name: coverage diff file download
272296
shell: bash
273297
env:
274298
diff_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url }}
275299
run: |
300+
wget ${fd_archive_url}
301+
tar -xf FastDeploy.tar.gz
302+
cd FastDeploy
276303
if [ -z "${diff_cov_file_url}" ]; then
277304
echo "No diff coverage file URL provided."
278305
exit 0
@@ -282,6 +309,9 @@ jobs:
282309
if: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url != null && needs.run_tests_with_coverage.outputs.diff_cov_file_url != '' }}
283310
uses: codecov/codecov-action@v5
284311
with:
285-
files: ./diff_coverage.xml
312+
files: ./FastDeploy/diff_coverage.xml
286313
name: python diff coverage
287314
verbose: true
315+
disable_search: true
316+
commit_parent: false
317+
flags: diff

.github/workflows/check-bypass.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
workflow-name:
5+
required: true
6+
type: string
7+
secrets:
8+
github-token:
9+
required: true
10+
outputs:
11+
can-skip:
12+
description: "Whether the workflow can be skipped."
13+
value: ${{ jobs.check-bypass.outputs.can-skip }}
14+
15+
jobs:
16+
check-bypass:
17+
name: Check bypass
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
env:
22+
CI_TEAM_MEMBERS: '["yuanlehome","YuanRisheng","Jiang-Jia-Jun","DDDivano","XieYunshen"]'
23+
outputs:
24+
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
25+
steps:
26+
- name: Cleanup
27+
run: |
28+
rm -rf * .[^.]*
29+
30+
- id: check-bypass
31+
name: Check Bypass
32+
uses: PFCCLab/ci-bypass@v1
33+
with:
34+
github-token: ${{ secrets.github-token }}
35+
non-pull-request-event-strategy: 'never-skipped'
36+
type: 'composite'
37+
composite-rule: |
38+
{
39+
"any": [
40+
{
41+
"type": "labeled",
42+
"label": ["skip-ci: ${{ inputs.workflow-name }}", "skip-ci: all"],
43+
"username": ${{ env.CI_TEAM_MEMBERS }}
44+
},
45+
{
46+
"type": "commented",
47+
"comment-pattern": [".*/skip-ci ${{ inputs.workflow-name }}.*", ".*/skip-ci all.*"],
48+
"username": ${{ env.CI_TEAM_MEMBERS }}
49+
}
50+
]
51+
}

.github/workflows/pr_build_and_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
4444
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
4545
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelData"
46+
secrets:
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
4648

4749
logprob_test:
4850
name: Run FastDeploy LogProb Tests

benchmarks/yaml/request_yaml/x1.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
top_p: 0.95
2+
temperature: 0.6
3+
metadata:
4+
min_tokens: 1
5+
max_tokens: 65535
6+
repetition_penalty: 1.0
7+
frequency_penalty: 0
8+
presence_penalty: 0

0 commit comments

Comments
 (0)