Skip to content

[pipeline] Skip process-group stats monitor in daemon processes - #1590

Merged
mthrok merged 1 commit into
mainfrom
pgrp
Jul 6, 2026
Merged

[pipeline] Skip process-group stats monitor in daemon processes#1590
mthrok merged 1 commit into
mainfrom
pgrp

Conversation

@mthrok

@mthrok mthrok commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

ProcessGroupStatsMonitor.run() spawns a multiprocessing subprocess to read /proc for per-process-group CPU/mem/IO stats. When the pipeline is built inside a daemon process — e.g. a worker-pool process running a nested pipeline (a .to() region worker, or the old fused-subprocess pool worker) — proc.start() raises AssertionError: daemonic processes are not allowed to have children, which the background-task runner logs as an ERROR (once per worker, repeatedly noisy in MAST logs).

A daemon genuinely cannot spawn the monitor subprocess, and a per-worker monitor would be redundant anyway: the main-process monitor already collects stats for the whole process group (it sums over the shared PGID). So guard the spawn — if the current process is a daemon, log a single WARNING and return cleanly instead of letting the assertion surface as an error.

`ProcessGroupStatsMonitor.run()` spawns a `multiprocessing` subprocess to read `/proc` for per-process-group CPU/mem/IO stats. When the pipeline is built inside a daemon process — e.g. a worker-pool process running a nested pipeline (a `.to()` region worker, or the old fused-subprocess pool worker) — `proc.start()` raises `AssertionError: daemonic processes are not allowed to have children`, which the background-task runner logs as an ERROR (once per worker, repeatedly noisy in MAST logs).

A daemon genuinely cannot spawn the monitor subprocess, and a per-worker monitor would be redundant anyway: the main-process monitor already collects stats for the whole process group (it sums over the shared PGID). So guard the spawn — if the current process is a daemon, log a single WARNING and return cleanly instead of letting the assertion surface as an error.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 6, 2026
@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D110786636. (Because this pull request was imported automatically, there will not be any future comments.)

@mthrok
mthrok merged commit cca926b into main Jul 6, 2026
99 of 112 checks passed
@mthrok
mthrok deleted the pgrp branch July 6, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant