[POC] Schedule Slurm jobs with node-count runner labels / 使用节点数 Runner 标签调度 Slurm 任务 - #2440
Draft
cquil11 wants to merge 2 commits into
Draft
[POC] Schedule Slurm jobs with node-count runner labels / 使用节点数 Runner 标签调度 Slurm 任务#2440cquil11 wants to merge 2 commits into
cquil11 wants to merge 2 commits into
Conversation
Derive Slurm node requirements for generated multi-node jobs, gate nodes:N labels behind a repository variable, and add a deterministic static-label planner for runner pools. Use node count as a secondary priority tie-breaker. 中文:为生成的多节点任务推导 Slurm 节点需求,通过仓库变量控制 nodes:N 标签,并为 runner 池新增确定性的静态标签规划工具。同时将节点数作为 CI 优先级的次级排序条件。
The small static-label planning utility is sufficiently transparent for this proof of concept and does not need a dedicated test file. 中文:静态标签规划工具逻辑简单直观,本概念验证无需为其保留独立测试文件。
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.
Summary
This draft proof of concept uses static GitHub runner labels as Slurm allocation-size admission slots.
node-countfor every multi-node matrix row from checked-in recipe resources, explicitPREFILL_NODES/DECODE_NODES, or the worker GPU topology.nodes:Ntoruns-onwhenNODE_SLOT_SCHEDULER_ENABLED=true; single-node jobs requestnodes:1.nodes:Nto the firstfloor(pool_size / N)runners in configured order. For 12 runners,nodes:1,nodes:2, andnodes:3have 12, 6, and 4 eligible slots.Important behavior
GitHub still selects one launcher runner; Slurm allocates the requested compute nodes. Because
runs-onarrays use AND semantics, the launcher must have the hardware, staticnodes:N, and dynamic queue labels.This caps uniform allocation sizes correctly but is not exact weighted accounting for mixed sizes. For example, simultaneous one-node and three-node jobs can collectively request more than the physical pool. Slurm remains the final capacity authority. Recipes that exist only in a runtime image currently fall back to a topology estimate and should be audited before enabling the feature.
Activation
python utils/runner_setup/plan_node_labels.py <cluster-label>.NODE_SLOT_SCHEDULER_ENABLED=true.Validation
python -m pytest utils/matrix_logic/ utils/test_ci_priority.py -q— 246 passed.node-count.actionlintfound no new workflow-call or node-slot expression errors; existing unrelated shell/style warnings remain.中文说明
此 Draft PR 是一个概念验证,使用静态 GitHub runner 标签作为不同 Slurm 节点规模任务的准入槽位。
node-count。节点数依次取自仓库内的 recipe 资源配置、显式PREFILL_NODES/DECODE_NODES,或 worker GPU 拓扑。NODE_SLOT_SCHEDULER_ENABLED=true时,在runs-on中加入nodes:N;单节点任务使用nodes:1。nodes:N分配给前floor(pool_size / N)个 runner。例如 12 个 runner 时,nodes:1、nodes:2和nodes:3分别有 12、6 和 4 个可用槽位。重要行为
GitHub 仍然只选择一个启动器 runner,实际计算节点由 Slurm 分配。由于
runs-on数组采用 AND 语义,启动器必须同时具备硬件标签、静态nodes:N标签和动态队列标签。该方案能正确限制同一节点规模任务的并发数,但不能对混合规模任务进行精确的加权资源核算。例如,单节点和三节点任务同时运行时,总请求量仍可能超过物理节点池,最终容量控制仍由 Slurm 负责。仅存在于运行时镜像中的 recipe 目前会使用拓扑估算值;正式启用前需要审计这些配置。
启用步骤
python utils/runner_setup/plan_node_labels.py <cluster-label>。NODE_SLOT_SCHEDULER_ENABLED=true。验证
python -m pytest utils/matrix_logic/ utils/test_ci_priority.py -q:246 项测试全部通过。node-count。actionlint未发现新的 workflow 调用或节点槽位表达式错误;仅保留已有且与本 PR 无关的 shell/style 警告。