Repository navigation
fix(megatron): lift Ray's 1000-call cap on the Megatron policy worker - #5120
Conversation
Every rollout sample is one generate_async call on rank 0 of MegatronPolicyWorker, which set no max_concurrency, so Ray's async-actor default of 1000 applied. Calls past it wait in Ray's FIFO: the engine never holds more than 1000 rows, however large its max_requests, and a control call such as finish_generation (rank 0 sends the engine pause) waits until earlier rows finish. Set max_concurrency=2**16 so the engine, which queues requests past its own capacity, is the only admission limit. Signed-off-by: wdykas <[email protected]>
|
/ok to test 5c96b38 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
One [BUG] finding needs correction before merging: C1 identifies a test-collection failure in non-MCore environments.
I inspected both changed files and their affected worker-creation, generation-control, and test-lane paths. Two child report bodies weren't delivered, so I covered those topics directly; the test-topic report was available for consolidation.
Validation was static only. I couldn't run pytest, Ray experiments, lint, or CI checks in this read-only environment.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Signed-off-by: William Dykas <[email protected]>
…actor Signed-off-by: William Dykas <[email protected]>
|
/ok to test 21c929a |
terrykong
left a comment
There was a problem hiding this comment.
Thanks for this fix. Megatron generation sends each rollout sample to rank 0 as its own generate_async call, so Ray's async default of 1,000 calls really does cap in-flight rows; the largest shipped async Megatron-generation recipes can reach about 2,560. The test reads the real decorator option instead of copying the number, so the two can't drift apart. A CPU-only copy of the test on Ray 2.58.0 (the pinned version) passes with 2**16 and times out with the default.
- (C1) Two comments in other files now wrongly say this worker has no
max_concurrency; please reword them.
Checked and fine: the option reaches the real actor through RayWorkerBuilder. MegatronQuantPolicyWorker and SFTMegatronPolicyWorker don't need it: the quant worker rejects Megatron generation, and the SFT worker never generates. The bot's eager-import comment is fixed in 21c929a.
Generated by Claude Code
Signed-off-by: wdykas <[email protected]>
|
/ok to test 27beb9b |
…r5120 Signed-off-by: wdykas <[email protected]>
|
/ok to test 28f0258 |
…ym rollout) into jthomson04/dynamo-1.7 Brings in NVIDIA-NeMo#4979's merge of main 89329fc (NVIDIA-NeMo#5030, NVIDIA-NeMo#5120, NVIDIA-NeMo#5007, NVIDIA-NeMo#5187, NVIDIA-NeMo#5265). Git merged the five files both sides changed without a conflict: the Dynamo guide, nemo_gym.py and three test files. pyproject.toml, uv.lock and the submodule pins are unchanged. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: jthomson04 <[email protected]>
What changes
Raise
MegatronPolicyWorker's Ray actor concurrency to2**16. Each rollout sample submits a suspendedgenerate_asynccall to rank 0; Ray's default 1,000-call async-actor limit can otherwise cap admitted samples and prevent control calls such asfinish_generationfrom running while those samples wait.The MCore engine continues to enforce its own active-request capacity. This changes async coroutine admission, not the number of training threads or GPU request slots.
The regression test waits until all 1,500 generation calls have entered before checking that the control call completes. Its worker import is deferred until execution so Automodel and other non-MCore lanes can collect the module without optional Bridge dependencies.
Validation
git diff --checkpassed.CI:Lfast; no model forward pass was run locally.