Skip to content

Commit bab0951

Browse files
committed
fix conflict
2 parents d80428f + 9571c45 commit bab0951

File tree

245 files changed

+14047
-5010
lines changed

Some content is hidden

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

245 files changed

+14047
-5010
lines changed

.github/workflows/_base_test.yml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: Base Test
2+
description: "Run Base 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+
base_tests:
33+
runs-on: [self-hosted, GPU-h20-1Cards]
34+
steps:
35+
- name: Code Prepare
36+
shell: bash
37+
env:
38+
docker_image: ${{ inputs.DOCKER_IMAGE }}
39+
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
40+
run: |
41+
set -x
42+
REPO="https://github.com/${{ github.repository }}.git"
43+
FULL_REPO="${{ github.repository }}"
44+
REPO_NAME="${FULL_REPO##*/}"
45+
BASE_BRANCH="${{ github.base_ref }}"
46+
47+
# Clean the repository directory before starting
48+
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
49+
-e "REPO_NAME=${REPO_NAME}" \
50+
${docker_image} /bin/bash -c '
51+
if [ -d ${REPO_NAME} ]; then
52+
echo "Directory ${REPO_NAME} exists, removing it..."
53+
rm -rf ${REPO_NAME}*
54+
fi
55+
'
56+
57+
wget -q ${fd_archive_url}
58+
tar -xf FastDeploy.tar.gz
59+
rm -rf FastDeploy.tar.gz
60+
cd FastDeploy
61+
git config --global user.name "FastDeployCI"
62+
git config --global user.email "fastdeploy_ci@example.com"
63+
git log -n 3 --oneline
64+
65+
- name: Run FastDeploy Base Tests
66+
shell: bash
67+
env:
68+
docker_image: ${{ inputs.DOCKER_IMAGE }}
69+
fastdeploy_wheel_url: ${{ inputs.FASTDEPLOY_WHEEL_URL }}
70+
CACHE_DIR: ${{ inputs.CACHE_DIR }}
71+
MODEL_CACHE_DIR: ${{ inputs.MODEL_CACHE_DIR }}
72+
run: |
73+
runner_name="${{ runner.name }}"
74+
last_char="${runner_name: -1}"
75+
76+
if [[ "$last_char" =~ [0-7] ]]; then
77+
DEVICES="$last_char"
78+
else
79+
DEVICES="0"
80+
fi
81+
82+
FLASK_PORT=$((42068 + DEVICES * 100))
83+
FD_API_PORT=$((42088 + DEVICES * 100))
84+
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICES * 100))
85+
FD_METRICS_PORT=$((42078 + DEVICES * 100))
86+
echo "Test ENV Parameter:"
87+
echo "========================================================="
88+
echo "FLASK_PORT=${FLASK_PORT}"
89+
echo "FD_API_PORT=${FD_API_PORT}"
90+
echo "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}"
91+
echo "FD_METRICS_PORT=${FD_METRICS_PORT}"
92+
echo "DEVICES=${DEVICES}"
93+
echo "========================================================="
94+
95+
CACHE_DIR="${CACHE_DIR:-$(dirname "$(dirname "${{ github.workspace }}")")}"
96+
echo "CACHE_DIR is set to ${CACHE_DIR}"
97+
if [ ! -f "${CACHE_DIR}/gitconfig" ]; then
98+
touch "${CACHE_DIR}/gitconfig"
99+
fi
100+
if [ ! -d "${MODEL_CACHE_DIR}" ]; then
101+
echo "Error: MODEL_CACHE_DIR '${MODEL_CACHE_DIR}' does not exist."
102+
exit 1
103+
fi
104+
105+
PARENT_DIR=$(dirname "$WORKSPACE")
106+
107+
docker run --rm --ipc=host --pid=host --net=host \
108+
-v $(pwd):/workspace \
109+
-w /workspace \
110+
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
111+
-e "FD_API_PORT=${FD_API_PORT}" \
112+
-e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \
113+
-e "FD_METRICS_PORT=${FD_METRICS_PORT}" \
114+
-e "FLASK_PORT=${FLASK_PORT}" \
115+
-v "${MODEL_CACHE_DIR}:/MODELDATA" \
116+
-v "${CACHE_DIR}/gitconfig:/etc/gitconfig:ro" \
117+
-v "${CACHE_DIR}/.cache:/root/.cache" \
118+
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
119+
-e TZ="Asia/Shanghai" \
120+
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
121+
# python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
122+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250729 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
123+
124+
pip config set global.index-url http://pip.baidu.com/root/baidu/+simple/
125+
pip config set install.trusted-host pip.baidu.com
126+
pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
127+
python -m pip install ${fastdeploy_wheel_url}
128+
python -m pip install pytest
129+
130+
wget https://paddle-qa.bj.bcebos.com/zhengtianyu/tools/llm-deploy-linux-amd64
131+
chmod +x ./llm-deploy-linux-amd64
132+
./llm-deploy-linux-amd64 -python python3.10 \
133+
-model_name ERNIE-4.5-0.3B-Paddle \
134+
-model_path /MODELDATA \
135+
--skip install
136+
137+
git config --global --add safe.directory /workspace/FastDeploy
138+
cd FastDeploy
139+
pushd test/ce/deploy
140+
python3.10 deploy.py > dd.log 2>&1 &
141+
sleep 3
142+
curl -X POST http://0.0.0.0:${FLASK_PORT}/start \
143+
-H "Content-Type: application/json" \
144+
-d "{\"--model\": \"/MODELDATA/ERNIE-4.5-0.3B-Paddle\"}"
145+
146+
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
147+
popd
148+
149+
pushd test/ce/server
150+
export URL=http://localhost:${FD_API_PORT}/v1/chat/completions
151+
export TEMPLATE=TOKEN_LOGPROB
152+
TEST_EXIT_CODE=0
153+
python -m pytest -sv test_base_chat.py test_compare_top_logprobs.py test_logprobs.py test_params_boundary.py test_seed_usage.py test_stream.py || TEST_EXIT_CODE=1
154+
curl -X POST http://0.0.0.0:${FLASK_PORT}/switch \
155+
-H "Content-Type: application/json" \
156+
-d "{\"--model\": \"/MODELDATA/ERNIE-4.5-0.3B-Paddle\", \"--early-stop-config\": \"{\\\"enable_early_stop\\\":true, \\\"window_size\\\":6, \\\"threshold\\\":0.93}\"}"
157+
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
158+
python -m pytest -sv test_repetition_early_stop.py || TEST_EXIT_CODE=1
159+
popd
160+
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> /workspace/FastDeploy/exit_code.env
161+
'
162+
if [ -f ./FastDeploy/exit_code.env ]; then
163+
source ./FastDeploy/exit_code.env
164+
cat ./FastDeploy/exit_code.env >> $GITHUB_ENV
165+
fi
166+
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}"
167+
exit ${TEST_EXIT_CODE}

