Skip to content

[BugFix] fix: cast image_mask.any() to bool for task queue serialization#7793

Open
kevincheng2 wants to merge 1 commit into
PaddlePaddle:developfrom
kevincheng2:bugfix/mm_rl_task_queue_bool
Open

[BugFix] fix: cast image_mask.any() to bool for task queue serialization#7793
kevincheng2 wants to merge 1 commit into
PaddlePaddle:developfrom
kevincheng2:bugfix/mm_rl_task_queue_bool

Conversation

@kevincheng2
Copy link
Copy Markdown
Collaborator

Motivation

多模 RL 0 卡场景下,image_mask.any() 返回 numpy.bool_ 类型,通过 task queue 传输时序列化失败导致报错。

Modifications

  • request.with_image = image_mask.any() 改为 request.with_image = bool(image_mask.any()),转换为 Python 原生 bool 类型

Usage or Command

无需额外配置,启动多模 RL 推理服务即可验证:

bash run.sh

Checklist

  • Add at least a tag in the PR title. [BugFix]
  • Format your code, run pre-commit before commit.
  • Add 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. (N/A)

## Motivation

多模 RL 0 卡场景下,`image_mask.any()` 返回 `numpy.bool_` 类型,通过 task queue 传输时序列化失败导致报错。

## Modifications

- 将 `request.with_image = image_mask.any()` 改为 `request.with_image = bool(image_mask.any())`,转换为 Python 原生 bool 类型

## Usage or Command

无需额外配置,启动多模 RL 推理服务即可验证:

```bash
bash run.sh
```
@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 12, 2026

Thanks for your contribution!

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-12 17:31:40

📋 Review 摘要

PR 概述:修复多模 RL 场景下 image_mask.any() 返回 numpy.bool_ 导致 task queue 序列化失败的问题
变更范围fastdeploy/engine/sched/resource_manager_v1.py
影响面 Tag[Scheduler] [RL]

📝 PR 规范检查

PR body 缺少模板要求的 ## Accuracy Tests 段落,需补全。标题格式合规。

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

## Motivation
多模 RL 0 卡场景下,`image_mask.any()` 返回 `numpy.bool_` 类型,通过 task queue 传输时序列化失败导致报错。

## Modifications
-`request.with_image = image_mask.any()` 改为 `request.with_image = bool(image_mask.any())`,转换为 Python 原生 bool 类型,避免 task queue 序列化异常

## Usage or Command
无需额外配置,启动多模 RL 推理服务即可验证:

```bash
bash run.sh
```

## 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.
- [x] 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.

问题

未发现阻塞性问题。

总体评价

修复精准、侵入性小,正确地将 numpy.bool_ 转换为 Python 原生 bool,解决了 task queue 序列化问题。PR 描述缺少 ## Accuracy Tests 段落,建议补全。

@PaddlePaddle-bot
Copy link
Copy Markdown

🤖 Paddle-CI-Agent | ci_status_monitor | 2026-05-12 17:48:33

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


1 任务总览

CI 正在进行中:所有 Required 任务均未失败,当前 3 个运行中、4 个等待中,待完成后将更新报告。

总执行(rerun次数) 总任务 ✅ 通过 ❌ 失败 ⏳ 运行中 ⏸️ 等待中 跳过
38(0) 38 25 1 5 6 1

2 任务状态汇总

2.1 Required任务 : 3/10 通过

必选任务阻塞合并,失败需优先处理。当前 CI 仍在进行中,请等待所有必选任务完成。

状态 任务 耗时 根因 修复建议 日志 重跑
Extracted partial CE model tasks to run in CI. / run_ce_cases - 运行中 - Job -
xpu_4cards_case_test / run_xpu_4cards_cases - 运行中 - Job -
xpu_8cards_case_test / run_xpu_8cards_cases - 运行中 - Job -
⏸️ Run FastDeploy LogProb Tests / run_tests_logprob - 等待中 - - -
⏸️ Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage - 等待中 - - -
⏸️ Run Four Cards Tests / run_4_cards_tests - 等待中 - - -
⏸️ Run Stable Tests / stable_tests - 等待中 - - -
其余 3 个必选任务通过 - - - - -

2.2 可选任务 — 22/28 通过

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

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

3 失败详情(仅 required)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@203c7da). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #7793   +/-   ##
==========================================
  Coverage           ?   63.81%           
==========================================
  Files              ?      458           
  Lines              ?    63512           
  Branches           ?     9729           
==========================================
  Hits               ?    40531           
  Misses             ?    20208           
  Partials           ?     2773           
Flag Coverage Δ
GPU 72.40% <100.00%> (?)
XPU 7.20% <0.00%> (?)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants