Repository navigation
CollectiveX: trim dead code, tests and stale docs before the hand rerun / CollectiveX:在手动重跑前清理无用代码、测试与过时文档 - #4114
Conversation
Removes shell code that the CI sweep's removal (#4054) left unreachable or unread. Nothing that runs changes: no command line, Slurm flag, env export, retry or staging step is touched. - collx_load_operator_config: drop the early return for a "host-utility step (no SKU)". Its only caller is collx_launcher_prologue, and every launcher exits on an unknown SKU before calling it, so COLLX_RUNNER is never empty there. - Launchers: stop passing "$RUNNER" to collx_launcher_prologue, which never reads its arguments. The only consumer was the CI-only collx_prepare_stage_dir, removed in #4054. - launch_single-slurm.sh: drop PRODUCT. Nothing reads it, here or in the runtime it sources, and it is not exported; with the file-wide SC2034 disable lifted, shellcheck -x reports it as the only unused variable in the three launchers. - Drop comment text that still described the sweep workflow and Actions. Checked: bash -n on every touched script; the unit tests are unchanged (264 run, 14 skipped); shellcheck reports no new findings; and HEAD's and this collx_load_operator_config export the same variables for all nine SKUs when no operator document exists. 中文: 移除 CI sweep 删除(#4054)后遗留的、不可达或无人读取的 shell 代码。 实际执行的内容均未改变:没有触及任何命令行、Slurm 参数、环境变量导出、 重试或暂存步骤。 - collx_load_operator_config:删除针对"host-utility step(无 SKU)"的 提前返回。它唯一的调用者是 collx_launcher_prologue,而每个 launcher 在调用它之前都会因未知 SKU 退出,因此此处 COLLX_RUNNER 永远非空。 - Launchers:不再向从不读取参数的 collx_launcher_prologue 传递 "$RUNNER"。唯一的使用者是仅用于 CI 的 collx_prepare_stage_dir, 已在 #4054 中删除。 - launch_single-slurm.sh:删除 PRODUCT。无论是此文件还是它 source 的 runtime 都不读取它,它也未被导出;解除文件级 SC2034 禁用后, shellcheck -x 报告它是三个 launcher 中唯一未使用的变量。 - 删除仍在描述 sweep workflow 和 Actions 的注释文字。 验证:所有改动的脚本通过 bash -n;单元测试结果不变(运行 264 个, 跳过 14 个);shellcheck 没有新增告警;在不存在 operator 文档时, HEAD 与本次修改后的 collx_load_operator_config 为全部九个 SKU 导出相同的变量。
Remove code that nothing reaches and comments that describe removed mechanisms or old row generations. No backend runs, measures or publishes anything differently. Code: - EagerTiming.missed_samples only called super(); the base method serves both timing regimes. - EPBackend no longer stores local_rank, which nothing reads. The constructor keeps the argument. - routing.decode_source_ids drops its unused seed parameter, and its one caller (ep_oracle) is updated. - MoRIBackend.stage loses a trailing `return None`. - runtime/stage.py: SPECS entries carried an optional nargs slot that no subcommand used. The slot, the conditional that read it, and a default that never applies to a required positional are gone. Parsing, errors and help output are unchanged. Comments: drop the history of earlier kernel_generation series (nccl-ep, uccl-ep, deepep-v2, the legacy LL suffixes, the harness alignment suffix), references to the deleted CI sweep, the durable store and operator secrets, pointers to the removed StageContract and DeepEP pin-drift tests, and a duplicate of the _MODE_SLUG comment at its use site. The ten comment-only files have identical docstring-stripped ASTs. Unit tests: 264 run, OK, 14 skipped, before and after. 中文: 删除没有任何代码路径会执行到的代码,以及描述已移除机制或旧数据行世代的注释。 任何后端运行、测量或发布的内容均不改变。 代码: - EagerTiming.missed_samples 只调用 super();两种计时模式都直接使用基类方法。 - EPBackend 不再保存没有任何代码读取的 local_rank。构造函数仍保留该参数。 - routing.decode_source_ids 删除未使用的 seed 参数,并同步更新其唯一调用方 (ep_oracle)。 - 删除 MoRIBackend.stage 末尾多余的 `return None`。 - runtime/stage.py:SPECS 条目中可选的 nargs 位从未被任何子命令使用。删除该位、 读取它的条件分支,以及对必填位置参数永远不会生效的默认值。参数解析、报错和 帮助输出均不变。 注释:删除早期 kernel_generation 系列的历史说明(nccl-ep、uccl-ep、deepep-v2、 legacy LL 后缀以及 harness 的对齐后缀),对已删除的 CI sweep、持久化存储和 operator 密钥的引用,指向已删除的 StageContract 测试和 DeepEP 版本漂移测试的 说明,以及 _MODE_SLUG 注释在使用处的重复副本。 十个仅改动注释的文件在去除 docstring 后 AST 完全相同。单元测试前后一致: 运行 264 个,通过,跳过 14 个。
Apply AGENTS.md's test-quality rules to collectivex/tests: delete tests that
inspect code or pin checked-in config instead of exercising behavior, merge
tests that reach the same branch, and remove dead fakes. 264 tests become 243
with no loss of behavioral coverage.
- Config and constant pins: runner labels, the flashinfer and nccl-ep matrix
SKU and precision sets, run_ep backend names, _FP8_BLOCK, ll_recv_hook, the
class-level kernel_generation, and the UCCL build flags and cache generation.
- Introspection and test-infrastructure checks: fake signatures, CPython
byref, setUp and premise self-checks, import smoke.
- Reimplementations: DeepEP scale and epilogue reference specs, an in-test
dequant copy (now a plumbing check on the real receive path), and probe
marker regexes copied from common.sh (now exact output lines).
- Tautologies: the base implementation_details() == {}, the reloaded
fp8_consume default, and a bandwidth expectation derived from the
implementation (now 375 GB/s worked by hand).
- Duplicates folded into one test or a subTest table: alignment rows, chain
host counts, runner filtering, chain output verdicts, budget gates,
prepare_cache, mode and precision validation, nccl reduction selection,
deepep-v2 capacity rounding, and nccl tests the contract file covers.
The clamped-ladder test now clamps a ladder and asserts the recorded values;
swap and codec tests use controlled platforms and profiles; two torch-free
checks no longer skip without torch; fakes lose the members a trace of the
suite never reached.
中文:
按 AGENTS.md 的测试质量规则清理 collectivex/tests:删除检查代码或固定已提交配置、
而非运行实际行为的测试,合并到达同一分支的测试,并移除无用的测试替身。测试数从
264 个减为 243 个,对真实行为的覆盖没有减少。
- 固定配置与常量:runner 标签、flashinfer 与 nccl-ep 矩阵的 SKU 与精度集合、
run_ep 的后端名称、_FP8_BLOCK、ll_recv_hook、类级 kernel_generation,以及 UCCL
的构建标志和缓存代号。
- 自省与测试基础设施检查:假对象的签名、CPython 的 byref、setUp 与前提自检、
导入冒烟测试。
- 重新实现被测代码:DeepEP 的缩放与收尾参考实现、测试内的反量化副本(改为检查
真实接收路径的衔接),以及从 common.sh 复制的探针标记正则(改为断言精确的输出行)。
- 同义反复:基类 implementation_details() == {}、重新加载后的 fp8_consume 默认值,
以及由实现推导出的带宽期望值(改为手算的 375 GB/s)。
- 合并为单个测试或 subTest 表的重复测试:对齐行、链路的主机计数、runner 过滤、
链路输出判定、预算门限、prepare_cache、模式与精度校验、nccl 归约选择、deepep-v2
容量取整,以及契约文件已覆盖的 nccl 测试。
截断 ladder 的测试现在真正截断一个 ladder,并断言记录下的值;swap 与编解码测试改用
受控的平台与配置;两个不依赖 torch 的检查在没有 torch 时不再被跳过;测试替身中删除了
追踪整个测试套件时从未执行到的成员。
Bring README.md and docs/{methodology,methodology-summary,nccl-ep,swap-blocks}.md in line with
the code on main after the hand-run switch (#4054) and the GPU-clock, timing-window and
engine-contract merges (#4100, #4101, #4105). Every published row will be re-measured from main,
so notes that only told older row generations apart are removed; the evidence behind each
current rule stays.
- README holds usage and the coverage tables: what runs where per backend and mode, the
cases.json counts (195 requested, 181 runnable, 14 unsupported), the variables that change a
row without changing its case_id, the operator document format, and which pools need a stage
directory (h100-dgxc, b300, gb300 and the AMD pools).
- methodology.md drops the store-generation discriminators, the skip-version-2 rule, the old
kernel_generation names, the -cudagraph-in-graph-ar and unaligned eager families, the
chain_regime_passed rename and the legacy-schema note. Per-backend evidence, including the
README's DeepEP V2 pin, EFA and MoRI heap notes, moves into one Backends section, and a
kernel_generation table lists the current families.
- Stale statements fixed: the bash -n check only read its first file; uccl-ep and MoRI
low-latency also stop at 256 tokens; three host-gate limits were two; the default-route
socket fallback contradicted Execution Isolation and now lists h100-dgxc; stage_dir
permissions are not checked; no image-provided DeepEP path exists; DeepEP V2 low-latency on
B300 is absent from the matrix, not an unsupported row; the MI300X/MI325X EP16 reason no
longer names the retired tw pools; the MoRI heap guard covers scale-out only; GB/s is derived
by bandwidth.py, not emitted; graphed FP8 rows report stage unavailable; the registry network
block wins over an operator document.
- operatorx/CI.md no longer says CollectiveX stages b300 in the passwd home, and shared/README
no longer says CollectiveX depends on inferencex-e2e helpers.
- From review: a hand run outside the account that owns the registry squash_dir needs its own
squash_dir or storage_roots (the README example now uses storage_roots); nccl-ep.md explains
-static; Execution Isolation says every shard clears inherited selectors, documents
single_node_rdma_devices and DeepEP's EP_OVERRIDE_RDMA_SL; UCCL-EP's FP8 is e4m3fnuz on gfx942;
the MoRI SDMA citation now says the FP4 recipes set it on prefill roles only, and the recipes'
AUTO launch mode is noted; the FP8 per-call charge is credited to the measured graph cell only;
imports are once per node where squash dirs are node-local; the unsupported 2-6% drift figure
is gone; bandwidth.py's comment no longer says graphed rows publish p50 only.
中文:
在改为手动运行(#4054)以及合并 GPU 时钟、计时窗口和引擎约定(#4100、#4101、#4105)之后,使
README.md 和 docs/{methodology,methodology-summary,nccl-ep,swap-blocks}.md 与 main 上的代码一致。
所有公开的结果行都会基于 main 重新测量,因此只用于区分旧版结果行的说明被删除;每条现行规则背后的
证据予以保留。
- README 只保留用法和覆盖表:每个后端在各模式下的运行范围、cases.json 的数量(共 195 个请求、
181 个可运行、14 个不支持)、会改变结果行但不改变 case_id 的环境变量、operator 文档格式,以及
哪些资源池需要 stage 目录(h100-dgxc、b300、gb300 和 AMD 资源池)。
- methodology.md 删除了存储代际区分字段、跳过版本 2 的规则、旧的 kernel_generation 名称、
-cudagraph-in-graph-ar 与未对齐的 eager 系列、chain_regime_passed 改名记录以及旧 schema 说明。
各后端的证据(包括 README 中 DeepEP V2 的版本固定、EFA 和 MoRI 堆模式说明)集中到新的 Backends
一节,并新增一张列出当前 kernel_generation 系列的表。
- 修正的过时说法:bash -n 检查只读取第一个文件;uccl-ep 和 MoRI 的低延迟模式同样止于 256 个
token;主机门控的局限是两条而不是三条;默认路由的 socket 回退与 Execution Isolation 的描述
矛盾,现已补上 h100-dgxc;stage_dir 的权限并不会被检查;不存在使用镜像自带 DeepEP 的路径;
B300 上的 DeepEP V2 低延迟行不在矩阵中,而不是不支持行;MI300X/MI325X 的 EP16 原因不再引用已
下线的 tw 资源池;MoRI 的堆模式保护只针对 scale-out;GB/s 由 bandwidth.py 推导而非结果中直接
给出;graph 化的 FP8 行将 stage 报告为不可用;注册表的 network 块优先于 operator 文档。
- operatorx/CI.md 不再声称 CollectiveX 将 b300 的 stage 放在 passwd 主目录中,shared/README 不再
声称 CollectiveX 依赖 inferencex-e2e 的辅助代码。
- 根据评审修正:以非 registry squash_dir 所属账户手动运行时,需要自己的 squash_dir 或
storage_roots(README 示例改用 storage_roots);nccl-ep.md 解释 -static;Execution Isolation
说明每个分片都会清除继承的选择器,并记录 single_node_rdma_devices 与 DeepEP 的
EP_OVERRIDE_RDMA_SL;UCCL-EP 的 FP8 在 gfx942 上为 e4m3fnuz;MoRI SDMA 的引用改为说明 FP4 配方
只在 prefill 角色上开启它,并注明配方使用 AUTO 启动模式;FP8 每次调用开销只归于实测的 graph
用例;squash 目录为节点本地时按节点导入镜像;删除无依据的 2-6% 漂移数字;bandwidth.py 的注释
不再声称 graph 行只公开 p50。
There was a problem hiding this comment.
Looks good — this is a careful, well-scoped cleanup pass with no behavioral changes.
Extended reasoning...
Spot-checked the shell trims (confirmed collx_launcher_prologue never read its $RUNNER arg, and the removed collx_load_operator_config no-SKU branch is unreachable since every launcher sets COLLX_RUNNER before calling it), the Python removals (decode_source_ids' dropped seed param and stage.py's dropped nargs slot have no remaining callers/behavior change), and a sample of the heavily-rewritten test suite (e.g. the deleted NcclLowLatencyLadderSizing tests in test_backends.py, which built backends via hand-stubbed init, are superseded by more faithful full-construction coverage already in test_nccl_ep_contract.py, including the "-gum1" kernel_generation branch). The three cross-project doc edits (operatorx/CI.md, shared/README*.md) accurately drop a stale CollectiveX reference, confirmed by grep showing collectivex/ no longer imports anything from inferencex-e2e. No security-sensitive surface (auth, crypto, injection) is touched; this is internal benchmark tooling, docs, and tests.
Summary
Before the hand rerun, this removes code, tests and doc text that #4054 (hand runs) and #4100, #4101 and #4105 (clocks, timing windows, engine contracts) left dead or stale. Nothing a backend runs, measures or publishes changes.
Shell (−6 lines):
collx_load_operator_config;$RUNNERargument tocollx_launcher_prologue;PRODUCTvariable;Python (−31 lines):
EagerTiming.missed_samples, which only calledsuper();EPBackend.local_rank, which nothing read;seedparameter ofrouting.decode_source_ids;nargsslot inruntime/stage.py's parser (parsing and errors are unchanged);bandwidth.py's comment no longer claims graphed rows publish p50 only.Tests (264 → 243 tests, −436 lines):
Docs (about 3,700 fewer words):
methodology.md(new Backends, Precision and Rank Alignment sections).Review
stage.pyparses the four commandscommon.shsends exactly as before.squash_dir's owner needs its ownsquash_dirorstorage_roots. The README example now usesstorage_roots.-staticis explained.single_node_rdma_devices.cases.jsonregenerates byte-identical.bash -npasses on every script.Kept on purpose
GITHUB_*andCOLLX_ATTEMPT_IDreads inrun_ep.py,run_swap_blocks.pyandep_harness.py. Nothing sets them on hand runs, but they feed published result fields, which are null today. Removing them would change the result schema.staged_image_dir, which still points at the retired pool's storage. The launcher logs "not staged" and imports normally. Changing that entry would also move h100's swap image off v0.27.1.AI model disclosure
claude-opus-5-5, run through Claude Code): integration, review of each commit, the review fixes and this description.claude-opus-5-5): the shell, Python, test and docs trim passes, and the docs reviewer.中文
摘要
在手动重跑之前,本 PR 删除 #4054(改为手动运行)以及 #4100、#4101、#4105(时钟、计时窗口、引擎约定)之后遗留的无用或过时的代码、测试和文档。任何后端的运行、测量和发布内容均不改变。
Shell(−6 行):
collx_load_operator_config中不可达的无 SKU 分支;collx_launcher_prologue从不读取的$RUNNER参数;PRODUCT变量;Python(−31 行):
super()的EagerTiming.missed_samples;EPBackend.local_rank;routing.decode_source_ids未使用的seed参数;runtime/stage.py解析器中未使用的nargs位(解析结果和报错不变);bandwidth.py的注释不再声称 graph 行只公开 p50。测试(264 → 243 个,−436 行):
文档(约少 3,700 词):
methodology.md(新增 Backends、Precision 和 Rank Alignment 小节)。评审
stage.py对common.sh发送的四个命令的解析结果与之前完全相同。squash_dir所属账户运行时,需要自己的squash_dir或storage_roots,README 示例改用storage_roots。-static。single_node_rdma_devices。cases.json重新生成后逐字节一致。bash -n。有意保留
run_ep.py、run_swap_blocks.py和ep_harness.py中读取的GITHUB_*和COLLX_ATTEMPT_ID。 手动运行时没有任何地方设置它们,但它们会写入公开的结果字段(目前为 null),删除会改变结果 schema。staged_image_dir,它仍指向已下线资源池的存储。launcher 会记录 "not staged" 并正常导入镜像。修改该条目还会让 h100 的 swap 镜像不再是 v0.27.1。