Skip to content

Commit 971f81e

Browse files
committed
resolve conficts
2 parents 4e82af8 + 51f68ae commit 971f81e

File tree

253 files changed

+9672
-1213
lines changed

Some content is hidden

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

253 files changed

+9672
-1213
lines changed

.github/workflows/_accuracy_test.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Accuracy Test
2+
description: "Run Accuracy Tests"
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+
FASTDEPLOY_WHEEL_URL:
17+
description: "URL of the FastDeploy Wheel."
18+
required: true
19+
type: string
20+
CACHE_DIR:
21+
description: "Cache Dir Use"
22+
required: false
23+
type: string
24+
default: ""
25+
MODEL_CACHE_DIR:
26+
description: "Cache Dir Use"
27+
required: false
28+
type: string
29+
default: ""
30+
31+
jobs:
32+
accuracy_tests:
33+
runs-on: [self-hosted, GPU-h20-1Cards]
34+
timeout-minutes: 60
35+
steps:
36+
- name: Code Prepare
37+
shell: bash
38+
env:
39+
docker_image: ${{ inputs.DOCKER_IMAGE }}
40+
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
41+
run: |
42+
set -x
43+
REPO="https://github.com/${{ github.repository }}.git"
44+
FULL_REPO="${{ github.repository }}"
45+
REPO_NAME="${FULL_REPO##*/}"
46+
BASE_BRANCH="${{ github.base_ref }}"
47+
48+
# Clean the repository directory before starting
49+
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
50+
-e "REPO_NAME=${REPO_NAME}" \
51+
${docker_image} /bin/bash -c '
52+
if [ -d ${REPO_NAME} ]; then
53+
echo "Directory ${REPO_NAME} exists, removing it..."
54+
rm -rf ${REPO_NAME}*
55+
fi
56+
'
57+
58+
wget -q ${fd_archive_url}
59+
tar -xf FastDeploy.tar.gz
60+
rm -rf FastDeploy.tar.gz
61+
cd FastDeploy
62+
git config --global user.name "FastDeployCI"
63+
git config --global user.email "[email protected]"
64+
git log -n 3 --oneline
65+
66+
- name: Run FastDeploy Base Tests
67+
shell: bash
68+
env:
69+
docker_image: ${{ inputs.DOCKER_IMAGE }}
70+
fastdeploy_wheel_url: ${{ inputs.FASTDEPLOY_WHEEL_URL }}
71+
CACHE_DIR: ${{ inputs.CACHE_DIR }}
72+
MODEL_CACHE_DIR: ${{ inputs.MODEL_CACHE_DIR }}
73+
run: |
74+
runner_name="${{ runner.name }}"
75+
CARD_ID=$(echo "${runner_name}" | awk -F'-' '{print $NF}')
76+
DEVICES=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
77+
DEVICE_PORT=$(echo "$DEVICES" | cut -d',' -f1)
78+
79+
FLASK_PORT=$((42068 + DEVICE_PORT * 100))
80+
FD_API_PORT=$((42088 + DEVICE_PORT * 100))
81+
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICE_PORT * 100))
82+
FD_METRICS_PORT=$((42078 + DEVICE_PORT * 100))
83+
echo "Test ENV Parameter:"
84+
echo "========================================================="
85+
echo "FLASK_PORT=${FLASK_PORT}"
86+
echo "FD_API_PORT=${FD_API_PORT}"
87+
echo "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}"
88+
echo "FD_METRICS_PORT=${FD_METRICS_PORT}"
89+
echo "DEVICES=${DEVICES}"
90+
echo "========================================================="
91+
92+
CACHE_DIR="${CACHE_DIR:-$(dirname "$(dirname "${{ github.workspace }}")")}"
93+
echo "CACHE_DIR is set to ${CACHE_DIR}"
94+
if [ ! -f "${CACHE_DIR}/gitconfig" ]; then
95+
touch "${CACHE_DIR}/gitconfig"
96+
fi
97+
if [ ! -d "${MODEL_CACHE_DIR}" ]; then
98+
echo "Error: MODEL_CACHE_DIR '${MODEL_CACHE_DIR}' does not exist."
99+
exit 1
100+
fi
101+
102+
PORTS=($FLASK_PORT $FD_API_PORT $FD_ENGINE_QUEUE_PORT $FD_METRICS_PORT)
103+
LOG_FILE="./port_cleanup_$(date +%Y%m%d_%H%M%S).log"
104+
echo "==== LOG_FILE is ${LOG_FILE} ===="
105+
106+
echo "==== PORT CLEAN BEFORE TASK RUN ====" | tee -a $LOG_FILE
107+
108+
for port in "${PORTS[@]}"; do
109+
PIDS=$(lsof -t -i :$port || true)
110+
if [ -n "$PIDS" ]; then
111+
echo "Port $port is occupied by PID(s): $PIDS" | tee -a $LOG_FILE
112+
echo "$PIDS" | xargs -r kill -9
113+
echo "Port $port cleared" | tee -a $LOG_FILE
114+
else
115+
echo "Port $port is free" | tee -a $LOG_FILE
116+
fi
117+
done
118+
119+
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
120+
121+
docker run --rm --ipc=host --pid=host --net=host \
122+
-v $(pwd):/workspace \
123+
-w /workspace \
124+
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
125+
-e "FD_API_PORT=${FD_API_PORT}" \
126+
-e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \
127+
-e "FD_METRICS_PORT=${FD_METRICS_PORT}" \
128+
-e "FLASK_PORT=${FLASK_PORT}" \
129+
-v "${MODEL_CACHE_DIR}:/MODELDATA" \
130+
-v "${CACHE_DIR}/gitconfig:/etc/gitconfig:ro" \
131+
-v "${CACHE_DIR}/.cache:/root/.cache" \
132+
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
133+
-e TZ="Asia/Shanghai" \
134+
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
135+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
136+
137+
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
138+
139+
python -m pip install ${fastdeploy_wheel_url}
140+
python -m pip install pytest
141+
142+
wget https://paddle-qa.bj.bcebos.com/zhengtianyu/tools/llm-deploy-linux-amd64
143+
chmod +x ./llm-deploy-linux-amd64
144+
./llm-deploy-linux-amd64 -python python3.10 \
145+
-model_name ERNIE-4.5-0.3B-Paddle \
146+
-model_path /MODELDATA \
147+
--skip install
148+
149+
git config --global --add safe.directory /workspace/FastDeploy
150+
cd FastDeploy
151+
pushd tests/ce/deploy
152+
python3.10 deploy.py > dd.log 2>&1 &
153+
sleep 3
154+
curl -X POST http://0.0.0.0:${FLASK_PORT}/start \
155+
-H "Content-Type: application/json" \
156+
-d "{\"--model\": \"/MODELDATA/ERNIE-4.5-0.3B-Paddle\"}"
157+
158+
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
159+
popd
160+
161+
pushd tests/ce/accuracy_cases
162+
export URL=http://localhost:${FD_API_PORT}/v1/chat/completions
163+
export TEMPLATE=TOKEN_LOGPROB
164+
export MODEL_SIZE=0.3B
165+
TEST_EXIT_CODE=0
166+
python gsm8k.py || TEST_EXIT_CODE=1
167+
popd
168+
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> /workspace/FastDeploy/exit_code.env
169+
'
170+
if [ -f ./FastDeploy/exit_code.env ]; then
171+
source ./FastDeploy/exit_code.env
172+
cat ./FastDeploy/exit_code.env >> $GITHUB_ENV
173+
fi
174+
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}"
175+
exit ${TEST_EXIT_CODE}

