Skip to content

Attach the MPS control daemon health gate to MPS tasks - #5119

Merged
harishxr merged 1 commit into
aws:devfrom
harishxr:harishxr/mps-daemon-gate-wiring
Sep 1, 2026
Merged

harishxr merged 1 commit into
aws:devfrom
harishxr:harishxr/mps-daemon-gate-wiring

Conversation

@harishxr

@harishxr harishxr commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Wires the MPS control daemon health gate onto MPS tasks. The gate resource landed in #5107, but nothing created it for a task. This PR attaches one MPSDaemonResource per MPS task and makes every MPS container wait for it before it can be created.

Implementation details

initializeMPSDaemonResource (agent/api/task/task.go) runs in PostUnmarshalTask, right after addGPUResource. If any container in the task uses MPS, it creates the resource via NewMPSDaemonResource, adds it to the task, and makes each MPS container's ContainerCreated transition depend on the resource reaching MPSDaemonCreated. So a daemon that is not serving blocks the task at container creation instead of letting a container start with a CUDA_MPS_PINNED_DEVICE_MEM_LIMIT that would be silently ignored. Tasks with no MPS container get no resource , and non-MPS containers in a mixed task are not gated.

Testing

New tests cover the changes: yes

  • End to end on a gamma GPU instance:
    • daemon healthy: MPS task RUNNING, injected memory cap enforced.
    • daemon down: task STOPPED with reason "MPS control daemon is not responding", no container ever created.
    • daemon restarted within the retry window: task proceeds to RUNNING.
    • daemon down past the window: "no success in 3 attempts", STOPPED.
    • new MPS task after the daemon is healthy again: RUNNING.
    • whole-GPU and non-GPU tasks with the daemon down: unaffected, no gate.

Description for the changelog

Enhancement - Attach the MPS control daemon health gate to MPS tasks

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions? No

Does this PR include the addition of new environment variables in the README? No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@harishxr
harishxr force-pushed the harishxr/mps-daemon-gate-wiring branch 2 times, most recently from e2ee2c5 to 0c4464e Compare September 1, 2026 15:40
@harishxr
harishxr marked this pull request as ready for review September 1, 2026 17:38
@harishxr
harishxr requested a review from a team as a code owner September 1, 2026 17:38
Comment thread agent/api/task/task_test.go Resolved
amogh09
amogh09 previously approved these changes Sep 1, 2026
@harishxr
harishxr enabled auto-merge (rebase) September 1, 2026 21:30
@harishxr
harishxr merged commit dac7ec8 into aws:dev Sep 1, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants