Size review of NVIDIA-NeMo/RL #4612. Line counts are from git diff 0bf5789 2548c67 (the PR against its real base, #4583). Permalinks pin the head 2548c679. Review comments are in a pending review; their links work once it is published.
Three pages on this PR โ this one: how big it is, and what can go.
vLLM 0.29 keeps each running request's routes in a private list, routed_experts_chunks, and only hands them out when the request ends. That list is only ever appended to. Rows already in it never change. So the rows a cut needs are simply the first N rows of that list at the moment of the cut. The PR instead copies every new piece as it arrives, carries it through the HTTP layer, and keeps it in buffers that a cut swaps, saves, or rolls back.
Same tiny example as page 1: prompt 10, 11, tokens 12, 13 at the first cut. L = MoE layers, K = experts per token. Both ways give the rows [1, 2, 3]. Two reviewers checked the vLLM source: the scheduler never re-sends rows for a position, and a finished request's list is dropped in the same step as its final output, which is why a cut that races the end must use the final routes.
| What the PR writes | Replace with | source lines |
|---|---|---|
Per-token route copies, the 3 extra output fields, the piece counter, route buffers in freeze/seal/rollback, the unused public snapshot_new_routed_expert_chunksreview comment โ vllm_worker_async.py:391 review comment โ vllm_worker_async.py:449 | One read at cut time (above). Removes ~190, adds ~40. | ~150 |
| A third copy of the "which int type is this route string" lookup (:1442) | Let decode_routed_experts keep the type written in the string | ~7 |
| The placeholder row, built twice (:231, :622). The two must match byte for byte or every resume fails its check. | One helper used in both places | ~6 |
| Checks that cannot fire: two "changed model dimensions" checks, one length check, and a fetch branch no source reaches (:558) review comment โ generation_cut_capture.py:183 review comment โ generation_cut_capture.py:558 | Delete | ~14 |
| Tests: the two large router-replay tests repeat ~17-line fake vLLM outputs and inventories by hand | A small _observe helper, the file's existing _single_generation_cut_inventory, dataclasses.replace | ~125 test |
Not worth changing: the resume join and the final merge. A reviewer tried to reuse the existing route assembler, execute_route_plan, there. The saved pieces have a different row layout, so it would need a new mode in shared training code.