Repository navigation
Clean up 30-day stale branches and related PRs / 清理 30 天未更新的分支及关联 PR - #3939
functionstackx wants to merge 1 commit into
Conversation
准备清理 30 天未更新的分支及关联 PR,记录清理前后数量,并在删除前备份和核验 SHA。
|
Generally most InferenceX submissions don't need to add changes to the infx package. On the off chance they do, generally the diff is small. Please prompt your agent to clean your PR to keep your diff to only necessary & minimal changes too. We have an increased code quality bar for changes to the infx package. 中文大多数 InferenceX 提交通常不需要修改 infx 包。即使确实需要,改动通常也很小。请让你的 agent 清理 PR,使改动只包含必要且最小的内容。infx 包的改动有更高的代码质量要求。 |
|
Executed the approved 30-day, tip-commit-age cleanup without merging this PR.
Closing #3939 as completed; no merge is needed. 中文已执行获批的 30 天清理范围,以分支最新提交时间作为依据,未合并本 PR。固定清单中的 214 个分支有 2 个已在另一次清理中删除,本次删除了剩余 212 个,并确认关联的 30 个 PR 均已关闭,目标分支均已不存在。 执行前实时统计为 1,302 个分支、221 个未关闭 PR;清理后为 1,090 个分支、191 个未关闭 PR。关闭本清理 PR 后,在无并发变更的情况下,未关闭 PR 数为 190。完整历史恢复包已验证并分享到发起请求的 Slack 讨论中,文件名及 SHA-256 见上文。 本 PR 按已完成关闭,无需合并。 |
| finally: | ||
| after_branches = len(api_pages("branches?per_page=100")) | ||
| after_prs = len(api_pages("pulls?state=open&per_page=100")) | ||
| print(f"Actual after: {after_branches} branches; {after_prs} open PRs") |
There was a problem hiding this comment.
🟡 (optional) When --apply fails mid-run, the finally block (lines 155-158) unconditionally re-calls api_pages twice just to print 'Actual after' counts. If that diagnostic gh api call itself errors (rate limit, network blip), it replaces the real exception from archive_and_delete/close_related_prs, since raising inside a finally drops the exception that was propagating. The top-level handler at line 164 then reports the diagnostic call's stderr, not the actual cause of the failed branch deletion. Fix: isolate the after-count lookups in their own try/except that logs failures without superseding whatever exception was already propagating from the try block.
Why this was flagged
Trigger: inside main()'s try block (cleanup_stale_branches.py:150-154) archive_and_delete or close_related_prs raises (e.g. a force-with-lease rejection from the atomic push, or a RuntimeError such as 'Branches have unreviewed open pull requests' from preflight). While that exception is propagating, the finally block at lines 155-158 runs api_pages('branches?...') and api_pages('pulls?...') with no isolation; if either gh api call itself fails (rate limit, transient network error), Python replaces the original propagating exception with this new one. The only handler, line 162-165 (except subprocess.CalledProcessError as error: raise SystemExit(error.stderr) from error), then only sees the diagnostic call's error and prints its stderr. The operator running a destructive 214-branch/30-PR cleanup gets a misleading or unrelated failure message instead of the real reason the run stopped, and if the original was a RuntimeError it is caught by this handler too since the finally's new exception is the one that propagates.
Verification: The finally block (cleanup_stale_branches.py:155-158) unconditionally calls api_pages twice with no isolation. api_pages (line 28) -> run (line 17) uses subprocess.run(check=True), raising CalledProcessError on a failing gh api call. An exception raised in finally replaces the one propagating from the try body (lines 150-154). The handler at line 164 does raise SystemExit(error.stderr), printing the diagnostic call's stderr instead of the real failure.
| def close_related_prs(pulls: list[dict], candidates: set[str]) -> None: | ||
| for approved in pulls: | ||
| number = approved["number"] | ||
| current = api(f"pulls/{number}") | ||
| if current["state"] == "closed": | ||
| continue | ||
| # Do not close a PR that was retargeted after the reviewed snapshot. | ||
| if ( | ||
| current["head"]["ref"] != approved["head_ref"] | ||
| or current["head"]["sha"] != approved["head_sha"] | ||
| or current["base"]["ref"] != approved["base_ref"] | ||
| or ( | ||
| current["head"]["ref"] not in candidates | ||
| and current["base"]["ref"] not in candidates | ||
| ) | ||
| ): | ||
| raise RuntimeError(f"PR #{number} changed since review; inspect it before closing") | ||
| run("gh", "pr", "close", str(number), "--repo", REPOSITORY) | ||
| print(f"Closed PR #{number}") |
There was a problem hiding this comment.
🟡 (optional) Running --apply can close fewer of the 30 reviewed PRs than expected if just one changed since the snapshot. close_related_prs (cleanup_stale_branches.py:97-114) raises RuntimeError on the first PR whose head/base diverged from the plan (line 112) and aborts the whole loop, so every PR listed after it in plan['related_pull_requests'] is left open even though its branch was already deleted by archive_and_delete and would pass the same check. Fix: catch the mismatch per-PR, keep closing the rest, and report all mismatches together after the loop finishes instead of hard-stopping on the first one.
Why this was flagged
Trigger: one of the 30 related branches gets a new push, or its PR's base/head changes, between plan creation and --apply (plausible since staleness is a tip-commit-age proxy, per the doc's own caveat, not a push-recency guarantee). main() runs archive_and_delete first, which atomically deletes all 214 branches, including the one behind the changed PR. close_related_prs then iterates plan['related_pull_requests'] in file order (cleanup_stale_branches.py:97); on reaching that PR it raises at line 112 and the function returns immediately, so any PR appearing after it in the JSON list is never even checked, leaving it open though its branch is already gone. The only post-run signal is an aggregate branch/PR count in main()'s finally block, not which PRs were skipped.
Verification: nit, acknowledged in diff. Real and reachable. close_related_prs (cleanup_stale_branches.py:97-114) raises RuntimeError at line 112 on the first PR whose head/base diverges from the plan and aborts the loop, so PRs listed after it in plan['related_pull_requests'] stay open. Because main() (lines 150-154) runs archive_and_delete first — which deletes all 214 candidate branches atomically at line 92 — those later PRs are left open with their branches already gone.
- Update the image from rocm/atom-dev:nightly_202611101510 (ATOM e5b74bc86) to nightly_202612031117@sha256:ef8293cd19b40344b4e755f7b0934bb961c4ee8e844758b7de84a7ce5e8cf7b9 (ATOM 10e8c1ea6, AITER ed1163f82, Mooncake 206d6340, ROCm 7.2.4) in the master config, and the AToMesh frontend container_image from sha256:160a4ec49379e7f1980a4e783254366b1d5c643b012abca57a21c0bcbbfe83a7 to the same tag and digest. - Replace plain TP2 at concurrency [1, 2, 16, 32], DTP2 (DP attention) at 64, DEP2 (DP attention plus expert parallelism) at [128, 256] and plain TP4 at [1, 2, 4, 8, 32] with plain TP8 at [1, 2, 4], plain TP4 at [4, 8, 16, 32], DEP4 at 64 and DEP8 at [128, 256, 384, 512]. Every TP2, DTP2 and DEP2 point and TP4 c1 and c2 are dropped; TP8 c1, c2 and c4, TP4 c16, DEP4 c64 and DEP8 c128 to c512 are new. - TP8 c1 runs max-num-seqs 2, decode graphs [1, 2] and ATOM_PREFILL_DECODE_INTERVAL=1000000, and TP8 c2 and c4 run ATOM_PREFILL_DECODE_INTERVAL=192, the settings TP2 and TP4 used at those concurrencies. TP4 c4 (192) and c32 (16) are unchanged; TP4 c8 moves from the MXFP8 to a BF16 KV cache (interval 192), and the new TP4 c16 also runs a BF16 KV cache with interval 96. - DEP8 runs MegaMoE (moe-backend mega) with AITER_MEGA_SHARED_IN=1, adaptive prefill admission, 4 API servers, share_cache DP routing with lockstep placement (--dp-share-cache-lockstep), online EPLB without redundant experts (load window 200, rebalance interval 800, 4 layers per chunk), decode graphs 1 to 48 plus 56, 64, 72, 80, 96 and 128, ATOM_PREFILL_DECODE_INTERVAL=0, ATOM_DP_SESSION_AFFINITY=0, ATOM_DP_LB_REQ_EQUIV=512, ATOM_FRONTEND_PREFIX_HASH=1, ATOM_DP_LM_HEAD_MODE=off, ATOM_GRAPH_SIDE_STREAMS=0, GPU_MAX_HW_QUEUES=5 and MORI_SHMEM_HEAP_SIZE=16G. - DEP8 offloads KV to CPU DRAM (kv-offloading dram) through ATOM_KV_OFFLOAD=mooncake_store: a Mooncake master and two NUMA-bound 256 GiB Mooncake Store owners on rdma0-7 of the inference node, 1024 MiB load and 256 MiB save pools, OFFLOAD_MIN_LOAD_TOKENS and OFFLOAD_MIN_SAVE_TOKENS 512, OFFLOAD_MAX_PENDING_SAVES 8, one QP per endpoint, destination-device affinity, the memlock soft limit raised to the hard limit before the worker starts and a 3600 s health-check window. - DEP4 c64 runs the DEP8 settings on 4 GPUs with 2 API servers and two 128 GiB Store owners. The DP points no longer use least_tokens routing, session affinity or the X-Dynamo-Session-Id header from AIPerf. - Framework changes in the new ATOM that matter here: share_cache lockstep DP placement (ROCm/ATOM#3837, opt-in since #4074), adaptive prefill admission (#3647), the target shared expert handed to the MegaMoE routed call through AITER shared_in (#3894) with its MXFP8 input taken from the FFN seam (#3940), one-launch MegaMoE decode routing including the 48-expert layout (#3938) and route selection (#3187), EPLB on the pre-decoder layers and empty-window skip (#3186, #3952), the DSpark draft tail and DP-sharded draft argmax (#4104, #3939), ATOM_DP_LM_HEAD_MODE and the idle-rank LM head (#3353, #4025), and event-driven Store loads with a failed-save retry cap (#3772, #3781); AITER ed1163f82 (ROCm/aiter#9076) returns BF16 from the DSpark draft MegaMoE. - Draft data type unchanged: the DSpark draft (mtp.0-2 in the target checkpoint) runs as shipped at both images, with FP8 E4M3 32x32 UE8M0 block-scaled attention, shared-expert and main_proj weights run as MXFP8, MXFP4 routed experts with MXFP8 activations (a8w4, through MegaMoE at DEP4 and DEP8), and BF16 gate, norms and the shared LM head. The draft attends in BF16 over the target's KV pool, which is MXFP8 except at TP4 c8 and c16 (BF16). - 镜像从 rocm/atom-dev:nightly_202611101510(ATOM e5b74bc86)更新为 nightly_202612031117@sha256:ef8293cd19b40344b4e755f7b0934bb961c4ee8e844758b7de84a7ce5e8cf7b9(ATOM 10e8c1ea6、AITER ed1163f82、Mooncake 206d6340、ROCm 7.2.4),用于 master 配置;AToMesh 前端 container_image 从 sha256:160a4ec49379e7f1980a4e783254366b1d5c643b012abca57a21c0bcbbfe83a7 改为同一标签和 digest。 - 用 TP8 [1, 2, 4]、TP4 [4, 8, 16, 32]、DEP4 64 和 DEP8 [128, 256, 384, 512] 替换 TP2 [1, 2, 16, 32]、DTP2(DP attention)64、DEP2(DP attention 加专家并行)[128, 256] 和 TP4 [1, 2, 4, 8, 32]。所有 TP2、DTP2、DEP2 点以及 TP4 c1、c2 被移除;TP8 c1、c2、c4,TP4 c16,DEP4 c64 和 DEP8 c128 到 c512 为新增。 - TP8 c1 使用 max-num-seqs 2、decode 图 [1, 2] 和 ATOM_PREFILL_DECODE_INTERVAL=1000000,TP8 c2、c4 使用 ATOM_PREFILL_DECODE_INTERVAL=192,即 TP2 和 TP4 在这些并发下原来的设置。TP4 c4(192)和 c32(16)不变;TP4 c8 的 KV cache 从 MXFP8 改为 BF16(interval 192),新增的 TP4 c16 同样使用 BF16 KV cache,interval 96。 - DEP8 使用 MegaMoE(moe-backend mega)并设置 AITER_MEGA_SHARED_IN=1,自适应 prefill 准入,4 个 API server,带 lockstep 放置的 share_cache DP 路由(--dp-share-cache-lockstep),无冗余专家的在线 EPLB(load window 200、rebalance interval 800、每块 4 层),decode 图 1 到 48 加 56、64、72、80、96、128,ATOM_PREFILL_DECODE_INTERVAL=0、ATOM_DP_SESSION_AFFINITY=0、ATOM_DP_LB_REQ_EQUIV=512、ATOM_FRONTEND_PREFIX_HASH=1、ATOM_DP_LM_HEAD_MODE=off、ATOM_GRAPH_SIDE_STREAMS=0、GPU_MAX_HW_QUEUES=5 和 MORI_SHMEM_HEAP_SIZE=16G。 - DEP8 通过 ATOM_KV_OFFLOAD=mooncake_store 将 KV 卸载到 CPU DRAM(kv-offloading dram):推理节点上一个 Mooncake master 和两个绑定 NUMA 的 256 GiB Mooncake Store owner(rdma0-7),1024 MiB 加载池和 256 MiB 保存池,OFFLOAD_MIN_LOAD_TOKENS 和 OFFLOAD_MIN_SAVE_TOKENS 为 512,OFFLOAD_MAX_PENDING_SAVES 为 8,每个端点一个 QP,目标设备亲和,worker 启动前把 memlock 软限制提升到硬限制,健康检查窗口 3600 秒。 - DEP4 c64 在 4 张 GPU 上使用 DEP8 的设置,2 个 API server 和两个 128 GiB Store owner。DP 点不再使用 least_tokens 路由、会话亲和性或 AIPerf 的 X-Dynamo-Session-Id 头。 - 新 ATOM 中与本模型相关的框架变化:share_cache lockstep DP 放置(ROCm/ATOM#3837,自 #4074 起需显式开启)、自适应 prefill 准入(#3647)、目标层共享专家经 AITER shared_in 交给 MegaMoE 路由调用(#3894),其 MXFP8 输入取自 FFN 接缝(#3940)、单次启动的 MegaMoE decode 路由(含 48 专家布局,#3938)和路由选择(#3187)、decoder 之前层的 EPLB 和空窗口跳过(#3186、#3952)、DSpark draft 尾部与 DP 分片 draft argmax(#4104、#3939)、ATOM_DP_LM_HEAD_MODE 与空闲 rank 的 LM head(#3353、#4025)、事件驱动的 Store 加载和失败保存重试上限(#3772、#3781);AITER ed1163f82(ROCm/aiter#9076)使 DSpark draft MegaMoE 返回 BF16。 - Draft 数据类型不变:DSpark draft(目标 checkpoint 中的 mtp.0-2)在新旧镜像上都按发布精度运行,FP8 E4M3 32x32 UE8M0 块缩放的 attention、共享专家和 main_proj 权重以 MXFP8 运行,MXFP4 路由专家配 MXFP8 激活(a8w4,DEP4 和 DEP8 经 MegaMoE),BF16 的 gate、norm 和共享 LM head。draft 在目标的 KV 池上以 BF16 做 attention,该 KV 池除 TP4 c8 和 c16(BF16)外均为 MXFP8。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Prepare a one-time cleanup of branches whose tip commits predate September 12, 2026, 00:00 America/New_York, 30 days before the audit date.
All 1,304 repository branches were checked. There are 214 candidates:
The PR includes the full review inventory and a fixed SHA manifest. None of the candidates is protected or the default branch. The manual cleanup command creates and verifies a full recovery bundle before deleting anything. It rechecks protection, open PRs, cutoff, and exact SHAs, then uses an atomic push with explicit SHA leases. Some branches contain commits absent from
main; the archive is mandatory.Merging does not delete branches or close PRs. Review the fixed list and run the documented
--apply --backup ...command separately after approval. That action deletes all 214 candidate branches and closes their 30 related open PRs without merging their changes. No scheduled workflow or merge hook is added. PR closure is not atomic with branch deletion; failures require inspecting remaining PRs.The new cleanup PR and branch add one each while open/present. These are projected counts, not completed actions; concurrent activity can change totals. The command reads live before counts and prints actual after counts on execution, including on partial failure.
Timestamp limitation: GitHub returned null push timestamps. Tip commit age is a proxy, not proof that a branch has not been created or repointed recently. Approve this proxy explicitly or verify audit records before deletion. PR/protection metadata checks are not transactional with Git ref deletion.
See the runbook for execution and recovery, and the inventory for all branch names, exact SHAs, dates, and open PRs.
Validation
The live GitHub dry run checked the full selection without changing remote refs or PRs. A local Git integration exercise deleted fixture branches and recovered their original SHAs and file contents from the bundle; a concurrent branch update caused the entire atomic deletion to fail without deleting either branch.
AI model disclosure
PR checklist and change type
Type of Change
Checklist
inferencex-e2e/perf-changelog.yamland have not edited historical entries. N/A: no benchmark or recipe changes.full-sweep-fail-fast(recommended),full-sweep-enabled, ornon-canary-full-sweep-enabled. Optional modifiersall-evals,evals-only, andagentx-fastrequire a primary label; the last two block reuse while applied. N/A: no benchmark or recipe changes.OWNER/MEMBER/COLLABORATOR) has commented/use <run_id>(or the legacy/reuse-sweep-run) on this PR. Do this only once there is a final full sweep that is all green with evals passing, since after this comment the primary sweep label will no longer automatically kick off new sweeps. Remove and re-add the primary sweep label to force a new sweep. N/A: no benchmark sweep.中文
本 PR 为一次性分支清理准备了手动执行命令。审计覆盖仓库的全部 1,304 个分支,截止时间为纽约时间 2026 年 9 月 12 日零点,即审计日期前 30 天。共有 214 个候选分支:184 个在审计时没有关联未关闭的 PR,另外 30 个关联的未关闭 PR 也会按要求关闭,不会合并其改动。候选列表不包含默认分支或受保护分支。
部分分支包含尚未合入
main的提交。因此,命令先创建并验证完整的 Git 恢复包,再次检查分支保护、未关闭 PR 和准确 SHA,最后通过带 SHA 租约的原子推送删除分支。任一分支发生变化都会阻止整批删除。完整清单记录了全部候选分支的名称、SHA、提交日期及关联 PR。合并本 PR 不会删除分支或关闭 PR,也不会添加定时任务或合并钩子。须单独批准候选列表及 PR 关闭操作,并执行文档中的
--apply --backup ...命令。PR 关闭与分支删除不是原子操作;失败时须检查剩余 PR。本清理 PR 及其分支创建之前的统计为:1,304 个分支、221 个未关闭 PR。预计分别减少 214 和 30,剩余 1,090 个分支、191 个未关闭 PR。这些是预计值,尚未执行;本清理 PR 及其分支存在时各增加一个,并发操作也可能影响数量。命令会读取执行前的实时数量,并在执行后输出实际数量,包括部分失败的情况。
GitHub 未返回推送时间。最新提交时间仅作为不活跃程度的近似依据,不能证明分支最近未被创建或重新指向旧提交。执行删除前,须明确接受这一依据,或先核查审计记录。PR 和分支保护状态的检查与 Git 删除操作不是同一事务。
已通过真实 GitHub 只读预演确认候选列表;本地 Git 集成验证了删除、从恢复包恢复 SHA 和文件内容,以及并发更新时整批拒绝删除的行为。本 PR 不修改基准测试或配置,无需性能变更记录或 GPU sweep。
AI 模型:GPT-6 Astra Ultrafast,负责分支审计、实现、测试、文档和 PR 准备。