part 3 of 3 · the review · three findings on PR #3665

Three things a review of the new fault-tolerance settings turned up

Review notes on NVIDIA-NeMo/RL #3665. All permalinks pin the PR head ad048f9; "before" behaviour is 3d873eb. The numbering here matches the three review comments on the PR.

The PR lets a training run give up on a prompt the generation fleet cannot answer, instead of ending the run. To do that it adds five settings under async_rl.rollout_failure. Only finding 1 is a defect; the other two are follow-up asks. Nothing that ships today is affected — every new setting is off by default. Examples use 4 prompts per training step.

One word first, because everything below turns on it. When the generator sends a batch of prompts out, the in_order sampler gives that batch the number of the training step it belongs to (in the code, target_step), and step 7 will only ever train on groups carrying the number 7. The other two built-in samplers, weight_fifo and windowed, hand back None instead — their batches carry no step number.

bug Finding 1 — with two of the three samplers, giving up on a prompt stops training

Review comment on config.py:442

Everything this PR adds is keyed off the step number: a lost prompt is subtracted from its step's target so the trainer stops waiting for it. With no step number there is nothing to subtract from. Both paths bail on exactly that — _credit_shortfall returns immediately and _take_replacement returns nothing — so with weight_fifo or windowed neither "shrink" nor "replace" ever runs, the step's target stays at the full num_prompts_per_step forever, and min_step_batch_fraction is never consulted.

With weight_fifo that is unrecoverable, because two ranges disagree at exactly one point:

Trainer is at weight version 1. Version 0 is one group short after a prompt was given up on. weight version 0 3 of 4 — one was given up on weight version 1 new prompts arrive here, at a newer version — they cannot fill the gap 0 1 select looks at 0 <= v <= 1 Version 0 is INSIDE this range, and select always takes the oldest. So every pass asks version 0 for 4 groups, gets 3, and gives up. evict removes v < 0 Version 0 is OUTSIDE this range — evict only removes versions strictly older than 0, so it is never cleared. Version 0 is picked forever and cleared never. The trainer cannot advance to version 2 to age it out, because the trainer is the thing that is stuck. select window :373 evict window :176

No exception is raised. The train pump sleeps 5 ms and re-asks forever, both pumps go idle, and the job holds its GPUs until the wall clock kills it — stall_action defaults to warn, so the watchdog only prints. This is pre-existing — the older max_skipped_prompts could already reach it — but the PR adds a second way in, and its own YAML comment suggests turning it on.

Which of the two failures you get is decided by an unrelated speed setting. min_groups_for_streaming_train is how many finished groups the trainer waits for before starting a chunk of work. Under in_order it has no say in fault tolerance at all. Here, because the step's target never moves, it is the only thing left deciding what happens:

finished given up on — never arrives A. trainer waits for a whole batch min_groups_for_streaming_train == num_prompts_per_step — what the example config sets batch 1 step 1 still wants 4. Only 3 will ever be here. So it sleeps 5ms and asks again. Same answer. No error is raised. The job holds its GPUs until the wall clock kills it. B. trainer will start on part of a batch min_groups_for_streaming_train < num_prompts_per_step batch 1 batch 2 batch 3 ... step 1 tops itself up with 1 prompt from batch 2 now batch 2 is short, so it does the same to batch 3 step 1 is full The hole moves along the line, one batch at a time. Every step trains on a full batch — until the last one, which has no batch after it to take a prompt from. The final step is short and the run fails there, hours in: "rollout exhausted before a complete training step was assembled" where the two settings meet :871

Suggested fix: reject the combination in _warn_on_inert_failure_settings, which already works out whether the sampler issues a step number. It blocks nothing that works today. A committable suggestion is on the review comment.

design Finding 2 — a mode hidden inside a number, and two settings watching the same thing

Review comment on config.py:141

One setting hides a mode inside a number. max_consecutive_dropped_prompts: 0 does not mean "tolerate no drops and carry on". It means "end the whole run on the first one" — and the only way to learn that is to read the comment beside it.

# today — what happens is split across two fields, one of them a magic number on_dropped_prompt: shrink # or replace max_consecutive_dropped_prompts: 0 # 0 = end the run. Not obvious. # suggestion — the mode says WHAT happens, the budget says HOW MUCH is tolerated on_dropped_prompt: fail # fail | shrink | replace; "fail" is today's default max_consecutive_dropped_prompts: 8 # only read when the mode is not "fail"

It also measures the same thing the watchdog already measures, and the two defaults contradict each other:

One signal, two detectors, opposite default reactions has anything committed? the shared signal both read watchdog.stall_timeout_s counts TIME: nothing committed for 600s resets its clock when the count moves default: warn — print a line, keep running catches hangs too, not just given-up prompts max_consecutive_dropped_prompts counts PROMPTS: N given up in a row resets its counter when anything commits default: 0 — stop the run on the very first one fails faster, and more predictably Out of the box the run is both very forgiving and completely unforgiving about the same condition. The v1 stack answers this whole question with one setting. watchdog reset :1172 budget reset :1341

The fix is to make the defaults agree: a small non-zero budget as the fast, specific trip, and stall_action: abort as the catch-all backstop. There is a payoff for finding 1 in that — with the watchdog set to stop the run, the stall above becomes a bounded failure with a real error instead of an unbounded one burning GPUs. It does not fix it, but it caps the damage.

docs Finding 3 — four similar-sounding numbers, no stated relationship

Review comment on config.py:156 — documentation only, nothing is broken here

Four numbers decide how big a training step is. Two are settings you write in YAML, two are working values the trainer recomputes every pass of its loop, and the names do not say which is which: num_prompts_per_step, min_step_batch_fraction, min_groups_for_streaming_train, and the pair min_prompt_groups / max_prompt_groups that appear in the code.

They compose correctly under in_order — a step that legitimately shrank to 17 groups asks for 17 and gets 17, because the chunk size is capped by what the step still needs (single_controller.py:871). No bug. But two things catch people out, and neither is written down: the floor is a check, not a target (losing 1 prompt of 4 gives a target of 3, not 4 × fraction), and the chunk size never needs lowering to let a step shrink. One sentence on each field saying which thing it bounds would settle it.

The full breakdown of which numbers move and when is on part 2.

How much to trust this

Finding 1 is the only defect, and three reviewers reached it independently by reading the code; the boundary mismatch was then confirmed by hand. Nobody ran any of it. None of this came from a live failure — there is no run where a worker was killed and the stall was watched happening, and the unit tests do not cover a no-step-number sampler on the training side, which is why the suite stays green.

What would settle it in about an hour: start a short run with sampler.name: weight_fifo and max_consecutive_dropped_prompts: 1, force one prompt to fail, and watch whether training steps keep advancing. Findings 2 and 3 are judgement calls about the shape and naming of the settings, not defects — reasonable people can disagree, and they are worth a follow-up rather than blocking the PR.

What to do with this. Nothing shipped is affected — every new setting is off by default, and no config in the repo turns one on. Before you turn them on, check which sampler your run uses: they only do what they say with in_order. Two of the shipped SingleController recipes use windowed, which is the milder of the two failures but still ends the run at its last step.