.github/workflows/_build_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ jobs:
124124
echo "Date Only: $DATE_ONLY"
125125
export FASTDEPLOY_VERSION="${FASTDEPLOY_VERSION}.dev${DATE_ONLY}"
126126
fi
127+
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
127128
pip config set global.index-url http://pip.baidu.com/root/baidu/+simple/
128129
pip config set install.trusted-host pip.baidu.com
129130
pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
130131
131132
python -m pip install --upgrade pip
132133
python -m pip install -r requirements.txt
133134
python -m pip install wheel
134-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
135135
# 编译RDMA
136136
export ENABLE_FD_RDMA=1
137137
bash build.sh 1 python false [${COMPILE_ARCH}]

.github/workflows/_clone_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
branch_name=${{ github.ref_name }}
6969
target_path=paddle-github-action/BRANCH/FastDeploy/${branch_name}/${commit_id}
7070
fi
71-
wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py
71+
wget -O bos_tools.py -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py
7272
push_file=$(realpath bos_tools.py)
7373
python -m pip install bce-python-sdk==0.9.29
7474
ls

.github/workflows/_logprob_test_linux.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,18 @@ jobs:
7070
DEVICES="0"
7171
fi
7272
73-
FLASK_PORT=$((9160 + DEVICES * 100))
74-
FD_API_PORT=$((9180 + DEVICES * 100))
75-
FD_ENGINE_QUEUE_PORT=$((9150 + DEVICES * 100))
76-
FD_METRICS_PORT=$((9170 + DEVICES * 100))
73+
FLASK_PORT=$((42068 + DEVICES * 100))
74+
FD_API_PORT=$((42088 + DEVICES * 100))
75+
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICES * 100))
76+
FD_METRICS_PORT=$((42078 + DEVICES * 100))
77+
echo "Test ENV Parameter:"
78+
echo "========================================================="
79+
echo "FLASK_PORT=${FLASK_PORT}"
80+
echo "FD_API_PORT=${FD_API_PORT}"
81+
echo "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}"
82+
echo "FD_METRICS_PORT=${FD_METRICS_PORT}"
83+
echo "DEVICES=${DEVICES}"
84+
echo "========================================================="
7785
7886
CACHE_DIR="${CACHE_DIR:-$(dirname "$(dirname "${{ github.workspace }}")")}"
7987
echo "CACHE_DIR is set to ${CACHE_DIR}"
@@ -86,8 +94,10 @@ jobs:
8694
fi
8795
8896
PARENT_DIR=$(dirname "$WORKSPACE")
97+
unset http_proxy
98+
unset https_proxy
8999
90-
docker run --ipc=host --pid=host --net=host \
100+
docker run --rm --ipc=host --pid=host --net=host \
91101
-v $(pwd):/workspace \
92102
-w /workspace \
93103
-e fastdeploy_wheel_url=${fastdeploy_wheel_url} \
@@ -100,7 +110,7 @@ jobs:
100110
-v "${CACHE_DIR}/.cache:/root/.cache" \
101111
-v "${CACHE_DIR}/ConfigDir:/root/.config" \
102112
-e TZ="Asia/Shanghai" \
103-
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -c '
113+
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -xc '
104114
# python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
105115
python -m pip install paddlepaddle-gpu==3.0.0.dev20250729 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
106116
@@ -124,6 +134,10 @@ jobs:
124134
-d "{\"--model\": \"/MODELDATA/ERNIE-4.5-0.3B-Paddle\"}"
125135
126136
curl -X POST http://localhost:${FLASK_PORT}/wait_for_infer?timeout=90
137+
curl -s -o /dev/null -w "%{http_code}" -m 2 "http://0.0.0.0:${FD_API_PORT}/health"
138+
curl -X POST "http://0.0.0.0:${FD_API_PORT}/v1/chat/completions" \
139+
-H "Content-Type: application/json" \
140+
-d "{\"messages\": [{\"role\": \"user\", \"content\": \"1+1=?\"}], \"logprobs\": true}"
127141
set +e
128142
rm -rf ./baseline_output
129143
cp -r baseline/ERNIE-4.5-0.3B-Paddle ./baseline_output

.github/workflows/_pre_ce_test.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Pre-CE-Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
DOCKER_IMAGE:
7+
description: "Build Images"
8+
required: true
9+
type: string
10+
default: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:fastdeploy-ciuse-cuda126"
11+
FASTDEPLOY_ARCHIVE_URL:
12+
description: "URL of the compressed FastDeploy code archive."
13+
required: true
14+
type: string
15+
FASTDEPLOY_WHEEL_URL:
16+
description: "URL of the FastDeploy Wheel."
17+
required: true
18+
type: string
19+
CACHE_DIR:
20+
description: "Cache Dir Use"
21+
required: false
22+
type: string
23+
default: ""
24+
25+
concurrency:
26+
group: ${{ github.event.pull_request.number }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
run_ce_cases:
31+
runs-on: [self-hosted, GPU-L20-4Card]
32+
steps:
33+
- name: Print current runner name
34+
run: |
35+
echo "Current runner name: ${{ runner.name }}"
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 "fastdeploy_ci@example.com"
64+
git log -n 3 --oneline
65+
66+
- name: Run CI unittest
67+
env:
68+
docker_image: ${{ inputs.DOCKER_IMAGE }}
69+
fd_wheel_url: ${{ inputs.FASTDEPLOY_WHEEL_URL }}
70+
run: |
71+
runner_name="${{ runner.name }}"
72+
last_char="${runner_name: -1}"
73+
74+
if [ "${last_char}" = "1" ]; then
75+
gpu_id=2
76+
DEVICES="2,3"
77+
else
78+
gpu_id=0
79+
DEVICES="0,1"
80+
fi
81+
FD_API_PORT=$((9180 + gpu_id * 100))
82+
FD_ENGINE_QUEUE_PORT=$((9150 + gpu_id * 100))
83+
FD_METRICS_PORT=$((9170 + gpu_id * 100))
84+
85+
PARENT_DIR=$(dirname "$WORKSPACE")
86+
echo "PARENT_DIR:$PARENT_DIR"
87+
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
88+
-v "/ssd4/GithubActions/gitconfig:/etc/gitconfig:ro" \
89+
-v "/ssd4/GithubActions/ModelData:/ModelData:ro" \
90+
-v "/ssd4/GithubActions/CacheDir:/root/.cache" \
91+
-v "/ssd4/GithubActions/ConfigDir:/root/.config" \
92+
-e "MODEL_PATH=/ModelData" \
93+
-e "FD_API_PORT=${FD_API_PORT}" \
94+
-e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \
95+
-e "FD_METRICS_PORT=${FD_METRICS_PORT}" \
96+
-e "fd_wheel_url=${fd_wheel_url}" \
97+
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -c '
98+
git config --global --add safe.directory /workspace/FastDeploy
99+
cd FastDeploy
100+
# python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
101+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250729 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
102+
python -m pip install ${fd_wheel_url}
103+
bash scripts/run_pre_ce.sh
104+
'

0 commit comments

Comments
 (0)