.github/workflows/_base_test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
jobs:
3232
base_tests:
3333
runs-on: [self-hosted, GPU-h20-1Cards]
34+
timeout-minutes: 60
3435
steps:
3536
- name: Code Prepare
3637
shell: bash
@@ -131,7 +132,7 @@ jobs:
131132
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
132133
-e TZ="Asia/Shanghai" \
133134
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
134-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
135+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
135136
136137
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
137138
@@ -147,7 +148,7 @@ jobs:
147148
148149
git config --global --add safe.directory /workspace/FastDeploy
149150
cd FastDeploy
150-
pushd test/ce/deploy
151+
pushd tests/ce/deploy
151152
python3.10 deploy.py > dd.log 2>&1 &
152153
sleep 3
153154
curl -X POST http://0.0.0.0:${FLASK_PORT}/start \
@@ -157,7 +158,7 @@ jobs:
157158
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
158159
popd
159160
160-
pushd test/ce/server
161+
pushd tests/ce/server
161162
export URL=http://localhost:${FD_API_PORT}/v1/chat/completions
162163
export TEMPLATE=TOKEN_LOGPROB
163164
TEST_EXIT_CODE=0

.github/workflows/_build_linux.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@ on:
2222
description: "Enable nightly build mode (e.g. add date suffix to version)"
2323
required: false
2424
type: string
25-
default: "ON"
25+
default: "OFF"
2626
FD_VERSION:
2727
description: "FastDeploy Package Version"
2828
required: false
2929
type: string
3030
default: ""
31+
PADDLEVERSION:
32+
description: "Paddle Version Build Use"
33+
required: false
34+
type: string
35+
default: ""
36+
PADDLE_WHL_URL:
37+
description: "Paddle Wheel Package URL"
38+
required: false
39+
type: string
40+
default: ""
3141
UPLOAD:
3242
description: "Upload Package"
3343
required: false
@@ -45,6 +55,7 @@ on:
4555
jobs:
4656
fd-build:
4757
runs-on: [self-hosted, GPU-Build]
58+
timeout-minutes: 240
4859
outputs:
4960
wheel_path: ${{ steps.set_output.outputs.wheel_path }}
5061
steps:
@@ -85,6 +96,10 @@ jobs:
8596
compile_arch: ${{ inputs.COMPILE_ARCH }}
8697
fd_version: ${{ inputs.FD_VERSION }}
8798
CACHE_DIR: ${{ inputs.CACHE_DIR }}
99+
BRANCH_REF: ${{ github.ref_name }}
100+
PADDLEVERSION: ${{ inputs.PADDLEVERSION }}
101+
PADDLE_WHL_URL: ${{ inputs.PADDLE_WHL_URL }}
102+
WITH_NIGHTLY_BUILD: ${{ inputs.WITH_NIGHTLY_BUILD }}
88103
run: |
89104
set -x
90105
runner_name="${{ runner.name }}"
@@ -109,6 +124,9 @@ jobs:
109124
-e "COMPILE_ARCH=${compile_arch}" \
110125
-e "FD_VERSION=${fd_version}" \
111126
-e "WITH_NIGHTLY_BUILD=${WITH_NIGHTLY_BUILD}" \
127+
-e "PADDLEVERSION=${PADDLEVERSION}" \
128+
-e "PADDLE_WHL_URL=${PADDLE_WHL_URL}" \
129+
-e "BRANCH_REF=${BRANCH_REF}" \
112130
--gpus "\"device=${gpu_id}\"" ${docker_image} /bin/bash -c '
113131
if [[ -n "${FD_VERSION}" ]]; then
114132
export FASTDEPLOY_VERSION=${FD_VERSION}
@@ -124,7 +142,15 @@ jobs:
124142
echo "Date Only: $DATE_ONLY"
125143
export FASTDEPLOY_VERSION="${FASTDEPLOY_VERSION}.dev${DATE_ONLY}"
126144
fi
127-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
145+
# 针对不同分支和tag使用不同的PaddlePaddle安装包
146+
if [[ "${PADDLE_WHL_URL}" != "" ]];then
147+
python -m pip install ${PADDLE_WHL_URL}
148+
elif [[ "${PADDLEVERSION}" != "" ]];then
149+
python -m pip install paddlepaddle-gpu==${PADDLEVERSION} -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
150+
else
151+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
152+
fi
153+
128154
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
129155
130156
python -m pip install --upgrade pip

.github/workflows/_logprob_test_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
123123
-e TZ="Asia/Shanghai" \
124124
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
125-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
125+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
126126
127127
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
128128

.github/workflows/_pre_ce_test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@ on:
2727
type: string
2828
default: ""
2929

30-
concurrency:
31-
group: ${{ github.event.pull_request.number }}
32-
cancel-in-progress: true
33-
3430
jobs:
3531
run_ce_cases:
3632
runs-on: [self-hosted, PRE_CE_RUN_2Card]
33+
timeout-minutes: 60
3734
steps:
3835
- name: Print current runner name
3936
run: |
@@ -132,7 +129,7 @@ jobs:
132129
--gpus "\"device=${DEVICES}\"" ${docker_image} /bin/bash -c '
133130
git config --global --add safe.directory /workspace/FastDeploy
134131
cd FastDeploy
135-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
132+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250818 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
136133
python -m pip install ${fd_wheel_url}
137134
bash scripts/run_pre_ce.sh
138135
'

0 commit comments

Comments
 (0)