Repository navigation
feat(data): route multimodal pixel tensors exclusively to PP0 for Qwen VL models - #456
Open
DrRyanHuang wants to merge 1 commit into
Open
DrRyanHuang wants to merge 1 commit into
DrRyanHuang wants to merge 1 commit into
Conversation
…s. Avoid broadcasting pixel tensors across pipeline stages while keeping grid metadata for 3D RoPE across all stages.
Contributor
|
Thanks for contributing to Relax, @DrRyanHuang! 感谢你为 Relax 做出贡献! 📚 Contribution guide / 贡献指南Describe the problem, your changes, and how you validated them. Keep each PR focused and run 请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 🛠️ CI commands / CI 指令
Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access. 在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。 🔎 Merge requirements / 合入条件GitHub:⏳ 合入条件未满足
|
Contributor
Nyanpasu 审查看板审查状态: ✅ 已通过 审查版本: 500826c 目标分支: main 已完成 500826c 的两个文件及受影响调用链审查,未发现需要修改的问题。核对了 CUDA/NPU 标准 Bridge 的像素消费契约与回退模式;跨 PP 硬件执行和性能收益仍未经验证。
没有未解决的审查问题。 提交范围 · 接收 2 · 建议移出 0 · 待确认 0接收 2 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。
Powered by Nyanpasu with gpt-6.1-sol xhigh, please check the suggestions carefully.
|
rai-studio-bot
approved these changes
Oct 19, 2026
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 集中维护 CI team 与 target 映射,并接入 oxfmt mirror 和共享格式化配置。在 `.github/` 的 CODEOWNERS 中追加 `@SigureMo`,保留原有负责人。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> 后续各功能有独立入口,仅共享必要的数据配置,使维护者能直接看懂配置和各层职责。 ## How <!-- How do the changes work? Describe the technical approach. --> - `.github/ci/config.json` 仅包含 `ciTeam` 和 workflow/job target 映射,JavaScript 原生读取 JSON。workflow 使用 `ci`、`gpu-unit`、`integration`;job 使用 `ci/pre-commit`、`ci/cpu-310` 等 `workflow/job` 名称,不保留旧短名称别名。 - CI team 为 `SigureMo`、`NINGBENZHE`、`Yangruipis`,使用实际 GitHub login 大小写。 - 保留 `ShigureLab/[email protected]` 和 JavaScript/JSON 类型选择;clang-format 通过 `exclude_types: [javascript, json]` 排除这两类文件。 - oxfmt 配置移到根目录 `.oxfmtrc.json`,参考 [yutto 的格式化选项](https://github.com/yutto-dev/yutto/blob/main/docs/vite.config.ts):100 列、两空格缩进、单引号、ES5 尾逗号、无分号、箭头参数始终加括号,并关闭 package.json 排序。 - 暂时排除既有 `acquire-devices` action 与 `docs/` 的 oxfmt 格式化;这 9 个既有文件的风格 diff 已移到栈顶专门的格式化层 redai-studio#398,由该层移除临时路径排除,统一格式化 JS/TS、JSON、样式表和 GraphQL,暂不处理 YAML/TOML。 - 本层只包含共享配置、格式化工具配置和 CODEOWNERS,共 4 个文件;指令入口在 redai-studio#393,bypass 在 redai-studio#394,欢迎与指南在 redai-studio#395,skill 在 redai-studio#396,全仓格式化在 redai-studio#398。 原生 gh-stack 第 1/6 层,base 为 `main`。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 本层通过全量 `pre-commit run --all-files`;既有 action 和 docs 文件与 `main` 保持一致,格式化 diff 单独位于栈顶。未新增测试文件。 未在本地运行 `pytest tests/`:本次涉及 CI 自动化及文档,未改动训练代码。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]> Co-authored-by: RAI Studio Bot <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 通过独立 action 和 workflow 提供 `/rerun`、`/cancel`、`/help`,操作当前 PR 的 CI。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> 使权限、运行状态判断、API 操作与评论回复各自清晰,贡献者可以直接在 PR 中操作 CI。 ## How <!-- How do the changes work? Describe the technical approach. --> - `index.mjs` 分离首行指令解析、公开帮助、权限检查与评论回复流程。 - `runs.mjs` 分离 run 筛选、状态判断、job 查询和 API 操作选择;写入前统一核对 PR head。 - 同一 head 下优先选活跃 run,其次选未取消的 run;各组按 run number 取最新值,避免 concurrency 取消的重复 run 遮住实际运行。 - `/rerun` 默认重跑当前 head 最新失败或超时 workflow 中失败的 job,也支持精确指定 workflow 或 `workflow/job`;`ci` 只选择 pre-commit/CPU workflow,`all` 选择全部已配置 workflow。`/help` 展示相同命名和范围,取消仅接受 workflow target。 - 首行之后可写普通正文,不包含针对特定账号或 agent 署名的解析分支。 - 使用 workflow `GITHUB_TOKEN`;只加载默认分支代码,按源评论 ID 去重,写入超时后不自动重复操作。 - 公开帮助仅介绍贡献者日常指令;bypass 和 Nyanpasu review 各自独立处理。 原生 gh-stack 第 2/6 层,依赖 redai-studio#392 的共享 JSON。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 全量 pre-commit 和 actionlint 已通过。临时 Node 冒烟检查覆盖首行解析、公开帮助、权限、去重、fork run 匹配、API 操作选择、head 变化和不明确写入结果。另以真实运行数据验证 6 个并发重复运行场景,包括被取消的高编号 run 与活跃、失败、成功 run 共存,以及全部取消时的显式重跑。另通过 27 个临时指令场景检查:7 个新 job target 精确重跑、7 个旧短名称拒绝、7 个 job 取消请求拒绝,以及 workflow/all/default/help 的范围。未提交测试文件。 未在本地运行 `pytest tests/` 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]> Co-authored-by: RAI Studio Bot <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 通过 `ShigureLab/ci-bypass@v2` 判断 CI team 的标签或评论豁免,并在 synchronize 时独立清理 bypass 标签。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> 将豁免判断集中到可复用 workflow,由 ci-bypass 处理规则匹配与授权检查,CI workflow 根据结果决定是否运行测试。 ## How <!-- How do the changes work? Describe the technical approach. --> - 可复用 `check-bypass.yml` 在 `ubuntu-slim` 上运行,CPU、GPU unit 和 integration workflow 分别传入 target。 - 从共享 JSON 读取三人 CI team,支持 workflow/all 标签和 `/bypass` 评论,理由可选。 - 使用 `ShigureLab/ci-bypass@v2`,不锁定具体 commit。 - 独立 synchronize workflow 分页获取并移除 `ci-bypass:` 标签。历史 bypass 评论仍遵循上游规则。 - Gate 失败时运行原测试;只在 gate 成功且明确输出 `can-skip=true` 时跳过测试,workflow 取消后不继续启动测试。 原生 gh-stack 第 3/6 层,base 为 redai-studio#393。豁免与维护操作记录在 redai-studio#396 的 skill 参考页。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 全量 pre-commit 和 actionlint 已通过。 未在本地运行 `pytest tests/` 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 通过独立欢迎 action 提供可展开的贡献入口和日常 CI 指令,并在中英文贡献指南中补充指令表与 target 表。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> 让贡献者直接找到需要的操作说明,维护配置和豁免细节由 agent skill 承载。 ## How <!-- How do the changes work? Describe the technical approach. --> - 双语欢迎模板保留贡献、CI 两个可展开区域,链接到贡献指南的 CI 章节。 - `WELCOME_BOT_TOKEN` 仅用于欢迎发布;`WELCOME_BOT_LOGIN` 必须显式配置,workflow 与 action 均无账号默认值。发布前校验配置与 token 所属账号,分页去重,在默认分支加载发布代码。 - 在 redai-studio#302 整理后的中英文贡献指南中新增 CI 章节,放在完整的 PR 描述示例之后、交流与反馈之前,并从创建 PR 步骤链接到 CI 章节。先解释 target 命名,再列出 target 表;表中统一使用 `workflow` / `workflow/job` 命名,补充 `/rerun ci`、`/rerun ci/pre-commit` 与 `all` 的范围示例,并明确取消只接受 workflow。 - 移除独立 CI 页面及侧栏入口;公开欢迎、帮助和贡献指南不展示 bypass 或维护配置。 - 给 agent 的 skill 入口由下一层 redai-studio#396 放在模板的 HTML 注释中。 原生 gh-stack 第 4/6 层,base 为 redai-studio#394。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 全量 pre-commit 和 actionlint 已通过。VitePress 构建、欢迎模板内容检查及 skill 参考链接检查通过;构建仅有既有旧文档链接警告。欢迎 action 冒烟检查覆盖缺失账号、账号不匹配、显式配置账号及重复评论去重。中英文 target 表已逐项核对共享配置,新命名后的 VitePress 构建通过。 未在本地运行 `pytest tests/` 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [x] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]> Co-authored-by: Ryan <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 新增 `relax-github-ci` skill,主文件提供操作流程与公共指令索引,参考页分别介绍 rerun API 与豁免维护。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> 让 agent 优先使用已有的 GitHub 权限直接操作 CI,并按需读取详细说明。 ## How <!-- How do the changes work? Describe the technical approach. --> - 有 Actions 写权限时优先使用 `gh run` 或 REST API;缺少直接权限且符合评论接口条件时,使用 PR 评论指令。 - 主文件集中描述当前 PR/head/required checks 检查、run 选择、公共评论协议、指令索引、取消操作与结果验证;target 使用配置中的精确 `workflow` / `workflow/job` 名称,无旧短名称别名,并区分 `ci` 与 `all`。 - `references/rerun.md` 只介绍重跑 API 与 job ID 获取;`references/maintenance.md` 记录 CI team、豁免、标签清理和部署维护,并明确 bypass 仅接受 `ci`、`gpu-unit`、`integration` 或 `all`。 - 不写入特定账号/agent 的署名教程或从未提供过的指令,Markdown 正文不手工硬折行。 - 欢迎评论通过 HTML 注释向 agent 提供 skill 链接,渲染后不显示该提示;中英文贡献指南保留 skill 入口。 原生 gh-stack 第 5/6 层,依赖 redai-studio#395。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 全量 pre-commit 和 actionlint 已通过。VitePress 构建、欢迎模板内容检查及 skill 参考链接检查通过;构建仅有既有旧文档链接警告。 未在本地运行 `pytest tests/` 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [x] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]> Co-authored-by: RAI Studio Bot <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 新增专门的格式化层,把既有文件的风格调整从 redai-studio#392 移到栈顶,并使用无 Node 运行时的 oxfmt mirror 统一格式化 JS/TS、JSON 和样式表,暂不处理 YAML/TOML。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> CI 基础设施改动与全仓风格调整分开审查;同时补齐 TypeScript、样式表和 JSON 配置的格式化覆盖。 ## How <!-- How do the changes work? Describe the technical approach. --> - 保留 `ShigureLab/[email protected]` 和根目录 `.oxfmtrc.json` 的现有风格。 - 使用 `types_or: [text]` 把格式识别交给 standalone oxfmt,避免 pre-commit 类型识别漏掉 `.mts`、`.jsonc`、`.gql` 及特殊配置文件名。`--no-error-on-unmatched-pattern` 允许仅包含不支持格式的批次,受支持文件的语法错误仍然会失败。 - 移除 redai-studio#392 的临时路径排除,覆盖 JS/JSX、TS/TSX、JSON/JSONC/JSON5、CSS/SCSS/Less、GraphQL;现有 `transfer_queue/` 全局排除继续生效。 - 使用 `exclude_types: [yaml, toml]` 暂时排除 YAML/TOML;这些文件的风格调整均已撤回,`.pre-commit-config.yaml` 只保留必要的 hook 配置修改。 - HTML、Vue、Markdown 不在当前 standalone 版本的支持范围内;Markdown 沿用现有 mdformat。 - clang-format 继续按语言排除 JavaScript/JSON,避免重复格式化。 - 本层共修改 14 个文件;完整栈中 oxfmt 实际匹配 22 个文件。 原生 gh-stack 第 6/6 层,base 为 redai-studio#396;前五层仍为 redai-studio#392 → redai-studio#393 → redai-studio#394 → redai-studio#395 → redai-studio#396。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - 全量 `pre-commit run --all-files --show-diff-on-failure` 通过,重复运行后无新增 diff。 - 在不含 Node 的 PATH 下实测 16 种启用的扩展名;HTML/Vue/Markdown 确认为不支持。 - 实际 pre-commit 文件选择覆盖 `.mts`、`.jsonc`、`.gql`;oxfmt 全仓 `--check` 通过,且忽略不匹配文件的选项不会掩盖 TypeScript 语法错误。 - 验证全部已跟踪 YAML/TOML 均被 hook 排除,内容与父层一致(必要的 hook 配置修改除外);5 个 JSON 文件解析值一致,7 个 JS/TS 文件经 esbuild 规范化后的输出一致。 - `vitepress build docs` 与 `node docs/fix-chunk-names.js` 通过。 未运行训练单测及多节点 GPU/NPU 集成测试:本层仅调整格式化配置和代码风格,本地也不具备相应集成测试硬件;未新增测试文件。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [x] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
…dio#421) ## What <!-- What changes does this PR introduce? --> 1. deepeyes_v2_agentic rollout tp2->tp4 and select-offload add extra tensors offload to avoid oom 2. fix grad_norm nan when using tms instead of select-offload ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> --------- Co-authored-by: zhujinlei <[email protected]>
li126com
pushed a commit
to li126com/Relax
that referenced
this pull request
Oct 19, 2026
## What <!-- What changes does this PR introduce? --> 修复 welcome 评论中的 required CI 汇总:先选择每个检查身份当前有效的报告,再汇总结果,避免历史取消记录遮蔽后续成功。 仅修改 `.github/actions/pr-welcome/merge-status.mjs`,不修改训练代码、依赖或 welcome 发布流程。 按维护者的[文件级反馈](https://github.com/redai-studio/Relax/pull/430#discussion_r4241962221),已移除新增的版本控制测试文件;回归材料在工作树外保留并重跑,未新增 CI 或 hook 执行机制。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> Relates to redai-studio#370。 复现时,`gh pr checks --required` 的 8 项检查均通过,但 head 的 GraphQL rollup 仍包含 7 条旧 `CANCELLED` 和 9 条 `SUCCESS`(Pre-commit 有两条成功报告)。原实现汇总全部同名记录,导致 welcome 的 CI 行错误显示未通过。REST `filter=latest` 仍保留跨 suite 的这些记录,不能单独解决问题。 本修复不是忽略所有取消:当前有效的失败、取消、等待及缺失仍如实阻塞,审批、团队要求和 GitHub 整体合入状态不因 CI 行修正而变成满足。 ## How <!-- How do the changes work? Describe the technical approach. --> - 完整读取分页后,CheckRun 按名称、App、workflow ID(无则名称)及 event 隔离身份;StatusContext 按 context 独立处理。同名 check/status、不同 provider/workflow/event 不互相覆盖。 - CheckRun 取最大 `databaseId` 作为创建先后代理,覆盖尚无 `startedAt` 的新 queued/rerun;StatusContext 取最新 `createdAt`。不依赖 API 列表顺序,不偏好成功或非取消结果。 - 选择有效报告之后再应用 `isRequired`;正 provider pin 校验 App。Legacy status 无 App 身份,同名多 provider pin 无法区分时保守保持等待。排序/provider 元数据缺失或完全相同的时序也保守保留可能阻塞的报告。 - 保留每个 required context/provider 的 test-merge 优先与 head 回退、缺失为等待,以及 `SUCCESS` / `NEUTRAL` / `SKIPPED` 为通过。审批、团队及 overall 渲染逻辑保持不变。 边界:GitHub GraphQL schema 没有承诺 `databaseId` 跨任意 provider 的严格时间单调性;这里采用明确的创建顺序工程代理,并非完整复刻 GitHub 内部合入判定或 `gh` 的 `startedAt` 排序。多 provider legacy status 和缺失/相同时序的保守处理可能继续显示阻塞。最终合入资格仍由 GitHub 判定。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - 外部手工回归:删除前将 50 场景 suite 保留在工作树外,测试的是与最终 `merge-status.mjs` **逐字节相同的副本**。Node 24.21.0 与 26.11.1 各 **50 passed / 0 failed / 0 skipped**。该 suite 不在 PR 或版本控制中,也没有接入 CI;不将这次手工验证称为仓库自动回归覆盖。 - `pre-commit run --all-files --show-diff-on-failure`:对移除测试后的最终代码在 Python 3.12 隔离工具环境执行,16 个 hooks 全部通过,没有跳过 hooks 或修改配置。先前 Python 3.14 下旧 docformatter 1.3.1 构建失败,Python 3.13 下缺少 lib2to3;切换验证工具解释器后通过,未修改项目依赖。 - 原生产修复已通过独立只读本地审查:Node24 50/50、实际 API query/responses 离线重放、100 次 seeded 乱序、额外 17 个边界及 11 个非 CI 状态变体通过。本次仅移除测试文件,生产模块字节与该已审版本保持一致;随后重新执行上述外部手工回归和完整 hooks。原 50 场景对旧实现为 38 passed / 12 failed。 - 手工场景覆盖旧取消后成功、旧成功后新失败/取消/等待、无开始时间的新 queued、provider/status 身份、分页、缺失检查及 head/test-merge 选择。对相同复现 snapshot,旧/新输出只有 CI 行由未通过改为通过;overall BLOCKED 和审批 0/1 等其它要求未变。 - 未运行无关的完整 Python/GPU 集成测试、远程训练或部署;这是 JavaScript CI 汇总逻辑修改。本地结果不证明 hosted CI 或部署后 welcome UI 已更新。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> 同一复现输入的变化: ```text CI: ❌ 未通过 -> ✅ 已通过 GitHub: ⏳ 合入条件未满足 -> 不变 审批人数: ⏳ 0/1 -> 不变 ``` 没有直接编辑 redai-studio#370 的 welcome 评论,也没有触发 rerun 或部署。 联合署名对应参与诊断、变更审查、测试复核及发布协调的 Codex 协作者;实现及发布由 Nyako 执行。 <div align="right"> <sup>This PR is co-authored with @codex (gpt-6.1 sol xhigh)</sup> </div> --------- Co-authored-by: Codex <[email protected]>
Religious-J
pushed a commit
to Religious-J/Relax
that referenced
this pull request
Oct 30, 2026
## What <!-- What changes does this PR introduce? --> ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. -->
Religious-J
pushed a commit
to Religious-J/Relax
that referenced
this pull request
Oct 30, 2026
## What <!-- What changes does this PR introduce? --> ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. -->
Religious-J
pushed a commit
to Religious-J/Relax
that referenced
this pull request
Oct 30, 2026
…o#286) thx for building and open-sourcing Relax — I've been using it to get the fully async training path running, and ran into this while looking into redai-studio#283. ## What This PR fixes the TransferQueue consumer-side conversion when length/reward fields are restored as jagged `NestedTensor`s. It also adds regression coverage for: * dense tensor conversion; * jagged `NestedTensor` rows; * singleton nested rows that should become Python scalars; * mixed singleton / multi-element nested rows; * the actual `get_data_from_transfer_queue()` length/reward conversion path. <!-- What changes does this PR introduce? --> ## Why Fixes redai-studio#283. `get_data_from_transfer_queue()` currently assumes length/reward-style fields are always regular dense tensors: ```python if "lengths" in k or "reward" in k: new_rollout_data[k] = v.tolist() ``` TransferQueue may restore sampled tensor fields as jagged `NestedTensor`s. Calling `.tolist()` on the whole `NestedTensor` isn't supported by PyTorch, so the consumer fails while reconstructing the rollout batch. Before the fix, the regression test reproduces the same failure reported in redai-studio#283: ```text relax/utils/data/stream_dataloader.py:888: in get_data_from_transfer_queue new_rollout_data[k] = v.tolist() RuntimeError: .tolist() is not supported for tensor subclasses, got NestedTensor ``` Simply doing `unbind()` + `sample.tolist()` isn't quite enough either, since scalar-per-sample fields such as `response_lengths` would become: ```text [[512], [135]] ``` instead of: ```text [512, 135] ``` which breaks the downstream length semantics. <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How I added a small conversion helper at the TransferQueue consumer boundary. For a regular dense tensor, it keeps the existing `.tolist()` behavior. For a nested tensor, it iterates over the rows with `unbind()`: * singleton rows use `.item()` and become Python scalars; * multi-element rows use `.tolist()` and keep their row boundary. So, for example: ```text [tensor([512]), tensor([135])] ``` is restored as: ```text [512, 135] ``` while a genuinely ragged value such as: ```text [tensor([1, 2]), tensor([3, 4, 5])] ``` stays: ```text [[1, 2], [3, 4, 5]] ``` I kept this PR intentionally small and limited to the existing `lengths` / `reward` conversion path. A field-schema/normalizer approach would probably be a nicer long-term hardening, but IMO that's better handled separately rather than mixing a broader refactor into this bug fix. ## Testing ### Before the fix The consumer-boundary regression test fails with the original redai-studio#283 error: ```bash pytest -q \ tests/utils/data/test_streaming_tq_iterator.py::test_get_data_from_transfer_queue_converts_nested_length_and_reward_fields ``` Result: ```text FAILED tests/utils/data/test_streaming_tq_iterator.py::test_get_data_from_transfer_queue_converts_nested_length_and_reward_fields relax/utils/data/stream_dataloader.py:888: in get_data_from_transfer_queue new_rollout_data[k] = v.tolist() RuntimeError: .tolist() is not supported for tensor subclasses, got NestedTensor 1 failed in 2.89s ``` ### After the fix Same regression test: ```bash pytest -q \ tests/utils/data/test_streaming_tq_iterator.py::test_get_data_from_transfer_queue_converts_nested_length_and_reward_fields ``` ```text 1 passed in 2.83s ``` Focused regression coverage: ```bash pytest -q \ tests/utils/data/test_streaming_tq_iterator.py \ -k "tensor_to_python_values or converts_nested_length_and_reward_fields" ``` ```text 4 passed, 6 deselected in 2.89s ``` Full `StreamingTQIterator` test file: ```bash pytest -q tests/utils/data/test_streaming_tq_iterator.py ``` ```text 10 passed in 2.91s ``` All data utility tests: ```bash pytest -q tests/utils/data/ ``` ```text 81 passed, 4 skipped in 3.38s ``` ```text -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 1466 passed, 15 skipped, 74 warnings in 321.56s (0:05:21) (RewardWorker pid=12193) 2026-08-20 11:26:30 | INFO | relax.utils.reload_utils:267 Reloaded Python module: tests.engine.rewards.custom_reward_fixtures [repeated 2x across cluster] (Ray deduplicates logs by default. Set RAY_DEDUP_LOGS=0 to disable log deduplication, or see https://docs.ray.io/en/master/ray-observability/user-guides/configure-logging.html#log-deduplication for more options.) ``` - [x] `pre-commit run --all-files` passes - [x] Tests pass (`pytest tests/`) - [x] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> The relevant before/after failure and test results are included above.
Religious-J
pushed a commit
to Religious-J/Relax
that referenced
this pull request
Oct 30, 2026
## What Add qwen3.5-35b-sft script, and use --sft-chunked-logits to reduce GPU memory usage, then TP1PP2EP4 reduce comm time for a better performance. ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. -->
Religious-J
pushed a commit
to Religious-J/Relax
that referenced
this pull request
Oct 30, 2026
…i-studio#309) ## What 镜像:iregistry.baidu-int.com/xpu/xrelax_torch29_ubuntu2204_xsgl0510_dev:20260831_3 启动命令:bash examples/deepeyes_v2_agentic/run_deepeyes_v2_agentic_klx.sh 目前能够跑通,已完成200步并且raw_reward对齐 ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> --------- Co-authored-by: zhujinlei <[email protected]>
dirtyDan0
pushed a commit
to dirtyDan0/Relax
that referenced
this pull request
Nov 5, 2026
## What <!-- What changes does this PR introduce? --> Fix the dead links in documentation. ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> The branch `develop` does not exists in GitHub. ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [x] `pre-commit run --all-files` passes - [x] Tests pass (`pytest tests/`) - [x] New tests added (if applicable) - [x] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. -->
dirtyDan0
pushed a commit
to dirtyDan0/Relax
that referenced
this pull request
Nov 5, 2026
redai-studio#57) …pport non-fp8 backends ## What The user changed the except ImportError to except Exception on L2-8 to gracefully handle unsupported fp8 (ue8m0 quantization) imports ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [✅ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> Co-authored-by: 宁本哲 <[email protected]>
dirtyDan0
pushed a commit
to dirtyDan0/Relax
that referenced
this pull request
Nov 5, 2026
Add Megatron model architecture config for Qwen3-0.6B, aligned with the HF Qwen/Qwen3-0.6B config.json. Enables single-GPU quickstart runs. ## What <!-- What changes does this PR introduce? --> ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> Co-authored-by: Baiiiii126 <[email protected]>
dirtyDan0
pushed a commit
to dirtyDan0/Relax
that referenced
this pull request
Nov 5, 2026
redai-studio#167) ## What 1. Add qwen3.5-35B-vl and qwen3.6-35B text support 2. Add global CPU affinity optimization ## Why <!-- Why are these changes needed? Link related issues with "Fixes redai-studio#123" or "Relates to redai-studio#456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. -->
3 of 11 tasks
SigureMo
pushed a commit
that referenced
this pull request
Nov 7, 2026
## What <!-- What changes does this PR introduce? --> PPU (Zhenwu ZW-M890P and ZW-810E) runs on torch.cuda with PCCL registered as "nccl": devices come from `CUDA_VISIBLE_DEVICES` and Ray reports GPU. Its row instead claimed `eccl` / `PPU_VISIBLE_DEVICES` / `PPU` / `ppu`, a torch namespace that does not exist, so detection always fell through to cuda. ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> ## How <!-- How do the changes work? Describe the technical approach. --> Make it probed on `/dev/alixpu`, keep the expandable-segments and NUMA gates on it, and enable the per-chunk weight-push barrier. Only the reported identity moves. ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. -->
NINGBENZHE
pushed a commit
that referenced
this pull request
Nov 26, 2026
## What add fsdp-turbo backend refactor #506 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> ## How <!-- How do the changes work? Describe the technical approach. --> ## Testing - no-mtp: <img width="1368" height="836" alt="relax-turbo-pr-no-mtp-loss" src="https://github.com/user-attachments/assets/3690d23d-e28d-4062-9872-3f5f8bee6a19" /> - [ ] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> --------- Co-authored-by: ruanhao9656 <[email protected]>
NINGBENZHE
pushed a commit
that referenced
this pull request
Nov 26, 2026
## What <!-- What changes does this PR introduce? --> 放开 `--mtp-only-training` 在共享物理 MTP 层(`--mtp-use-repeated-layer`)下的多步顺序预测深度训练限制,并新增 Qwen3.8-27B 单机 8 卡 MTP 草稿蒸馏训练脚本与对应参数校验单元测试。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> Relates to #562 Qwen3.5 / Qwen3.8 原生 checkpoint 仅包含 1 个物理 MTP block(`mtp_num_hidden_layers=1`)。此前 `_normalize_mtp_only_training_args` 将 `--mtp-only-training` 硬编码限制为 `mtp_num_layers == 1`,无法利用 Megatron-Core 已支持的 `--mtp-use-repeated-layer` 对同一物理 MTP 层进行 `K>1` 的 DeepSeek-V3 式顺序展开训练(第 `k` 步接收第 `k-1` 步 MTP hidden state 与下一真实 token embedding),也缺少可直接复用的 8 卡 Qwen3.8-27B MTP 草稿蒸馏训练配方来对比 `K=1/2/3` 在 SGLang 推测解码下的接受率与真实吞吐。 ## How <!-- How do the changes work? Describe the technical approach. --> - **参数校验扩展(`relax/utils/arguments.py`)**: - 在 `_normalize_mtp_only_training_args` 中保留 `mtp_num_layers` 默认值 `1`,校验 `mtp_num_layers >= 1`。 - 当 `mtp_num_layers > 1` 时要求必须显式开启 `--mtp-use-repeated-layer`;继续拒绝未开启权重共享的多物理层配置,确保模型只构造并训练单个物理 MTP layer(`mtp.layers.0`),与原生 HF checkpoint 权重结构完全兼容。 - **训练脚本(`scripts/training/sft/run-qwen38-27B-mtp-only-distill-8xgpu.sh`)**: - 提供单机 8 卡(TP=8 + Sequence Parallel)Qwen3.8-27B MTP-only SFT 蒸馏脚本,冻结主干、视觉模块、embedding 与 LM head,仅更新原生 MTP 层。 - 支持通过环境变量 `MTP_NUM_LAYERS` 配置预测深度(默认 `1`,当 `MTP_NUM_LAYERS > 1` 时自动追加 `--mtp-use-repeated-layer`)。 - **单元测试(`tests/cpu/utils/test_arguments_mtp_only.py`)**: - 新增 `depths in [1, 2, 3]` 搭配 `mtp_use_repeated_layer=True` 的参数归一化测试。 - 新增 `mtp_num_layers=0` 与 `mtp_num_layers=2`(未开启 `--mtp-use-repeated-layer`)的拒绝路径覆盖。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 1. **静态检查与格式化**: - `pre-commit run --all-files --show-diff-on-failure`(16 项钩子全部通过) - `bash -n scripts/training/sft/run-qwen38-27B-mtp-only-distill-8xgpu.sh` 2. **CPU 单元测试**: - `CUDA_VISIBLE_DEVICES='' pytest -q tests/cpu/utils/test_arguments_mtp_only.py tests/cpu/backends/megatron/test_mtp_only_training.py`(44 passed) 3. **8×H20 真实训练与梯度隔离验证**: - 在 `K=2`(`--mtp-num-layers 2 --mtp-use-repeated-layer --ci-test`)下验证每个 TP rank 可训练参数量与 `K=1` 完全一致(12 个张量、`53,110,272` 元素),所有 12 个 MTP 参数梯度非零,非 MTP 参数梯度全为 0,且同时产出 `train/mtp_1_loss` 与 `train/mtp_2_loss`。 - 在 8×H20 上分别完成 `K=1`、`K=2`、`K=3` 全量 2 epochs(507 步,16,229 条目标模型自生成蒸馏样本)训练并导出 HF checkpoint。 4. **SGLang `NEXTN` 推测解码端到端评测**: - 在 300 条 held-out 评测集(非思考 + 思考模式各 300 条,concurrency=9,`max_new_tokens=512`)上,使用匹配推测深度(`SPEC_STEPS = K + 1`、`SPEC_DRAFT_TOKENS = K + 2`,`topk=1`)对比原始模型与训练后 checkpoint。 - **验证边界说明**:未运行全量 `pytest tests/` 多节点 GPU 套件(当前为单机 8×H20 环境);SGLang 吞吐为单次服务实测值,接受率提升已做 10,000 次配对请求 bootstrap 95% 置信区间检验。 - [x] `pre-commit run --all-files` passes - [x] Tests pass (`pytest tests/`) - [x] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> ### 1. 8×H20 训练收敛指标(507 步,所有预测深度平均) | 配置 | 训练步数 | 前 20 步 `mtp_acceptance` | 后 20 步 `mtp_acceptance` | 前 20 步 `mtp_raw_ce` | 后 20 步 `mtp_raw_ce` | 分深度 Loss(前 20 步 → 后 20 步) | | --- | ---: | ---: | ---: | ---: | ---: | --- | | `K=1` | 507 | 0.8157 | **0.8543** | 0.6161 | **0.4700** | `mtp_1`: 0.1232 → 0.0940 | | `K=2` (repeated) | 507 | 0.7573 | **0.8000** | 0.9013 | **0.6976** | `mtp_1`: 0.0623 → 0.0500, `mtp_2`: 0.1180 → 0.0895 | | `K=3` (repeated) | 507 | 0.7109 | **0.7599** | 1.1551 | **0.8824** | `mtp_1`: 0.0418 → 0.0349, `mtp_2`: 0.0785 → 0.0605, `mtp_3`: 0.1107 → 0.0812 | ### 2. SGLang `NEXTN` 同推测深度评测(300 条请求 / 模式,0 错误) | 模式 | 预测深度 `K` | SGLang `steps / draft_tokens` | 原始模型接受率 | 训练后接受率 | 接受率 Δ (配对 Bootstrap 95% CI) | 原始接受长度 | 训练后接受长度 | 原始吞吐 (tok/s) | 训练后吞吐 (tok/s) | | --- | ---: | :---: | ---: | ---: | :---: | ---: | ---: | ---: | ---: | | 非思考 (`think=false`) | `K=1` | `2 / 3` | 0.6941 | **0.6958** | +0.0017 [-0.0016, +0.0050] | 2.3885 | **2.3923** | 711.1 | **717.7** | | 非思考 (`think=false`) | `K=2` | `3 / 4` | 0.5848 | **0.5904** | +0.0056 [+0.0019, +0.0092] | 2.7518 | **2.7682** | 687.4 | 696.1 | | 非思考 (`think=false`) | `K=3` | `4 / 5` | 0.4989 | **0.5024** | +0.0035 [-0.00002, +0.0070] | 2.9888 | **3.0035** | 608.7 | 614.1 | | 思考 (`think=true`) | `K=1` | `2 / 3` | 0.6542 | **0.6680** | **+0.0138 [+0.0090, +0.0187]** | 2.3093 | **2.3374** | 676.4 | **684.3** | | 思考 (`think=true`) | `K=2` | `3 / 4` | 0.5482 | **0.5642** | **+0.0160 [+0.0108, +0.0212]** | 2.6407 | **2.6897** | 648.4 | 657.8 | | 思考 (`think=true`) | `K=3` | `4 / 5` | 0.4616 | **0.4771** | **+0.0155 [+0.0109, +0.0202]** | 2.8378 | **2.9000** | 567.1 | 578.3 | - **结论**:共享权重顺序训练在 `K=1/2/3` 各深度下均提升了目标模型的推测解码接受率与接受长度(思考模式在三个深度下均取得显著正收益,接受率提升 +1.38 ~ +1.60 pp)。横向对比实际吞吐时,`K=1` 在草稿收益与串行草稿/目标验证开销之间最为平衡,训练脚本因此默认 `MTP_NUM_LAYERS=1`,并支持配置 `MTP_NUM_LAYERS=2/3` 进行多深度实验。
yuanlehome
pushed a commit
that referenced
this pull request
Nov 30, 2026
…#836) ## What <!-- What changes does this PR introduce? --> 优化 Score Centering(SC)在 Rollout 阶段获取和解析候选分布的耗时,代码改动拆成两个 commit,另附一个文档同步 commit,不动 SC 的数学逻辑和训练端接口: 1. 截断采样且 `0 < top_k <= k` 时,直接拿 SGLang 原生返回的 support 和概率 `(S, q)`,不再额外请求 `top_logprobs_num=k`。 2. 不截断及回退路径继续走 `top_logprobs`,把 `parse_score_centering_response` 里的逐元素解析改成 NumPy 批量解码,去掉多余的重复校验。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> 跑 SC 实验时发现 Rollout 耗时明显偏高,排查下来主要是两块开销: 1. **截断模式下重复请求再丢弃(这是在做 Sampling Mask 的对比实验过程中发现的,Sampling 是针对截断情况)** - 在 `top_k=64`、SC 候选宽度 `k=128` 这类配置下,SGLang PyTorch sampler 返回的 `output_token_sampling_mask` 和 `output_token_sampling_logprobs` 已经包含了完整的候选集和概率,而且数量肯定不超过 `k`。 - 原代码没复用这份数据,还是顺手向 SGLang 要了每个 token 的 `top_logprobs_num=128`。SGLang 多做了一遍全词表 `topk(128)` 提取和传输,Relax 拿到后再解析、和原生 support 求交,最后把多余的候选全扔掉。 - 去掉这笔冗余请求后,同版本短跑的平均 Rollout 耗时从 **`41.88s` 降到 `12.55s`(−70.03%)**,整步耗时从 **`75.35s` 降到 `48.77s`(−35.27%)**。 2. **不截断模式下 CPU 解析卡在 Python 循环里** - 不截断(`top_p=1.0, top_k=-1`)时 support 是全词表,向 SGLang 要 `top-128` 是避不开的。 - 但原来 `parse_score_centering_response` 在 `token × K`(比如 `512 × 280 × 128`)的嵌套循环里把 `b64` 拆成 Python list 逐个 `isinstance`、循环内反复调 `np.iinfo(np.int32).max` 再逐槽塞回 NumPy,加上 `selected` 模式下还调了两次 `_validate_rows`,把 Rollout 事件循环拖慢了十几秒。 - 改成批量解码后,不截断 60 步 A/B 的平均 Rollout 耗时从 **`45.74s` 降到 `34.51s`(−24.54%)**,整步耗时从 **`80.30s` 降到 `68.58s`(−14.59%)**。 ## How <!-- How do the changes work? Describe the technical approach. --> 代码只改了 `relax/utils/score_centering.py` 和对应单测,SGLang 服务端和 Megatron SC loss 都没动: - **Commit 1(截断路径直通)**: - `configure_score_centering_request` 在 PyTorch sampling backend 且 `0 < int(top_k) <= k` 时,删掉 `top_logprobs_num` 并返回 `"native_support"`(要求 SGLang 服务端支持 `sampling_logprobs_mode="support"` 并返回逐候选 `log-q`)。`top_k > k` 时候选可能超长,继续请求 top-K 走原来的 `support` 路径;如果只开 `top_p`/`min_p` 没设正 `top_k`,会被现有前置校验直接拒掉。 - 新增 `_native_candidates`,在 `parse_score_centering_response` 里直接用原生 `(S, q)` 填 `(ids, logprobs)`,保留原有的完整性校验、singleton、padding 和 `support_complete` 语义。 - **Commit 2(不截断/回退路径批量解析)**: - 拆出 `_decode_logprob_arrays` 和 `_top_logprob_arrays`:`b64` 路径直接 `np.frombuffer` + `reshape(n, k)`,向量化检查 `ids < 0` 和 `np.isneginf(logprobs)`。 - JSON 路径把 `np.iinfo(np.int32).max` 提到循环外并按行写入,保持原来的 ID 边界报错和 `-inf` padding 行为不变。 - `selected` 模式下删掉重复的第二次 `_validate_rows`。 - **Commit 3(文档同步)**: - 同步更新了中英文算法示例文档和 `examples/algorithms/README.md` 中关于 SC 候选采集的说明。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [x] pre-commit run --all-files passes - [x] Tests pass (pytest tests/) - [x] New tests added (if applicable) - [x] Documentation updated (if applicable) 跑了 diff 相关的 CPU 回归,**170 passed**(43 warnings,64.58s)核心 SC 单测复现命令: ```bash python -m pytest -q \ tests/cpu/algorithms/test_score_centering.py \ tests/cpu/utils/test_arguments_score_centering.py \ tests/cpu/utils/test_score_centering_capture.py \ tests/cpu/backends/megatron/test_score_centering_aggregation.py \ tests/cpu/backends/megatron/test_score_centering_loss.py ``` ### 等价性与微基准 | 验证项 | 结果 | |---|---| | 截断路径数值对齐(固定真实样本 logits / token / advantage,对比原代码与优化后) | 23 个非零 advantage 位置(含 16 个 singleton),FP32 / FP64 下逐位置 loss 和 logits 梯度最大绝对差均为 `0` | | 不截断路径输出对齐(相同 JSON / `b64` 输入,对比原代码与优化后) | `tokens`、`sampled`、`ids`、`logprobs`、`support_complete` 全部 bit-exact 一致 | | CPU 解析耗时(`512 × 280 × 128`,3 次取中位数) | JSON:`18.133s → 4.036s`(−77.74%);`b64`:`20.944s → 0.411s`(−98.04%) | > [!NOTE] > 注:上面“差值为 0”指的是常规情况(旧版拿到的 top-K 完整覆盖了实际采样候选)。如果 `top_k` 截断边界刚好有几个概率完全一样的 token,旧版 `topk` 和采样器 `sort` 挑出来的 token 可能不一致,导致旧版求交时丢候选、退回近似计算;新版直接用原生候选不会丢,所以这种并列边界下两边结果可能不同,新版更准。 ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [x] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> **实验配置**:`Qwen3-0.6B` + Countdown,单机 `8×H20G`,Megatron BF16 Actor + SGLang FP8 Sampler(PyTorch sampling backend)。SGD `lr=0.003`,`T=1.0`,`seed=0`,Thinking 关闭,SC 内部 IS 设为 `none`。每步 `64 prompts × 8 responses`,prompt + response 上限 `512` token;固定 Dev `64 题 × 8 次采样`(512 条),每 10 步评一次。 ### 耗时对比(每行内部均为同配置原代码 → 优化后 A/B 对照) | 场景与对照 | 统计窗口 | Rollout(秒/步) | 整步(秒/步) | |---|---|---:|---:| | 截断(`top_p=0.95, top_k=64`),同一基点 `6b21258f`,原代码 → 优化后 | 各跑 4 步,取 step 1–3 均值 | `41.88 → 12.55`(−70.03%) | `75.35 → 48.77`(−35.27%) | | 不截断(`top_p=1.0, top_k=-1`),均请求 `top-128`,原代码 → 优化后 | 各跑 60 步,取 step 1–59 均值 | `45.74 → 34.51`(−24.54%) | `80.30 → 68.58`(−14.59%) | 截断 4 步对照里两组 `sc_support_aligned` 全程为 `1`,平均训练 reward 都是 `−0.8372`。另外单独用优化后的截断路径跑了一轮 100 步长训做稳定性验证(非 A/B 对照),总耗时 91.90 分钟,训练正常收敛(固定 Dev 准确率从初始模型 `u0` 的 `28/512`(5.47%)训到 `u100` 的 `213/512`(41.60%))。 ### 不截断 60 步详细指标 | 指标(`top_p=1.0, top_k=-1`) | 原代码 | 优化后 | |---|---:|---:| | 总耗时 | 88.97 分钟 | 77.01 分钟 | | 每千生成 token Rollout 耗时 | 0.3251 秒 | 0.2433 秒 | | 预热后 `train_time` | 14.72 秒/步 | 14.69 秒/步 | | 固定 Dev 准确率(`u0 → u60`) | `19/512 → 170/512`(33.20%) | `19/512 → 179/512`(34.96%) | | `u60` Dev reward | −0.3359 | −0.3008 | | 60 步平均训练 reward | −0.4988 | −0.5189 | 不截断 A/B 两组 `train_time` 基本一致,省下来的时间全在 Rollout。单 seed 下两组最终 Dev 和平均 reward 有轻微波动(属异步采样正常方差),收敛趋势一致,等价性由上面的固定输入校验保证。 <img width="2988" height="1242" alt="image" src="https://github.com/user-attachments/assets/decc95d9-5d32-4d10-960c-d672488b4a31" /> --------- Co-authored-by: Codex <[email protected]>
yuanlehome
pushed a commit
that referenced
this pull request
Dec 2, 2026
… matching (#851) > [!NOTE] > #425 前面改了太多轮,commit 历史和评论区都比较乱,所以基于最新 main(含 #841)重拉了一个干净分支开这个 PR,这边确认没问题后就把 #425 关了。 > > 顺便标一下方案来源,感谢 @DrRyanHuang 和 @Yangruipis 之前的 review: > - 放弃终端日志匹配、改用 pytest JUnit XML,Pillow/Tornado 走 unittest TestResult 的 `self.results` 导出 JSON,以及 Orange3 样本里多出一条 `"": "ERROR"` 脏条目,均来自 #425 的 review 反馈; > - 这次上 8 卡真机验证时顺手又修掉几个坑(跨文件导入测试函数、参数化 ID 带 `" - "` 被截断、per-session 报告文件隔离、复合命令 `export` 作用域),也一并合进来了。 ## What <!-- What changes does this PR introduce? --> Supersedes #425. 修复 Mini-SWE-Agent 在 R2E-Gym-Lite 训练中的 reward 误判问题:不再从 pytest 终端日志里匹配字符串,而是直接读取结构化测试报告(pytest JUnit XML 或 unittest JSON),和 `expected_output_json` 逐项比对。只有报告非空、没有空测试 ID、且所有用例状态完全一致时才给 1.0,否则一律 0.0。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> > [!CAUTION] > 这不是一个小解析问题,而是会直接污染 RL 训练信号的严重 Bug。在 GRPO 这类基于二值结果(0 / 1)做组内 advantage 估计的训练里,假阳性 1.0 会把改坏了代码的失败 rollout 当成正样本去强化,而假阴性 0.0 会把模型好不容易写对的样本直接丢掉。 旧版 `_parse_log_pytest()` 用 `if "PASSED" in line` 匹配终端输出,实际跑下来有几类很致命的问题: 1. **失败日志带 PASSED 就误给满分**:只要失败用例的报错或断言里出现 "PASSED"(比如 `AssertionError: assert 'PASSED' == 'FAILED'`),旧代码就会直接判 1.0。 2. **空结果、空 ID 穿透**:实际输出和预期都为空,或者解析出 `""` 这种空测试 ID 时,旧代码会跳过校验直接返回 1.0。 3. **非 pytest 仓库、跨文件导入和特殊参数化 ID 容易被误杀**:R2E-Gym-Lite 里像 Pillow(`unittest_custom_runner.py`)和 Tornado(`tornado_unittest_runner.py`)根本不走 pytest,纯靠 JUnit XML 会全军覆没拿 0.0;部分 NumPy 样本存在跨文件导入测试函数(file 与 classname 不一致);另有一些 NumPy/pandas 参数化测试 ID 本身带 `" - "`,如果直接按 `" - "` 截断,标准修复也会被判 0.0。 ## How <!-- How do the changes work? Describe the technical approach. --> 整体思路是让容器把测试结果写到隔离的报告文件里,宿主机直接读结构化数据判分,共涉及 4 个文件: 1. **examples/mini_swe_agent/agent_server.py(容器挂载、准备检查与命令执行)**: - 评分前,在宿主机每个 session 自己的 `tmp_dir` 下建好 XML/JSON 两个空文件并只读/读写挂载进 Apptainer 容器(不共用 `/tmp`,避免多并发互相覆盖),每次评分前宿主机直接清空文件,跑完后宿主机直读,省掉二次 `cat` 和脆弱的文本截取。 - 将 `python /r2e_unittest_adapter.py` 拆为独立准备步骤并检查退出码,失败直接抛异常。 - 只读挂载 `/opt/relax-r2e/r2e_pytest_nodeid.py`,通过 `export R2E_RESULTS_JSON=... PYTHONPATH=... PYTEST_ADDOPTS="... -p r2e_pytest_nodeid --junitxml=... -o junit_family=xunit1" && (<reward_command>)` 显式注入环境变量与插件,确保复合命令(含 `&&`、`;` 或多行)的子进程都能正常继承。 2. **examples/mini_swe_agent/r2e_pytest_nodeid.py(记录真实采集节点)**: - 6 行轻量 pytest 插件,在 `pytest_collection_modifyitems` 中向 `item.user_properties` 写入 `r2e_nodeid`,避免跨文件导入测试函数(如 NumPy `nosetester.py`)时 JUnit XML 的 file 与 classname 不一致导致误判。 3. **examples/mini_swe_agent/r2e_unittest_adapter.py(适配 Pillow / Tornado)**: - 在训练模式下只读挂载进容器,跑测试前把导出逻辑注入 `unittest_custom_runner.py` 和 `tornado_unittest_runner.py`,直接从 `result.results` 导出 JSON(过滤 skipped);显式导入 json、os 且不用海象运算符,兼容 Python 3.6/3.7 老镜像。 4. **examples/mini_swe_agent/r2e_reward.py(纯函数判分逻辑)**: - 解析 xunit1 格式 JUnit XML 时优先保留 error/failure(避免跳过用例的 fixture teardown 报错被漏计),仅忽略纯 skipped;每条参与计分的 testcase 必须包含唯一有效的 `r2e_nodeid` property,并按 R2E 数据集规则将 selector 中的 `::` 转为 `.`(保留参数内的 `" - "`);若为 JSON 则直接解析。 - 比对 `expected_output_json` 时先清掉 ANSI 颜色转义,优先匹配完整 key,未命中时再从右侧剥离 `" - "` 失败诊断后缀;遇到空报告、格式错误、重复 ID 或空测试 ID(含 Orange3 脏条目)统一安全返回 0.0。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - [x] pre-commit run --all-files passes - [x] Tests pass (pytest tests/) - [x] New tests added (if applicable) - [ ] Documentation updated (if applicable) ### 1. 单测与静态检查 - `pytest tests/cpu/examples/test_r2e_reward_regression.py`:**35 passed**(覆盖 XML/JSON 解析、失败含 PASSED、跳过用例 teardown 报错、跨文件导入与已有 conftest 共存、参数化 ID 含 `" - "` 与 `::`、非法 `r2e_nodeid` 与空结果、真实 pytest 和 mock Pillow/Tornado runner 集成测试)。 - `pytest tests/cpu/examples/test_mini_swe*.py`:**56 passed**(合计 **91 passed、17 subtests passed**,CPU CI 已通过)。 ### 2. R2E-Gym-Lite 容器对照(12 个 SIF 镜像,base vs. gold 对照) 在真实 Apptainer 容器里走完整生产评分流程,对比未修改代码(base)和参考修复(gold)的得分: | 仓库(Runner) | 镜像数 | 说明 | base → gold | |---|---:|---|---| | Pillow (unittest_custom_runner) | 3 | 非 pytest,通过只读挂载 adapter 导出 JSON(含 20 passed 用例) | 0.0 → 1.0 | | Tornado (tornado_unittest_runner) | 2 | 包含 2 passed + 2 expected error 且退出码为 1 的样本 | 0.0 → 1.0 | | aiohttp (pytest) | 1 | 标准 JUnit XML(4 passed) | 0.0 → 1.0 | | NumPy / pandas (pytest) | 3 | 参数化 ID 含 `" - "`(60 passed / 20 passed+1 error / 26 passed+3 failed) | 0.0 → 1.0(修复前均误判 0.0) | | NumPy 跨文件导入 (pytest) | 2 | `r2e_tests/test_1.py` 导入 `numpy/testing/nosetester.py`,含预期 setup ERROR | 0.0 → 1.0(通过 `r2e_nodeid` 正确识别) | | Orange3 (pytest) | 1 | 预期含 `"": "ERROR"` 脏条目(26 passed, 1 skipped) | 0.0 → 0.0(正常评分无崩溃) | 同时针对 per-session 文件隔离与复合命令 `export` 做了 SIF smoke test,验证了旧报告预清空和容器临时目录回收: - **aiohttp**(`true && bash /root/run_tests.sh`):宿主机读到 JUnit XML(4 PASSED),退出码 0,reward = 1.0。 - **Tornado**(`true; bash /root/run_tests.sh`):宿主机读到 JSON(2 PASSED, 2 预期 ERROR),退出码 1,reward = 1.0。 ### 3. 八卡端到端 30 步 RL 验证 用 Qwen3.5-35B-A3B 跑完 30 步端到端 RL 训练(每步 4 题 × 4 条轨迹 = 480 条/组,每 10 步在固定 32 题 SWE-Bench-Lite 上评测一次): | 指标 | main | 本 PR | |---|---:|---:| | SWE-Bench-Lite step 0(共享基线) | 3 / 32 (9.38%) | 3 / 32 (9.38%) | | SWE-Bench-Lite step 10 | 7 / 32 (21.88%) | 6 / 32 (18.75%) | | SWE-Bench-Lite step 20 | 7 / 32 (21.88%) | 6 / 32 (18.75%) | | SWE-Bench-Lite step 30 | 7 / 32 (21.88%) | **12 / 32 (37.50%)** | | 训练正奖励总数 | 157 / 480 (32.71%) | **184 / 480 (38.33%)** | | 非零梯度步数 | 24 / 30 | 22 / 30 | 480 条轨迹审计: - **零回归、零故障、零额外开销**:30 步全程 Step time、PPO KL、Entropy 与 Grad norm 均健康稳定。本 PR 组全程准备阶段报错 0、unittest adapter 失败 0、pytest 插件加载失败 0、XML/JSON 解析异常 0;217 次正式提交生成的 83 份 JUnit XML 中,**15,842 个计分 testcase 全部携带有效 `r2e_nodeid`**。 - **下游收敛正常**:固定 32 题 SWE-Bench-Lite Pass@1 从基线 9.38% 稳步提升至 37.50%。 <img width="517" height="197" alt="image" src="https://github.com/user-attachments/assets/2feb8ca1-ecff-48d4-a906-3817f4d39916" /> <img width="517" height="400" alt="image" src="https://github.com/user-attachments/assets/5954078b-0de5-457f-9cdd-96c60bd04c21" /> ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> 三种最小假阳性边界场景对照: | 测试场景 | 修复前 | 修复后 | | ---- | ---- | ---- | | FAILED test_status.py::test_status - <br> AssertionError: assert 'PASSED' == 'FAILED'(预期通过) | ❌ 1.0(误判) | ✅ 0.0 | | 实际结果与预期结果均为空 | ❌ 1.0(误判) | ✅ 0.0 | | 存在空测试 ID(`""`) | ❌ 1.0(误判) | ✅ 0.0 | --------- Co-authored-by: Codex <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
为数据加载模块(stream dataloader)新增针对 Qwen 多模态模型的流水线选择性路由机制:图像/视频的高维像素张量(
pixel_values、pixel_values_videos)只发送给第一个流水线阶段(PP0),后面的阶段不再接收;但每层都需要的空间/时间网格元数据(image_grid_thw、video_grid_thw)依然全量广播。Why
在 Megatron 流水线并行(PP)下,Qwen VL 的视觉编码器(Vision Encoder / ViT)全部位于 PP0。
image_grid_thw),因为每一层的注意力机制都要靠它来计算 3D 旋转位置编码(M-RoPE)。因此,让像素数据“只进 PP0”,既能斩断冗余通信、省下显存,又能保证全链路位置编码计算完全正确。
How
only_pp0_consumes_pixels)。_broadcast_multimodal_inputs):is_pixel_tensor);is_pp0_only),则跳过跨 PP 阶段的 NCCL 广播;rank != 0)直接跳过数据解包与内存分配;Testing
pre-commit run --all-files全部通过pytest tests/utils/data/test_streaming_tq_iterator.py全部通过Type of Change(变更类型)