[chore] 建立 CPU CI:ruff gate + 全量测试 + coverage PR 评论 - #38
Merged
Merged
Conversation
GitHub 无可用 NPU/GPU runner,CI 只做 CPU 能覆盖的部分;NPU/GPU/verl080-e2e 测试靠 importorskip 自动跳过,由公司内 NPU 机在发版前手动跑。 - .github/workflows/ci.yml:push/PR/workflow_dispatch 触发,ubuntu + py3.9 + torch-CPU - ruff gate(F,E9 真 bug),format 仅 advisory - pytest tests/ 全量(importorskip 自动筛环境) - coverage 进 job summary + PR 评论(聚焦本次改动文件,单评论更新) - import smoke:prefix_sharing 与 setup.install 可导入 - pyproject.toml:[tool.ruff] select F,E9;[tool.coverage] omit tools/patches (核心覆盖率 75%,不被 0% 的 tools/patches 拖到误导性 34%) - requirements-ci.txt + .pre-commit-config.yaml(commit 前 ruff --fix) - .gitignore:补 coverage 产物 顺带修掉 F,E9 暴露的 27 个问题: - verl_mcore.py:restore_via_2d_unfold_verl080 里死变量 device(F841) - 26 个:F401 未用 import / F541 空 f-string(ruff --fix) (注:megatron_runtime.py 的 prefix_log 潜伏 NameError 已由 #37 一并清理) 本地验证:209 passed / 29 skipped,ruff F,E9 clean,核心 coverage 75%。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Jackie2049
force-pushed
the
ci/cpu-pipeline
branch
from
June 27, 2026 15:28
fb9670f to
d20692d
Compare
📊 Coverage reportChanged files in this PR |
boundless-future
approved these changes
Jun 27, 2026
Jackie2049
added a commit
that referenced
this pull request
Jun 28, 2026
- 合并 origin/main 的 CPU CI 工作流(.github/workflows/ci.yml) - 解决 verl_mcore.py import 冲突,保留 Iterator / ensure_global_packed_token_lengths / PatchHandle - 同步 requirements-ci.txt、pyproject.toml ruff/coverage 配置、.pre-commit-config.yaml - 本地验证:209 passed / 29 skipped,ruff F,E9 clean,核心 coverage 75% Co-authored-by: Cursor <cursoragent@cursor.com>
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.
目的
建立一套面向 CPU 的 CI 维护机制(无 GPU/NPU runner 可用前提下的最大化自动化)。详见 verl070 release vs verl080 切换 与本次讨论结论。
CI 跑什么(
.github/workflows/ci.yml)每次 push/PR 触发,ubuntu + py3.9 + torch-CPU:
F,E9:pyflakes + 语法错误,真 bug)pytest tests/全量——靠importorskip自动筛环境:本地 208 passed / 29 skipped(NPU/GPU/verl080-e2e 自动跳过,等公司内 NPU 机手动跑)prefix_sharing与setup.install可导入配置
pyproject.toml:[tool.ruff] select F,E9;[tool.coverage] omit tools/patches(核心覆盖率 75%,不再被 0% 的 tools/patches 拖到误导性的 34%)requirements-ci.txt+.pre-commit-config.yaml(commit 前ruff --fix)顺带修掉 F,E9 暴露的 29 个问题(让 gate 干净)
megatron_runtime.py的prefix_log全仓库从未定义(潜伏 NameError,diag dump 失败时触发)→ 改用 module logger;verl_mcore.py死变量deviceruff --fix)清理 main 既有的坏测试(CI 必须 green on main)
#35 重构后遗留:
test_logprob_extended.py(import 已删除的core/logprob.py,collection error)test_runtime_context.py链式解析用例标xfail([fix] 2D恢复中 logprob/entropy restore 改为区间拼接 #37 会整体重写该文件)范围之外(明确不做)
ruff format强制 + 全规则 gate:代码从未被 lint(全规则 ~2700 个),先 F,E9,逐步收紧测试结果
本地(py3.9 + torch-CPU,无 verl/GPU/NPU):
208 passed / 29 skipped / 1 xfailed