Skip to content

[DataProcessor]merge processor#7726

Closed
luukunn wants to merge 5 commits intoPaddlePaddle:developfrom
luukunn:merge_1
Closed

[DataProcessor]merge processor#7726
luukunn wants to merge 5 commits intoPaddlePaddle:developfrom
luukunn:merge_1

Conversation

@luukunn
Copy link
Copy Markdown
Collaborator

@luukunn luukunn commented May 6, 2026

Motivation

💡 If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)

💡 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)

Modifications

Usage or Command

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

Copilot AI review requested due to automatic review settings May 6, 2026 15:33
@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 6, 2026

Thanks for your contribution!

PaddlePaddle-bot

This comment was marked as outdated.

@PaddlePaddle-bot
Copy link
Copy Markdown

PaddlePaddle-bot commented May 6, 2026

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-05-07 16:43:04

CI报告基于以下代码生成(30分钟更新一次):


1 任务总览

❌ 有 1 个 required 任务失败,另有 4 个 required 任务运行中,需等待结果。

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
36(0) 36 27 2 5 2 0

2 任务状态汇总

2.1 Required任务 : 5/10 通过

必选任务阻塞合并,失败需优先处理。

状态 任务 耗时 根因 修复建议 日志 重跑
Approval 7s PR问题:修改日志行为,缺少指定RD审批 请 xyxinyang 或 zyyzghb 进行 Approve Job -
Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage - 运行中 - Job -
Extracted partial CE model tasks to run in CI. / run_ce_cases - 运行中 - Job -
Run Four Cards Tests / run_4_cards_tests - 运行中 - Job -
xpu_4cards_case_test / run_xpu_4cards_cases - 运行中 - Job -
其余 5 个必选任务通过 - - - - -

2.2 可选任务 — 22/26 通过

可选任务不阻塞合并,失败仅供参考。

状态 任务 耗时 日志 重跑
Check PR Template 13s Job -
Trigger Jenkins for PR - - -
⏸️ CI_HPU - - -
⏸️ Run iluvatar Tests / run_iluvatar_cases - - -
其余 22 个可选任务通过 - - -

3 失败详情(仅 required)

Approval — 代码规范(置信度: 高)

Approval

  • 状态: ❌ 失败
  • 错误类型: 代码规范
  • 置信度: 高
  • 根因摘要: PR修改了日志行为,缺少指定RD审批
  • 分析器: 通用分析(fallback)

根因详情:
PR 新增了多个日志调用(.info().debug()log_request()),触发了 FastDeploy 的日志修改审批规则。check_approval.sh 脚本检测到 1 个审批错误,要求必须有 xyxinyang(zhouchong)zyyzghb(zhangyongyue) 中的一位 RD 审批通过后方可合并。

关键日志:

0. You must have one FastDeploy RD (xyxinyang(zhouchong), zyyzghb(zhangyongyue)) approval for modifying logging behavior (.info/.debug/.error/log_request).
There are 1 approved errors.
##[error]Process completed with exit code 6.

修复建议:

  1. xyxinyang(zhouchong)zyyzghb(zhangyongyue) 在本 PR 上进行 Approve Review
  2. 如果日志修改是必要的,确保已通知并获得相关 RD 的审批

修复建议摘要: 请 xyxinyang 或 zyyzghb 对 PR 进行 Approve

关联变更: PR 新增了大量 data_processor_logger.info/debuglog_request() 调用

链接: 查看日志

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 6, 2026

Codecov Report

❌ Patch coverage is 29.35190% with 1319 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@d70f33d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/input/processor.py 41.52% 243 Missing and 40 partials ⚠️
fastdeploy/input/multimodal/ernie_vl.py 25.26% 209 Missing and 4 partials ⚠️
fastdeploy/input/multimodal/mm_processor.py 21.21% 206 Missing and 2 partials ⚠️
fastdeploy/input/multimodal/qwen_vl.py 17.59% 189 Missing and 3 partials ⚠️
...tdeploy/input/multimodal/image_processors/ernie.py 31.48% 111 Missing ⚠️
fastdeploy/input/multimodal/paddleocr_vl.py 16.54% 111 Missing ⚠️
...loy/input/multimodal/image_processors/paddleocr.py 21.27% 74 Missing ⚠️
...stdeploy/input/multimodal/image_processors/qwen.py 25.58% 64 Missing ⚠️
fastdeploy/input/multimodal/common.py 31.74% 40 Missing and 3 partials ⚠️
fastdeploy/input/preprocess.py 54.54% 10 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #7726   +/-   ##
==========================================
  Coverage           ?   70.17%           
==========================================
  Files              ?      409           
  Lines              ?    57420           
  Branches           ?     9013           
==========================================
  Hits               ?    40293           
  Misses             ?    14328           
  Partials           ?     2799           
Flag Coverage Δ
GPU 70.17% <29.35%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

PaddlePaddle-bot

This comment was marked as outdated.

@luukunn luukunn changed the title first commit [DataProcessor]merge processor May 7, 2026
Copy link
Copy Markdown

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Paddle-CI-Agent | pr_review | 2026-05-07 16:29:16

📋 Review 摘要

PR 概述:将多个多模态视觉语言处理器(QwenVL、Qwen3VL、ErnieVL、PaddleOCRVL)整合到统一的 fastdeploy/input/multimodal/ 模块,并重构 chat() 消息解析与 _add_request 类型检测逻辑。
变更范围fastdeploy/entrypoints/fastdeploy/input/multimodal/(新增)、tests/
影响面 Tag[DataProcessor] [APIServer]


