feat(slurm): harden distributed allocation runtime - #914
Conversation
|
| def _sample_forever(self) -> None: | ||
| while True: | ||
| self.sample_once() | ||
| time.sleep(self.settings.poll_interval_seconds) |
There was a problem hiding this comment.
Sampler failure disables backpressure
If a vLLM or Prometheus metrics collector raises during sampling, the exception terminates this daemon thread while _thread remains non-None, so later requests cannot restart it. Once the cached snapshot becomes stale, admission permanently fails open and the configured queue limit stops producing 429 responses.
| def _sample_forever(self) -> None: | |
| while True: | |
| self.sample_once() | |
| time.sleep(self.settings.poll_interval_seconds) | |
| def _sample_forever(self) -> None: | |
| while True: | |
| try: | |
| self.sample_once() | |
| except Exception: | |
| pass | |
| time.sleep(self.settings.poll_interval_seconds) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/data-designer-slurm/src/data_designer/slurm/runtime/backpressure.py
Line: 120-123
Comment:
**Sampler failure disables backpressure**
If a vLLM or Prometheus metrics collector raises during sampling, the exception terminates this daemon thread while `_thread` remains non-`None`, so later requests cannot restart it. Once the cached snapshot becomes stale, admission permanently fails open and the configured queue limit stops producing 429 responses.
```suggestion
def _sample_forever(self) -> None:
while True:
try:
self.sample_once()
except Exception:
pass
time.sleep(self.settings.poll_interval_seconds)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 77933cc. QueueBackpressureController.sample_once now converts ordinary reader failures into a fresh unavailable snapshot, so admission fails open for that sample and the daemon continues polling; the next successful sample restores queue-limit rejection. BaseException is intentionally not caught, preserving process-control and shutdown signals. Added regression coverage for failure, fail-open behavior, recovery, and KeyboardInterrupt propagation. Validation: 5 focused tests and 1,235 full Slurm tests passed; check-slurm and focused strict complexity checks pass.
d5cc2ee to
f7d12a4
Compare
77933cc to
b8eb0dc
Compare
| raise AssertionError(f"unhandled environment binding: {type(binding)!r}") | ||
| container_environment.append(name) | ||
| runtime_root = runtime_node_worker_path.parents[3] | ||
| environment["PYTHONPATH"] = get_container_path(plan, runtime_root.as_posix()) |
There was a problem hiding this comment.
Could we handle PYTHONPATH explicitly here? It is valid in server.environment, but this assignment silently replaces it. A deployment using an approved mount for a custom parser or plugin will validate and then fail at startup because its module path disappears. Either prepend the runtime bundle path or reject PYTHONPATH during config validation, with a regression test for the collision.
There was a problem hiding this comment.
Addressed in b1de388. The staged runtime bundle path is now prepended while the deployment-configured PYTHONPATH value is preserved unchanged behind it. Added a regression covering multiple configured plugin/parser entries. Validation: 19 focused runtime tests and all 1,273 Slurm tests pass; make check-slurm and git diff --check also pass.
| if ( | ||
| parsed.scheme != "http" | ||
| or parsed.hostname != "127.0.0.1" | ||
| or parsed.hostname not in allowed_hosts |
There was a problem hiding this comment.
urlsplit(...).hostname lowercases hostnames, while allowed_hosts keeps the spelling returned by scontrol. That makes an accepted host such as Compute-001 fail this check and prevents the proxy from starting. Normalizing both sides before comparison, plus a mixed-case test, should cover it.
There was a problem hiding this comment.
Addressed in b1de388. Backend parsing now compares the URL hostname and scheduler allow-list using casefolded forms, while retaining the parsed canonical hostname for the connection. Added a mixed-case scheduler-host regression. Validation: 19 focused runtime tests and all 1,273 Slurm tests pass; make check-slurm and git diff --check also pass.
b1de388 to
87d4f29
Compare
87d4f29 to
620b4aa
Compare
af611bf to
68bc3ec
Compare
|
Just a couple more things I found in a final review, both around distributed startup behavior. Once those are addressed, I think this is good to go. |
Layer multi-node topology and follower-failure handling onto the production allocation bootstrap introduced by #929. Preserve the one-node path while adding host-scoped steps, coordinated node workers, remote readiness probes, and distributed preflight coverage. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Apply the resolved container-mount mapping to absolute model paths in both coordinated multi-node workers and remote-node serving commands. Cover differing host and container roots in the bootstrap manifest regression. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Pass the one-node allocation layout required by the distributed runtime manifest after composing the merged retry coverage onto the new shared base. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Select the multi-process vLLM executor whenever pipeline or tensor parallelism spans more than one worker. Carry mapped absolute model paths through the node-worker contract so every assigned node verifies accessibility before launch. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
2005fbc to
0a86e11
Compare
andreatnvidia
left a comment
There was a problem hiding this comment.
Looks good now. The final couple of issues are addressed, and the latest changes look solid. Approving!
📋 Summary
This completes the distributed-topology and failure-hardening slice of the Slurm allocation runtime on top of the merged reconciliation/retry foundation.
The branch has been restacked directly on
feat/slurm-executionat36864772, which includes merged PRs #913, #915, #916, #929, and #930. The four PR-owned commits layer only host placement, multi-node launch, remote readiness, follower-failure behavior, model-path mapping and preflight, and a base-integration test adaptation onto that composition.🔗 Related Issue
868#3: distributed execution and failure hardening)🔄 Changes
srunsteps for multi-node deployments--kill-on-bad-exit=1🧪 Testing
25 passed— focused bootstrap, entrypoint, node-worker, and shell-runtime tests after restacking1,548 passed— fullpackages/data-designer-slurm/testssuite after restackingmake check-slurmgit diff --checkdata-designer-slurmwheel, verified the distributed runtime modules and shell assets, installed it in isolation, and imported the public runtime types✅ Checklist
Description updated with AI