[BugFix] fix: cast image_mask.any() to bool for task queue serialization#7793
[BugFix] fix: cast image_mask.any() to bool for task queue serialization#7793kevincheng2 wants to merge 1 commit into
Conversation
## 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 ```
|
Thanks for your contribution! |
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 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 段落,建议补全。
CI报告基于以下代码生成(30分钟更新一次): 1 任务总览CI 正在进行中:所有 Required 任务均未失败,当前 3 个运行中、4 个等待中,待完成后将更新报告。
2 任务状态汇总2.1 Required任务 : 3/10 通过
2.2 可选任务 — 22/28 通过
3 失败详情(仅 required)无 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7793 +/- ##
==========================================
Coverage ? 63.81%
==========================================
Files ? 458
Lines ? 63512
Branches ? 9729
==========================================
Hits ? 40531
Misses ? 20208
Partials ? 2773
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 推理服务即可验证:
Checklist
pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch. (N/A)