P5: capacity-aware node selection (control side) - #40
Merged
Conversation
select_placement(required_vram_bytes) picks a routable node + device with enough reported allocatable VRAM, consuming the capacity nodes report in observations (P3). Prefers the device with the most headroom (spread); skips revoked or lease-expired nodes; returns None when nothing fits. Exposed at POST /admin/place. Pairs with the node-side MIG/VRAM launch enforcement. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Phase-5 placement, control-side. Pairs with meridian-node PR #11 (MIG/VRAM launch enforcement).
What
ControlService.select_placement(required_vram_bytes)picks a routable node + device with enough reported allocatable VRAM — consuming thecapacity.allocatable_vram_bytesthat nodes report in observations (P3). Prefers the device with the most headroom (spread), skips revoked / lease-expired nodes, returnsNonewhen nothing fits. Exposed atPOST /admin/place.This closes the loop: node reports allocatable capacity → control uses it to place new engines.
Tests
pytest tests/control -q→ 31 passed (+2: prefers-most-headroom / nothing-fits, skips-expired-lease); ruff + mypy clean.Remaining P5
Artifact locality, queue-depth-aware assignment, multi-GPU/NVLink affinity (tracked in node DESIGN §24).
🤖 Generated with Claude Code