📝 PR 规范检查

PR 标题 Tag 后缺少空格([DataProcessor]merge[DataProcessor] Merge …);PR body 所有必填 section(Motivation / Modifications / Usage or Command / Accuracy Tests)内容均为空,仅保留了模板注释。

标题建议(可直接复制):

  • [DataProcessor] Merge multimodal processors for QwenVL/Qwen3VL/ErnieVL/PaddleOCRVL

PR 描述建议(可直接复制,必须复刻 checklist §D2 模板的完整结构):

## Motivation
将多个多模态视觉语言处理器(QwenVL、Qwen3VL、ErnieVL、PaddleOCRVL)从分散实现统一整合到 `fastdeploy/input/multimodal/` 模块,减少代码重复,提高可维护性;同时修复 `_add_request` 对空列表的潜在越界访问,优化 chat 消息解析逻辑。

## Modifications
- `fastdeploy/entrypoints/chat_utils.py`:简化 `parse_chat_messages``str`/`None` 类型的 `content` 直接赋值,而非强制包装为列表
- `fastdeploy/entrypoints/llm.py`- `chat()` 直接传递 `messages`,不再包装为 `{"messages": msg}` 字典列表
  - `_add_request` 新增对 list-of-dict(messages 格式)的类型检测分支
  - 修复 `prompts[i][0]` 在空列表时的潜在 IndexError(增加 `len > 0` 守卫)
- `fastdeploy/input/multimodal/`(新增模块):
  - `common.py`:共享图像缩放工具函数(`smart_resize_qwen``smart_resize_paddleocr`- `image_processors/ernie.py``AdaptiveImageProcessor`(ERNIE 4.5 VL)
  - `image_processors/paddleocr.py``PaddleOCRImageProcessor`
  - `image_processors/qwen.py``qwen3.py`:Qwen / Qwen3 图像处理器
  - `ernie_vl.py``ErnieVLProcessor` 多模态处理器(3D 位置 ID、视频处理)
  - `paddleocr_vl.py``PaddleOCRVLProcessor`
  - `qwen_vl.py``qwen3_vl.py``QwenVLProcessor` / `Qwen3VLProcessor`
  - `mm_processor.py``MMProcessor` 基类
- `fastdeploy/input/preprocess.py``processor.py`:适配新模块结构
- `tests/entrypoints/test_chat.py``test_generation.py`:更新 entrypoints 测试
- `tests/input/test_preprocess.py`:更新 input 处理测试

## Usage or Command
N/A

## Accuracy Tests
N/A

## Checklist

- [x] Add at least a tag in the PR title.
  - Tag list: [`[FDConfig]`,`[APIServer]`,`[Engine]`, `[Scheduler]`, `[PD Disaggregation]`, `[Executor]`, `[Graph Optimization]`, `[Speculative Decoding]`, `[RL]`, `[Models]`, `[Quantization]`, `[Loader]`, `[OP]`, `[KVCache]`, `[DataProcessor]`, `[BugFix]`, `[Docs]`, `[CI]`, `[Optimization]`, `[Feature]`, `[Benchmark]`, `[Others]`, `[XPU]`, `[HPU]`, `[GCU]`, `[DCU]`, `[Iluvatar]`, `[Metax]`]
  - You can add new tags based on the PR content, but the semantics must be clear.
- [ ] Format your code, run `pre-commit` before commit.
- [x] Add unit tests. Please write the reason in this PR if no unit tests.
- [ ] Provide accuracy results.
- [ ] If the current PR is submitting to the `release` branch, make sure the PR has been submitted to the `develop` branch, then cherry-pick it to the `release` branch with the `[Cherry-Pick]` PR tag.

问题

级别 文件 概述
📝 PR 规范 标题 / body Tag 后缺少空格;Motivation / Modifications / Usage / Accuracy Tests 所有 section 内容为空
🟡 建议 fastdeploy/entrypoints/llm.py_add_request prompts[i] 为空列表 [] 时,len > 0 守卫使两个 list 分支均不命中,isinstance(dict) 也不匹配,tasks 变量处于未定义状态(潜在 NameError 或复用上轮循环旧值)
❓ 疑问 fastdeploy/input/multimodal/image_processors/ernie.pyset_pixels assert isinstance(min_pixels, int) and min_pixels >= 0python -O 优化模式下会被静默跳过,导致非法参数流入后续计算;建议改为 raise ValueError

🟡 建议修复(llm.py _add_request

在现有所有类型分支末尾增加兜底,避免 tasks 未定义:

else:
    raise ValueError(
        f"Unsupported prompt type at index {i}: {type(prompts[i])}, value={prompts[i]!r}"
    )

❓ 疑问(ernie.py set_pixels

# 当前(在 python -O 下会被跳过)
assert isinstance(min_pixels, int) and min_pixels >= 0, "min_pixels must be positive int"

# 建议改为
if not (isinstance(min_pixels, int) and min_pixels >= 0):
    raise ValueError("min_pixels must be a non-negative int")

总体评价

PR 整合了多个多模态处理器,整体架构清晰、抽象合理,新增测试覆盖基本功能。主要待改进点:PR 描述为空需补充、_add_request 存在空列表未处理的边界情况、ernie.pyassert 用于运行时校验违反最佳实践。

@luukunn luukunn closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants