Repository navigation
CollectiveX: run sweeps through the CI priority queue / CollectiveX:通过 CI 优先级队列运行 sweep - #4650
Conversation
…过 CI 优先级队列运行 sweep
| # Pools without a tracked stage directory stage on the compute-visible storage OperatorX uses. | ||
| default_config="${XDG_CONFIG_HOME:-$HOME/.config}/inferencex/collectivex.json" | ||
| case "$CX_SHARD_SKU" in | ||
| mi300x|mi325x|mi355x) stage="${RUNNER_TEMP%/_temp}/collectivex-stage" ;; | ||
| b300|h100-dgxc) stage="$HOME/collectivex/stage" ;; | ||
| gb300) stage="$(dirname "$(jq -r '.platforms.gb300.operator.squash_dir' collectivex/configs/platform_config.json)")/stage" ;; | ||
| *) stage= ;; | ||
| esac | ||
| if [ -n "$stage" ] && [ ! -e "$default_config" ]; then | ||
| mkdir -p "$stage" | ||
| export COLLECTIVEX_OPERATOR_CONFIG="$RUNNER_TEMP/collectivex-operator.json" | ||
| jq -n --arg sku "$CX_SHARD_SKU" --arg stage "$stage" \ | ||
| '{runners: {($sku): {stage_dir: $stage}}}' > "$COLLECTIVEX_OPERATOR_CONFIG" | ||
| fi |
There was a problem hiding this comment.
🔴 A runner whose service environment sets COLLECTIVEX_OPERATOR_CONFIG has its operator document silently replaced by a stage-only one. The workflow checks only the XDG/HOME default path. common.sh:137 gives COLLECTIVEX_OPERATOR_CONFIG first precedence. When the default file is absent, the step still exports a new value over the operator's. The runner's partition, account, squash_dir and exclude_nodes overrides are then lost. Fix: resolve the path exactly as common.sh:137 does, with the env var first, and generate the document only when no operator config exists under that resolution.
Why this was flagged
The trigger is a self-hosted runner whose environment (for example the runner .env or service unit) sets COLLECTIVEX_OPERATOR_CONFIG to a private document, and that has no ~/.config/inferencex/collectivex.json. A repo-wide grep finds no setter in this checkout, so that population cannot be ruled out. collectivex-sweep.yml:123 computes default_config from XDG_CONFIG_HOME/HOME only. When that file is absent, line 133 exports COLLECTIVEX_OPERATOR_CONFIG="$RUNNER_TEMP/collectivex-operator.json" holding only {runners: {<sku>: {stage_dir}}}. collx_load_operator_config (common.sh:137) reads ${COLLECTIVEX_OPERATOR_CONFIG:-...} first, so it now loads the generated document, and config.py operator_config merges only stage_dir over the registry baseline. The operator's own fields are dropped without any warning: account, qos, squash_dir, exclude_nodes, nodelist and lock_dir. The shard then runs on registry defaults. A hand run of run.sh on the same runner honors the operator's document. The README documents the env var as the first-choice location.
Verification: The Run shard step in collectivex-sweep.yml checks only default_config and, if it is absent, exports a stage-only COLLECTIVEX_OPERATOR_CONFIG. That unconditionally replaces any inherited COLLECTIVEX_OPERATOR_CONFIG. The runtime gives the env var first precedence (collectivex/runtime/common.sh:137). So the operator's partition, account and squash_dir fields are silently dropped.
| case "$CX_SHARD_SKU" in | ||
| mi300x|mi325x|mi355x) stage="${RUNNER_TEMP%/_temp}/collectivex-stage" ;; | ||
| b300|h100-dgxc) stage="$HOME/collectivex/stage" ;; | ||
| gb300) stage="$(dirname "$(jq -r '.platforms.gb300.operator.squash_dir' collectivex/configs/platform_config.json)")/stage" ;; | ||
| *) stage= ;; | ||
| esac |
There was a problem hiding this comment.
🟡 (optional) Stage-directory paths for each pool are hardcoded in a workflow case on SKU, so CI runs and hand runs get different storage for the same pool. This breaks the AGENTS.md rule that cluster facts belong in the cluster record and drivers never branch on a cluster id. The registry already accepts stage_dir in each pool's operator block, and config.py operator_config reads it as the baseline. Fix: move the stage paths into operator.stage_dir (or storage_roots) in configs/platform_config.json and delete the case and the generated operator document. Static paths fit b300, h100-dgxc and gb300; mi300x, mi325x and mi355x need a static path in place of the one derived from RUNNER_TEMP.
Why this was flagged
In the Run shard step, collectivex-sweep.yml:125-130 picks a stage directory with case "$CX_SHARD_SKU". mi300x, mi325x and mi355x get ${RUNNER_TEMP%/_temp}/collectivex-stage. b300 and h100-dgxc get $HOME/collectivex/stage. gb300 gets the parent of .platforms.gb300.operator.squash_dir plus /stage. The workflow then writes a temporary {runners: {<sku>: {stage_dir}}} document. AGENTS.md:96 says cluster facts go in the cluster's record and drivers never branch on a cluster id. collectivex/runtime/config.py:88-97 already treats the registry's per-SKU operator block, which allows stage_dir and storage_roots, as the baseline. So the storage fact could live in platform_config.json beside squash_dir. As written it lives only in the workflow. A hand run per the README's 'Running By Hand' path, with no operator document, gets no stage_dir on these pools. A CI run gets one. Adding a pool also means editing a SKU list in the workflow as well as the registry.
Verification: Trigger: any dispatched shard for mi300x/mi325x/mi355x/b300/h100-dgxc/gb300 when the runner user has no ~/.config/inferencex/collectivex.json. In .github/workflows/collectivex-sweep.yml, the Run shard step branches on the SKU. None of the pools in platform_config.json has a stage_dir. That means CI and hand runs use different storage for the same pool.
Bring in #4524, #4648, #4650 and #4652. perf-changelog.yaml keeps main's MiniMax-M3.1-Flash B300 entry ahead of the #2916 and #4243 video entries; nvidia-master.yaml and MODELS.md merged cleanly. The sweep on 74bb681 (run 40873178356) stays the proof for this PR, so PR benchmark setup is skipped. 中文:合并 main(#4524、#4648、#4650、#4652)。perf-changelog.yaml 将 main 的 MiniMax-M3.1-Flash B300 条目放在 #2916 与 #4243 的视频条目之前; nvidia-master.yaml 与 MODELS.md 自动合并无冲突。74bb6816 上的 sweep (run 40873178356)仍是本 PR 的验证依据,因此跳过 PR 基准 setup。
CollectiveX moved to the new label in #4650; OperatorX jobs queued for the old one and never started. Co-Authored-By: Claude Opus 5.5 <[email protected]>
) * operatorx: MoE data-parallel groups time their own tokens Every dp rank timed the same batch. The CUDA graph replays on the launcher's padded input, drawn from the default generator after the same seed on every rank, so the per-group tokens only fed the untimed path; hash-routing token ids and forced expert ids were seeded alike on every rank too. A dp row then touched the experts of T tokens instead of T*dp. - _launcher: the padded input's first rows are the op's tokens; padding rows come from the op's generator when it supplies one (MoE: the group's). - Hash routing and the model's own module: token ids per dp group (tid2eid, the model's table, stays shared). - Forced routing: per-group draws; balanced continues the round-robin across groups, zipf keeps one expert ranking, single_hot keeps expert 0 hot. - dp group 0 draws exactly as before, so dp=1 rows are unchanged. Refs #4996 Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: fold the serving GEMM testlists into gemm_deepseek_v4; label synthetic shapes gemm_serving_8k1k_min and gemm_serving_all_min mixed DeepSeek-V4-Pro's serving GEMMs with shapes from larger hypothetical models that are no checkpoint (no sources). The DeepSeek-V4-Pro cases move into gemm_deepseek_v4 (3,719 new, 217 existing cases gain sources; one case per shape), the rest are dropped, and both files are deleted. Shapes from no model (116 in gemm, 2 in gemm_perf) now carry the source operatorx/Synthetic-Shapes/<testlist> instead of none. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: gemm_synthetic holds the synthetic GEMM shapes The shapes Ascend 950PR runs measured from no model (a 326-shape bf16 sweep) and the 116 synthetic cases from gemm.json move into one list, gemm_synthetic.json (441 cases, source operatorx/Synthetic-Shapes/gemm_synthetic). gemm_perf keeps its two smoke squares. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: per-model GEMM testlists under official/, harness checks under dev/ gemm.json splits by source model into gemm_deepseek_r1, gemm_kimi_k2, gemm_qwen3_5, gemm_glm5, gemm_minimax_m2_5 and gemm_gpt_oss; its DeepSeek-V4 and MiniMax-M3 cases join gemm_deepseek_v4 and gemm_minimax_m3. A shape several models share goes to each of their lists with all its sources; each list holds one case per shape. Testlists live in testlists/official/ (ingested) and testlists/dev/ (gemm_perf, smoke_parallel). The sweep never ingests a run that includes a dev list, and its default testlist is now gemm_perf. The loaders search both directories and reject a name found twice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: multi-device cases live in each model's testlist The gemm/moe/attn _parallel lists merge into gemm_, moe_ and attn_ deepseek_v4, minimax_m3 and kimi_k3. Planning already selects cases by world size, so a single-device run of a model's list skips them. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: synthetic shapes use the bare source operatorx/Synthetic-Shapes A source is <org>/<model>/<role>, or <org>/<model> for a shape with no layer; the loader and recipe lookup accept both. This matches the relabeled OperatorX database. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: one M sweep per model across its GEMM layers The layers of one model share the token dimension, so every single-device layer of a model's GEMM list now covers the same M values. Each model keeps about its previous case count: K = cases / layers values, chosen from the M values its layers already sampled, one per equal band of log(M), taking the value most layers had. Multi-device cases are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: synthetic sources name their shape as the layer A shape from no model has the source operatorx/Synthetic-Shapes/m<M>_n<N>_k<K>, so it parses like every <org>/<model>/<role> source; the two-part form is dropped again. Matches the OperatorX database. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: drop moe_small Its DeepSeek-V4, Kimi-K3 and MiniMax-M3 cases are already in moe_deepseek_v4, moe_kimi_k3 and moe_minimax_m3; the rest sampled a few MoE layers of models with no MoE list, which is removed rather than kept sparse. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: every M and token ladder spans 1 to 65536 by half-octave Each single-device layer now has a value in every half-octave bin from 1 to 65,536 (the 32 bins an integer count can reach), the bins the model view groups token counts by. Missing bins take a value the model already sampled, else the standard grid value; gemm_glm5, gemm_gpt_oss, gemm_minimax_m2_5, gemm_minimax_m3, gemm_qwen3_5 and gemm_synthetic gain cases, none lose any. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: deprecated/ testlists for models that get no new data gemm_deepseek_r1, gemm_kimi_k2 and gemm_minimax_m2_5 move to testlists/deprecated/. Like dev lists, a run that includes one is never ingested; their stored results stay. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: ingest only runs of official testlists The sweep ingests a run only if every testlist it names is in testlists/official/, instead of excluding dev/ and deprecated/. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: multi-device MoE and attention cases at served splits Repeat each MoE and attention layer's single-device token ladder at the splits InferenceX serving recipes use on up to 8 GPUs. Skip MoE dp cases whose dp x tokens exceeds 65,536. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: restore uv.lock Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: changelog wording for the per-rank cap Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: low_priority sweep input Score the shards 0 so every other CI job on the pool runs first. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Revert "operatorx: low_priority sweep input" This reverts commit e641ca6. * ci-priority: operatorx shards score 1.0, behind serving sweeps Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: fill the node, build each layer once per ladder - A shard runs one part per parallel split in turn; each part runs as many process groups side by side as the node has GPUs for, each on its own GPUs. - A layer's ladder stays in one process, which builds the GEMM or MoE layer once and times every size on it. - Shards hold up to 4000 cases and about 30 minutes of estimated work. - No cooldown sleep by default; telemetry flags throttled ops. - A cancelled sweep does not trigger ingest. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: stage H100 shards under the account home, as on B300 Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: each process loads only its own testlists Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: a lane without supported cases does not stop its siblings Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: size shards by op-type estimates; Kimi-K3 dcp only on MLA Attention cases take seconds each and every part pays process startup, so shard sizing estimates per op type and per part (from H100 runs). Decode context parallelism shards the MLA KV cache; the KDA layer has none, and its dcp cases are dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: a part without supported cases does not fail its shard Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: free a failed attention engine before building the next Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: changelog for the collection changes Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: restart a process that a failed case leaves unusable After a case that raised an error, or that failed with no layer or engine cached while the process still holds device memory (a failed startup vLLM never freed), the process checkpoints and exits; the rank wrapper starts a fresh one that runs that case once more and resumes. A single-device process that dies mid-case is resumed after recording the case as an error. Every rank of a group decides together. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: record the rest of a layer that fails again in a fresh process A layer whose build fails again after a restart, or two of whose cases fail again after one, has its remaining cases recorded with that result instead of restarting for each. Failures are tagged with the step they failed in (ranks.together), on every rank. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: changelog for failure recovery Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: an op that runs out of device memory is unsupported It is retried once in a fresh process first, so memory an earlier case left behind is not mistaken for the op's own need. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: build SchedulerOutput from the fields the image's vLLM has Newer vLLM dropped num_common_prefix_blocks; every DeepSeek-V4 attention case on the B200, B300 and MI355X recipe images errored on it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: MI325X runners are labeled cluster:mi325x-amd CollectiveX moved to the new label in #4650; OperatorX jobs queued for the old one and never started. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: one attention engine per process; per-op shard estimates A second vLLM engine in one process can hang in its process-group setup (10 minutes per case on MI355X Kimi-K3 KDA; H100 dcp). Under a CI part the attention runner asks for a fresh process instead (FreshProcessError): the harness restarts and runs that case first, without a result row. Shard sizing uses DeepSeek-V4 attention at up to 20 s per case (B200). Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: a process group restarts as one The ranks of a group shared nothing between restarts: a rank that hung (rank 0 after a fresh-process request on B200) kept the others waiting at its rendezvous until the shard timed out. Now the first rank to end an attempt marks it; every other rank's supervisor dumps its process's stacks and kills it, rank 0's supervisor makes the group's progress file final, and all ranks resume from it together. Only a crash records the case in flight as an error. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: stop a case that hangs; skip a layer that kills the process twice A case that hangs in a collective otherwise waits for NCCL's 10-minute watchdog (B200 DeepSeek-V4 attention at dp2). A per-case watchdog (300 s, 900 s for a process's first case) records the case as an error with the process's stacks and restarts the group; a layer two of whose cases crash or hang has the rest recorded the same way. The shard log tail is read with undecodable bytes replaced. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: layer-aware case limits, a GIL-free fallback, one retry after a hang The first case of each layer builds it and compiles its kernels and gets 30 minutes (DeepSeek-V4 attention on B200 compiled for over 15 minutes cold); later cases 5 minutes. A rank stuck in native code holding the GIL still stops (faulthandler's own thread). A case that kills or hangs the process runs once more in a fresh one before it is recorded as an error. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: no rank's restart exit cuts rank 0's writes short Ranks other than 0 exited at once and their supervisors killed rank 0 before it saved the group's progress, so a layer whose build failed twice was never recorded as such and every case restarted (Kimi-K3 MLA on B200). Every rank now passes a barrier after rank 0's writes, and a supervisor gives its process 30 s to exit before dumping and killing it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: record the tensors an attention module is called with Plus a dev testlist reproducing DeepSeek-V4.1 ratio-1 attention at tp1/2/8 (removed once fixed). Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: an attention op is every call its step makes to the module DeepSeek-V4.1's compress-ratio-1 layers call their attention module once per 128-token chunk; the runner captured and timed the first call only, so prefill rows of those layers measured one chunk (on any split). The runner now captures each call in the step and replays them in order. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: time a DeepSeek-V4.1 KV source layer's all-rows KV write too In eager prefill vLLM's decoder replay runs the layers from the last KV source on (V4.1-Flash: 20-39, every compress-ratio-1 layer) on each request's trailing sliding window only; the source layer first writes its KV for every row (forward_kv). The runner captured only the module's forward, so the source layer's rows missed that write. It now captures and replays every forward and forward_kv call of the step, each under its own forward context. Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: drop the V4.1 ratio-1 repro testlist Co-Authored-By: Claude Opus 5.5 <[email protected]> * operatorx: balanced MoE routing gives each data-parallel group its own experts A group's round-robin offset used the routing buffer's length (65,536) rather than the op's token count, so with dp > 1 every group routed to the same experts whenever 65,536 x top_k divides by the expert count. The offset now follows the op's tokens. No collected case uses balanced routing (all are natural), so stored results are unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Restore the srt-slurm submodule to main's pointer 3a5ea4f recorded this worktree's stale submodule checkout by accident. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
CollectiveX has only run by hand since #4054, so its allocations never enter the InferenceX CI priority queue. While engine benchmarks hold the nodes, a hand run waits for them to finish. This PR adds a
CollectiveX Sweepdispatch workflow that puts every shard into that queue, and scores CollectiveX and OperatorX above every engine benchmark..github/workflows/collectivex-sweep.ymlresolves shards withsweep_matrix.pyand scores each one throughinfx.workflows.ci_priority(framework: collectivex,node-count). Each shard runs as one job withci-job-<score>-<token>,ci-attempt-Nandnodes:Nlabels, the same way the benchmark templates andoperatorx-sweep.ymldo. The job runscollectivex/run.sh <sku> --shard <id>with the dispatch filters and uploadsresults/<sku>/for publishing.inferencex-e2e/configs/ci-priority.yaml,framework-prefixgivescollectivexandoperatorx+10. They score about 11, above the top engine benchmark (about 10.5 for a pushed MuseSpark SGLang/vLLM job). Aging adds 0.25 per hour, so a long-queued engine job can still eventually pass them.collectivex/configs/platform_config.jsonnow gives every pool the livecluster:runner label (runner_label). gb300 also getsrunner_partition: batch_1, so its shards only lease batch_1 runners, which matches the partition CollectiveX allocates in. mi325x's label is changed tocluster:mi325x-amd, the label its runners actually carry.sweep_matrix.pyemits the partition label on each shard.~/.config/inferencex/collectivex.json, that document is used instead.Not yet run on GPU runners. The first dispatch should be a single pool.
Validation details
allplan locally. It produced 153 shards (37 KB matrix): 1-node shards score11.000, 2-node10.999and 4-node10.997. gb300 shards carrypartition:batch_1.run.sh gb300 --shard gb300-deepep-v2-ll-bf16-n2 ... --dry-runresolved the shard and thegb-nvlauncher.runtime/config.py operator-config(mi355x →COLLX_STAGE_DIRset, registry partition and squash kept).collectivex/tests/test_matrix.pyandinferencex-e2e/infx/tests/workflows/test_ci_priority.pypass.results/cases.jsonregenerates unchanged.actionlintandzizmorreport no findings.AI model disclosure
PR checklist and change type
Type of Change
Checklist
中文
自 #4054 起 CollectiveX 只能手动运行,其分配不会进入 InferenceX CI 优先级队列,引擎基准测试占用节点时只能等待。本 PR 新增
CollectiveX Sweep手动触发工作流,将每个 shard 作为一个带ci-job-<分数>-<token>、ci-attempt-N和nodes:N标签的作业放入该队列,并在ci-priority.yaml中为collectivex和operatorx加 10 分(约 11 分,高于引擎基准测试最高约 10.5 分;排队老化每小时加 0.25,长时间排队的引擎作业仍可能超过)。platform_config.json为每个资源池补上实际的cluster:runner 标签,gb300 额外限定partition:batch_1,mi325x 改为实际的cluster:mi325x-amd。需要 stage 目录的资源池(AMD、b300、h100-dgxc、gb300)使用 OperatorX 在 CI 中已验证的存储路径;如 runner 用户已有~/.config/inferencex/collectivex.json则以其为准。尚未在 GPU runner 上运行,首次触发建议只选一个资源池。验证:本地模拟
all计划得到 153 个 shard,单节点 11.000、双节点 10.999、四节点 10.997;run.sh --dry-run正常解析;生成的 operator 文档可被config.py解析;相关单元测试通过,cases.json无变化,actionlint与zizmor无告警。AI 模型:claude-opus-5-5,负责调查、实现、本地验证和撰写 PR;只读 scout 子代理的确切模型标识无法确认。