Skip to content

feat(training): select recorded CUDA MPS daemon - #2095

Merged
TATP-233 merged 2 commits into
mainfrom
feat/issue-2093-trainer-mPS-daemon
Oct 8, 2026
Merged

TATP-233 merged 2 commits into
mainfrom
feat/issue-2093-trainer-mPS-daemon

Conversation

@TATP-233

@TATP-233 TATP-233 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

After uv run uni-cumps start, single-GPU MJWarp SAC/FlashSAC training with training.cuda_process_sharing=mps can select the sole live UniLab-recorded daemon without importing its environment into the shell. An explicit CUDA_MPS_PIPE_DIRECTORY takes precedence. Selection matches the physical GPU UUID and fails before environment/learner/collector construction when no live matching daemon exists or the choice is ambiguous.

Startup also waits for a successful control query before recording the daemon. Both the readiness check and the doctor/training probe send get_server_list\n through stdin to nvidia-cuda-mps-control. Passing the command as an argument left the client waiting for stdin on CUDA 13, causing a timeout even though the daemon had accepted the connection. A successful empty server list is accepted because MPS servers start lazily. Failed readiness triggers cleanup of the newly launched control process and reports its log tail.

The trainer only selects an existing daemon; lifecycle management remains CLI-owned.

uv run uni-cumps start
uv run --extra mjwarp train --algo flashsac \
  --task g1_motion_tracking --sim mjwarp \
  training.cuda_process_sharing=mps
uv run uni-cumps stop

eval "$(uv run uni-cumps env)" remains available for explicit shell integration.

Linked Work

Validation

Final local head: b41fdac5.

  • Focused regression tests passed: 58 tests, including stdin query delivery, readiness retry/cleanup, daemon selection, UUID matching, and explicit-environment precedence.
  • make test-all passed on the final local head before updating this PR.

Commands run against this tree:

uv run pytest tests/training/test_cuda_mps_cli.py tests/training/test_cuda_process_sharing.py -q
git diff --check
make check
make test
make test-all
uv run uni-cumps start
uv run uni-cumps doctor
uv run uni-cumps stop
uv run uni-cumps start
uv run uni-cumps env
uv run uni-cumps doctor

make check passed. make test and the full make test-all gate passed with 1,853 passed, 42 skipped, and 488 deselected. Coverage: 70%. Benchmark entrypoint smoke: module mode 34/34 and script mode 35/35.

On Linux / NVIDIA RTX 4090 / CUDA MPS control version 13000, an isolated real-daemon reproduction showed the argument-based query timing out and the stdin query returning immediately. With the fix, start, stop, and restart succeeded; doctor reported valid=True. The managed daemon was left running. Full training was not rerun for this correction.

Remote checks for b41fdac52d2b50d1c46db3231cbd1fd8785695b2: CI and Docs both passed. Ruff lint/format, mypy, pyright, benchmark smoke, coverage tests, and Sphinx build succeeded. Documentation deployment was skipped as expected for a PR.

Impact and Limitations

Checklist

  • Tests cover the affected behavior.
  • English and Chinese production guides document automatic daemon selection.
  • Driving issue and governing ADRs linked.
  • Follow-up scope and limitations noted.

@TATP-233
TATP-233 requested a review from caozx1110 as a code owner October 8, 2026 14:48
@TATP-233
TATP-233 force-pushed the feat/issue-2093-trainer-mPS-daemon branch 2 times, most recently from b79ef3a to ab815b5 Compare October 8, 2026 15:05
@TATP-233
TATP-233 force-pushed the feat/issue-2093-trainer-mPS-daemon branch from ab815b5 to 8a05802 Compare October 8, 2026 15:24
@TATP-233
TATP-233 merged commit 2764744 into main Oct 8, 2026
8 checks passed
@TATP-233
TATP-233 deleted the feat/issue-2093-trainer-mPS-daemon branch October 8, 2026 16:05
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.

feat(training): let trainer use the sole live uni-cumps daemon without shell eval

1 participant