Skip to content

Commit b948a52

Browse files
committed
fix llmrecliet
2 parents 4dd340d + f5c1066 commit b948a52

File tree

119 files changed

+5248
-2197
lines changed

Some content is hidden

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

119 files changed

+5248
-2197
lines changed

.github/workflows/_build_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
python -m pip install -r requirements.txt
165165
python -m pip install wheel
166166
# 编译RDMA
167-
export ENABLE_FD_RDMA=1
167+
export FD_ENABLE_RDMA_COMPILE=1
168168
bash build.sh 1 python false [${COMPILE_ARCH}]
169169
ls ./dist/*.whl
170170
'

.github/workflows/_unit_test_coverage.yml

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ jobs:
4343
runs-on: [self-hosted, GPU-h1z1-2Cards]
4444
timeout-minutes: 90
4545
needs: check_cov_skip
46+
if: needs.check_cov_skip.outputs.can-skip != 'true'
4647
outputs:
47-
diff_cov_file_url: ${{ steps.cov_upload.outputs.diff_cov_file_url }}
48+
all_cov_file_url: ${{ steps.cov_upload.outputs.all_cov_file_url }}
4849
unittest_failed_url: ${{ steps.cov_upload.outputs.unittest_failed_url }}
4950
diff_cov_result_json_url: ${{ steps.cov_upload.outputs.diff_cov_result_json_url }}
5051
steps:
@@ -201,7 +202,7 @@ jobs:
201202
if [[ "$IS_PR" == "true" ]]; then
202203
echo "Running diff coverage for PR..."
203204
diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=80 --json-report diff_coverage.json || COVERAGE_EXIT_CODE=9
204-
python scripts/generate_diff_coverage_xml.py diff.txt python_coverage_all.xml
205+
# python scripts/generate_diff_coverage_xml.py diff.txt python_coverage_all.xml
205206
else
206207
echo "Running full coverage"
207208
coverage report -m > full_coverage_report.txt
@@ -249,15 +250,15 @@ jobs:
249250
250251
target_path_stripped="${target_path#paddle-github-action/}"
251252
252-
if [[ "$IS_PR" == "true" ]]; then
253-
diff_cov_file="diff_coverage.xml"
254-
if [ -f ${diff_cov_file} ]; then
255-
python ${push_file} ${diff_cov_file} ${target_path}/CoverageData
256-
DIFF_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${diff_cov_file}
257-
echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_OUTPUT
258-
echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_ENV
259-
fi
253+
all_coverage_file="python_coverage_all.xml"
254+
if [ -f ${all_coverage_file} ]; then
255+
python ${push_file} ${all_coverage_file} ${target_path}/CoverageData
256+
ALL_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${all_coverage_file}
257+
echo "all_cov_file_url=${ALL_COV_FILE_URL}" >> $GITHUB_OUTPUT
258+
echo "all_cov_file_url=${ALL_COV_FILE_URL}" >> $GITHUB_ENV
259+
fi
260260
261+
if [[ "$IS_PR" == "true" ]]; then
261262
diff_cov_result_json="diff_coverage.json"
262263
if [ -f ${diff_cov_result_json} ]; then
263264
python ${push_file} ${diff_cov_result_json} ${target_path}/CoverageData
@@ -319,7 +320,7 @@ jobs:
319320
echo "All tests passed"
320321
321322
- name: Verify Code Coverage Threshold (80%)
322-
if: ${{ github.event_name == 'pull_request' && (needs.check_cov_skip.outputs['can-skip'] != 'true') }}
323+
if: ${{ github.event_name == 'pull_request' }}
323324
shell: bash
324325
run: |
325326
cd FastDeploy
@@ -351,28 +352,33 @@ jobs:
351352
runs-on: ubuntu-latest
352353
timeout-minutes: 15
353354
env:
354-
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
355+
all_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.all_cov_file_url }}
355356
steps:
356-
- name: coverage diff file download
357+
- name: Clone FastDeploy
358+
uses: actions/checkout@v4
359+
with:
360+
fetch-depth: 0
361+
- uses: actions/setup-python@v5
362+
with:
363+
python-version: '3.10'
364+
- name: Download diff coverage file
357365
shell: bash
358-
env:
359-
diff_cov_file_url: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url }}
360366
run: |
361-
wget -q --no-proxy ${fd_archive_url}
362-
tar -xf FastDeploy.tar.gz
363-
cd FastDeploy
364-
if [ -z "${diff_cov_file_url}" ]; then
365-
echo "No diff coverage file URL provided."
367+
echo "Downloading all coverage file..."
368+
if ! wget --no-proxy "${all_cov_file_url}" -O python_coverage_all.xml; then
369+
echo "Download failed, skipping upload."
366370
exit 0
367371
fi
368-
wget "${diff_cov_file_url}" -O ./diff_coverage.xml || echo "Download cov file failed, but continuing..."
372+
373+
sed -i 's|<source>/workspace/FastDeploy/fastdeploy</source>|<source>fastdeploy</source>|' python_coverage_all.xml
374+
369375
- name: Upload diff coverage report
370-
if: ${{ needs.run_tests_with_coverage.outputs.diff_cov_file_url != null && needs.run_tests_with_coverage.outputs.diff_cov_file_url != '' }}
371-
uses: codecov/codecov-action@v5
376+
if: always() && hashFiles('python_coverage_all.xml') != ''
377+
uses: codecov/codecov-action@v4
372378
with:
373-
files: ./FastDeploy/diff_coverage.xml
379+
files: ./python_coverage_all.xml
380+
flags: GPU
374381
name: python diff coverage
382+
fail_ci_if_error: false
375383
verbose: true
376384
disable_search: true
377-
commit_parent: false
378-
flags: diff
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Remove Skip-CI Labels
2+
3+
on:
4+
pull_request_target:
5+
types: [synchronize]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
remove-skip-ci-labels:
12+
name: Remove skip-ci labels on new commits
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Get PR labels
16+
id: get-labels
17+
uses: actions/github-script@v7
18+
with:
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
script: |
21+
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
issue_number: context.issue.number
25+
});
26+
27+
const skipCiLabels = labels
28+
.filter(label => label.name.startsWith('skip-ci:'))
29+
.map(label => label.name);
30+
31+
console.log('Found skip-ci labels:', skipCiLabels);
32+
core.setOutput('skip-ci-labels', JSON.stringify(skipCiLabels));
33+
core.setOutput('has-skip-ci-labels', skipCiLabels.length > 0 ? 'true' : 'false');
34+
35+
- name: Remove skip-ci labels
36+
if: steps.get-labels.outputs.has-skip-ci-labels == 'true'
37+
uses: actions/github-script@v7
38+
with:
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
script: |
41+
const skipCiLabels = JSON.parse('${{ steps.get-labels.outputs.skip-ci-labels }}');
42+
43+
for (const label of skipCiLabels) {
44+
console.log(`Removing label: ${label}`);
45+
await github.rest.issues.removeLabel({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
issue_number: context.issue.number,
49+
name: label
50+
});
51+
}
52+
53+
console.log(`Successfully removed ${skipCiLabels.length} skip-ci label(s)`);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
max_model_len: 131072
2+
tensor_parallel_size: 1
3+
quantization: wint8
4+
max_num_seqs: 32
5+
reasoning_parser: ernie-45-vl-thinking
6+
tool_call_parser: ernie-45-vl-thinking
7+
load_choices: "default_v1"
8+
mm-processor-kwargs: '{"image_max_pixels": 12845056 }'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
max_model_len: 32768
2+
tensor_parallel_size: 1
3+
quantization: wint8
4+
max_num_seqs: 32
5+
reasoning_parser: ernie-45-vl-thinking
6+
tool_call_parser: ernie-45-vl-thinking
7+
load_choices: "default_v1"
8+
mm-processor-kwargs: '{"image_max_pixels": 12845056 }'

build.sh

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,79 +77,81 @@ function copy_ops(){
7777
PY_VERSION="py${PY_MAIN_VERSION}.${PY_SUB_VERSION}"
7878
SYSTEM_VERSION=`${python} -c "import platform; print(platform.system().lower())"`
7979
PROCESSOR_VERSION=`${python} -c "import platform; print(platform.processor())"`
80-
WHEEL_NAME="fastdeploy_ops-${OPS_VERSION}-${PY_VERSION}-${SYSTEM_VERSION}-${PROCESSOR_VERSION}.egg"
81-
WHEEL_CPU_NAME="fastdeploy_cpu_ops-${OPS_VERSION}-${PY_VERSION}-${SYSTEM_VERSION}-${PROCESSOR_VERSION}.egg"
80+
EGG_NAME="fastdeploy_ops-${OPS_VERSION}-${PY_VERSION}-${SYSTEM_VERSION}-${PROCESSOR_VERSION}.egg"
81+
EGG_CPU_NAME="fastdeploy_cpu_ops-${OPS_VERSION}-${PY_VERSION}-${SYSTEM_VERSION}-${PROCESSOR_VERSION}.egg"
8282

8383
# Add compatibility for modern python packaging methods
84-
WHEEL_MODERN_NAME="fastdeploy_ops"
85-
WHEEL_MODERN_CPU_NAME="fastdeploy_cpu_ops"
84+
LEGACY_PACKAGE_DIR="${OPS_TMP_DIR}/${EGG_NAME}"
85+
MODERN_PACKAGE_DIR="${OPS_TMP_DIR}/fastdeploy_ops"
86+
LEGACY_PACKAGE_DIR_CPU="${OPS_TMP_DIR}/${EGG_CPU_NAME}"
87+
MODERN_PACKAGE_DIR_CPU="${OPS_TMP_DIR}/fastdeploy_cpu_ops"
8688

87-
# Handle GPU ops directories (WHEEL_MODERN_NAME and WHEEL_NAME)
88-
if [ -d "./${OPS_TMP_DIR}/${WHEEL_MODERN_NAME}" ]; then
89+
# Handle GPU ops directory compatibility between modern and legacy naming
90+
if [ -d "${MODERN_PACKAGE_DIR}" ]; then
8991
echo -e "${GREEN}[Info]${NONE} Ready to copy ops from modern directory ${WHEEL_MODERN_NAME} to target directory"
90-
# Set WHEEL_NAME to empty string to ignore the directory path
91-
WHEEL_NAME=""
92+
TMP_PACKAGE_DIR="${OPS_TMP_DIR}"
93+
# If modern directory doesn't exist, check for legacy directory, this branch should be removed in the future
94+
elif [ -d "${LEGACY_PACKAGE_DIR}" ]; then
95+
echo -e "${YELLOW}[Warning]${NONE} ${EGG_NAME} directory exists. This is a legacy packaging and distribution method."
96+
TMP_PACKAGE_DIR="${LEGACY_PACKAGE_DIR}"
9297
else
93-
# If modern directory doesn't exist, check for deprecated directory
94-
if [ -d "./${OPS_TMP_DIR}/${WHEEL_NAME}" ]; then
95-
echo -e "${YELLOW}[Warning]${NONE} ${WHEEL_NAME} directory exists. This is a deprecated packaging and distribution method."
96-
fi
98+
echo -e "${RED}[Error]${NONE} Neither modern nor legacy directory for gpu ops found in ${OPS_TMP_DIR}"
9799
fi
98100

99-
# Handle CPU ops directories (WHEEL_MODERN_CPU_NAME and WHEEL_CPU_NAME)
100-
if [ -d "./${OPS_TMP_DIR}/${WHEEL_MODERN_CPU_NAME}" ]; then
101+
# Handle CPU ops directory compatibility between modern and legacy naming
102+
if [ -d "${MODERN_PACKAGE_DIR_CPU}" ]; then
101103
echo -e "${GREEN}[Info]${NONE} Ready to copy ops from modern directory ${WHEEL_MODERN_CPU_NAME} to target directory"
102-
# Set WHEEL_CPU_NAME to empty string to ignore the directory path
103-
WHEEL_CPU_NAME=""
104+
TMP_PACKAGE_DIR_BASE="${OPS_TMP_DIR}"
105+
# If modern directory doesn't exist, check for legacy directory, this branch should be removed in the future
106+
elif [ -d "${LEGACY_PACKAGE_DIR_CPU}" ]; then
107+
echo -e "${YELLOW}[Warning]${NONE} ${EGG_CPU_NAME} directory exists. This is a legacy packaging and distribution method."
108+
TMP_PACKAGE_DIR_BASE="${LEGACY_PACKAGE_DIR_CPU}"
104109
else
105-
# If modern directory doesn't exist, check for deprecated directory
106-
if [ -d "./${OPS_TMP_DIR}/${WHEEL_CPU_NAME}" ]; then
107-
echo -e "${YELLOW}[Warning]${NONE} ${WHEEL_CPU_NAME} directory exists. This is a deprecated packaging and distribution method."
108-
fi
110+
echo -e "${YELLOW}[Warning]${NONE} Neither modern nor legacy directory for cpu ops found in ${OPS_TMP_DIR}"
109111
fi
110112
is_rocm=`$python -c "import paddle; print(paddle.is_compiled_with_rocm())"`
111113
if [ "$is_rocm" = "True" ]; then
112114
DEVICE_TYPE="rocm"
113-
cp -r ./${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/gpu
115+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/gpu
114116
echo -e "ROCM ops have been copy to fastdeploy"
115117
return
116118
fi
117119
is_cuda=`$python -c "import paddle; print(paddle.is_compiled_with_cuda())"`
118120
if [ "$is_cuda" = "True" ]; then
119121
DEVICE_TYPE="gpu"
120-
cp -r ./${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/gpu
122+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/gpu
121123
echo -e "CUDA ops have been copy to fastdeploy"
122124
return
123125
fi
124126

125127
is_xpu=`$python -c "import paddle; print(paddle.is_compiled_with_xpu())"`
126128
if [ "$is_xpu" = "True" ]; then
127129
DEVICE_TYPE="xpu"
128-
cp -r ./${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/xpu
130+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/xpu
129131
echo -e "xpu ops have been copy to fastdeploy"
130132
return
131133
fi
132134

133135
is_npu=`$python -c "import paddle; print(paddle.is_compiled_with_custom_device('npu'))"`
134136
if [ "$is_npu" = "True" ]; then
135137
DEVICE_TYPE="npu"
136-
cp -r ${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/npu
138+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/npu
137139
echo -e "npu ops have been copy to fastdeploy"
138140
return
139141
fi
140142

141143
if_corex=`$python -c "import paddle; print(paddle.is_compiled_with_custom_device(\"iluvatar_gpu\"))"`
142144
if [ "$if_corex" = "True" ]; then
143145
DEVICE_TYPE="iluvatar-gpu"
144-
cp -r ./${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/iluvatar
146+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/iluvatar
145147
echo -e "Iluvatar ops have been copy to fastdeploy"
146148
return
147149
fi
148150

149151
is_gcu=`$python -c "import paddle; print(paddle.is_compiled_with_custom_device('gcu'))"`
150152
if [ "$is_gcu" = "True" ]; then
151153
DEVICE_TYPE="gcu"
152-
cp -r ${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/gcu
154+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/gcu
153155
echo -e "gcu ops have been copy to fastdeploy"
154156
return
155157
fi
@@ -158,8 +160,8 @@ function copy_ops(){
158160
if [ "$is_maca" = "True" ]; then
159161
DEVICE_TYPE="metax_gpu"
160162
mkdir -p ../fastdeploy/model_executor/ops/base
161-
cp -r ./${OPS_TMP_DIR_BASE}/${WHEEL_BASE_NAME}/* ../fastdeploy/model_executor/ops/base
162-
cp -r ./${OPS_TMP_DIR}/${WHEEL_NAME}/* ../fastdeploy/model_executor/ops/gpu
163+
cp -r ${OPS_TMP_DIR_BASE}/${WHEEL_BASE_NAME}/* ../fastdeploy/model_executor/ops/base
164+
cp -r ${TMP_PACKAGE_DIR}/* ../fastdeploy/model_executor/ops/gpu
163165
echo -e "MACA ops have been copy to fastdeploy"
164166
return
165167
fi
@@ -249,8 +251,14 @@ function extract_ops_from_precompiled_wheel() {
249251
echo -e "${BLUE}[precompiled]${NONE} Copying GPU precompiled contents..."
250252
mkdir -p "$DST_DIR"
251253
cp -r "$SRC_DIR/deep_gemm" "$DST_DIR/" 2>/dev/null || true
252-
cp -r "$SRC_DIR/fastdeploy_ops.py" "$DST_DIR/" 2>/dev/null || true
253-
cp -f "$SRC_DIR/"fastdeploy_ops_*.so "$DST_DIR/" 2>/dev/null || true
254+
# Check for modern Python packaging approach (fastdeploy_ops directory)
255+
# If exists, copy the entire directory; otherwise, fall back to legacy method (individual files)
256+
if [ -d "$SRC_DIR/fastdeploy_ops" ]; then
257+
cp -r "$SRC_DIR/fastdeploy_ops" "$DST_DIR/" 2>/dev/null || true
258+
else
259+
cp -r "$SRC_DIR/fastdeploy_ops.py" "$DST_DIR/" 2>/dev/null || true
260+
cp -f "$SRC_DIR/"fastdeploy_ops_*.so "$DST_DIR/" 2>/dev/null || true
261+
fi
254262
cp -f "$SRC_DIR/version.txt" "$DST_DIR/" 2>/dev/null || true
255263

256264
echo -e "${GREEN}[SUCCESS]${NONE} Installed FastDeploy using precompiled wheel."

0 commit comments

Comments
 (0)