Repository navigation
Groups on the local runner, control and Kubernetes, through one provider contract (groups.md PR 5) - #613
Merged
Conversation
…der contract (groups.md PR 5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycsyUqdnuDeZrYc3z6wV
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycsyUqdnuDeZrYc3z6wV
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycsyUqdnuDeZrYc3z6wV
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.
PR 5 of
docs/groups.md, its last: the provider contract by name, and worker groups on the placements that aren't pools.morca._internal.provider), selected by the provider's name (pool,local,control,kubernetes):cluster_envfor a dista head or worker (DISTA_ROLE/HEAD/ADVERTISE/TOKEN/PORT/GROUP,DISTA_WORKER_SLOTS,DISTA_CONNECT_TIMEOUT, and the GPUs),driver_env,local_env(MORCA_WORKERS,MORCA_GROUPS) andgpu_env(MORCA_GRANT_GPUS,CUDA_VISIBLE_DEVICES, whichGrant.envnow uses). The pool's head and members (worker_cluster), the Kubernetes head, worker and driver pods, and the control host's run all build through it. The variables and their order are unchanged for each existing case (unit tests compare them with the strings the old code wrote).control. The run's process forks each group's MAX beside its workers with no group:Tasks.startpassesMORCA_GROUPS(gpu=2,io=1) to dista'sRuntime(groups=...). The run is admitted as one: its groups'gpus× MAX are part of its request, counted from the scheduler's host (MORCA_HOST_GPUS, elsenvidia-smi -L, the first time a run asks for GPUs), held while the process lives, recorded inruns.grant_gpus, and given inMORCA_GRANT_GPUS/CUDA_VISIBLE_DEVICESto the run's process, which all its forked workers share. A run asking for more GPUs than the host has waits: "waiting: needs 2 GPUs, more than the 1 this host grants at most". A group'scpus/memory_gbaren't used there.morca-<run>-<start>-worker-<group>-<i>(_→-), labelledorca.group, withDISTA_GROUP, sized from the group'scpus/memory_gb(the pipeline's where unset) and withnvidia.com/gpu: Nin its limits; inside the podMORCA_GRANT_GPUS/CUDA_VISIBLE_DEVICESare0..N-1(empty for a group without GPUs). The groups' pods count towardscpu_millis, the vCPU budget and the fill estimate. The head is made when any group has workers.registerandconfig checksay forec2that its tasks of a group fail and to use a pool instead, and warn about a group'scpus/memory_gboncontrol.MORCA_GROUPSis reserved inenv.Registered.has_tasks(fromdescribe): groups only start workers for a pipeline with dista tasks.runs.grant_gpusexists since 71.Behaviour changes:
test-grants,test-placement,test-run-clusterandkindexercise the ungrouped paths). The scheduler doesn't runnvidia-smiunless a run asks for GPUs.controlor Kubernetes now gets its groups' workers (before: groups ignored, so tasks of a group failed). On local/controlwith GPU groups it now waits for the host's GPUs; on a Mac or a host without NVIDIA GPUs that meansMORCA_HOST_GPUSmust be set.envcan no longer setMORCA_GROUPS.MORCA_GROUPS(forks no group workers), as before.Not built after this (as
docs/groups.mdsays): scaling on local and Kubernetes, labels other than GPUs, fractional GPUs, groups from another pool, retiringec2, the per-placement key table (#369).Tests:
test-grantsgains gpufan on the local runner and oncontrolwith groupsgpu(1..2, a GPU each) andio: held for GPUs on a host with one, then run with three, model tasks only in groupgpuworkers, plain ones only in the no-group worker, every worker seeing0,1. Unit tests of the builder per provider, the Kubernetes group pods' env, GPU limits, names and requests,local_groups/local_gpus, the warnings and control'srun_env. The grouped Kubernetes pods themselves (withkind) are covered only by unit tests: kind has no GPUs and its image has no grouped pipeline.🤖 Generated with Claude Code
https://claude.ai/code/session_017TycsyUqdnuDeZrYc3z6wV