Split an explicit parallel_count across a mixed allocation by machine size (#643) - #646
Open
wshlavacek wants to merge 1 commit into
Open
Split an explicit parallel_count across a mixed allocation by machine size (#643)#646wshlavacek wants to merge 1 commit into
wshlavacek wants to merge 1 commit into
Conversation
… size (#643) On a cluster whose machines are not all the same size, setting parallel_count could keep the slurm-srun launcher from starting any worker. parallel_count is a total number of workers split evenly across the machines, and the launcher asked SLURM in a single job step for the even per-machine share on every machine. On a mixed allocation that share can be more than a smaller machine was granted, and SLURM refuses the whole step with "More processors requested than permitted", so the fit stops before it starts. The automatic path already avoids this. Issue #617 gave it one srun step per distinct machine size, each asking only for what those machines hold. Only the parallel_count override was left as a single even-split step, which ADR-0124 recorded and asked to track separately because a fix changes what the config key means on a mixed allocation. This change splits parallel_count in proportion to each machine's granted CPUs and starts one step per distinct size, the same way the automatic path works, so no step asks a machine for more CPUs than it holds. The rule generalizes the even split: on a same-size allocation each machine's share is ceil(parallel_count divided by the machine count), so a homogeneous run builds exactly the single step it built before. A homogeneous allocation, with or without parallel_count, is byte for byte unchanged, and so is the automatic mixed path. ADR-0126 records the decision and supersedes the deferral in ADR-0124.
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.
Fixes #643.
On a cluster whose machines are not all the same size, setting parallel_count could keep the slurm-srun launcher from starting any worker. parallel_count is a total number of workers split evenly across the machines, and the launcher asked SLURM in a single job step for the even per-machine share on every machine. On a mixed allocation that share can be more than a smaller machine was granted, and SLURM refuses the whole step with "More processors requested than permitted", so the fit stops before it starts.
Repro: an allocation of one 96-CPU machine and one 40-CPU machine with parallel_count set to 136. The even share is 68 per machine. Launched from the 96-CPU machine the cap is 96, so the step asks for 68 CPUs on both machines, and the 40-CPU machine cannot supply them. No worker starts.
The automatic path (parallel_count unset) already avoids this. Issue #617 gave it one srun step per distinct machine size, each asking only for what those machines hold. Only the parallel_count override was left as a single even-split step, which ADR-0124 recorded and asked to track separately, because a fix changes what the config key means on a mixed allocation.
What this changes:
On a mixed allocation, parallel_count is now split in proportion to each machine's granted CPUs, started as one srun step per distinct size, the same way the automatic path works. Each step asks only for what its own machines hold, so SLURM accepts every step. On the repro above this becomes one worker per CPU: 96 workers on the large machine, 40 on the small one, both fully bound.
The rule is the exact generalization of the even split. On a same-size allocation each machine's share works out to ceil(parallel_count divided by the machine count), the number the even split already produces, so a homogeneous run builds exactly the single step it built before. A homogeneous allocation, with or without parallel_count, is byte for byte unchanged, and so is the automatic mixed path from #617.
ADR-0126 records the decision and supersedes the deferral ADR-0124 recorded. ADR-0124 gets a one-line pointer to it.
Tests: the srun launcher tests use stand-ins for srun and scontrol, and the constructed srun argument list is the oracle, as it was for #614, #617, and #642. The suite now checks the proportional split on a mixed allocation, the reported failure case, an oversubscribed parallel_count that stays bound, and that a homogeneous allocation with parallel_count is still one even-split step. All cluster tests pass with: