PR #5097 (6 of 6 in the Megatron prefill/decode stack) ยท main a723b597 ยท #5097 head 751efd79 ยท Megatron-LM e0a4bfed ยท Dynamo nightly 1.8.0.dev20261117 (source read at 4573c9b6)
Four pages on #5097, one question each; the first chip is an earlier PR in the stack. This one: once images are allowed, who writes them to TQ, and how do they get there?
| Option | What it costs | Verdict |
|---|---|---|
Frontend sends processed pixels in extra_args; decode writes once | Pixels travel twice (prefill needs them for the encoder; decode only to write them). No new code path: Dynamo's prefill router clones the request for prefill and keeps extra_args on the decode request, so decode already receives them. | Recommended. Keeps one TQ write per call, with tokens, logprobs, routes and media together, and reuses today's begin/finalize code. |
| Frontend writes the pixels to TQ itself | Two writes per call: a failure between them can leave tokens without their media. The frontend's TQ client also turns from read-only into a writer. | No. |
| Prefill ships pixels to decode inside the KV handoff | Megatron-LM's handoff has no field for media; it needs a Megatron-LM wire change. | No. |
| Decode re-runs the HF processor | Wasted CPU, and the result can differ from what prefill encoded. | No. |
Two checks for the multimodal PR: (1) decode imports prefill's KV by block hash, so two prompts with the same token ids but different images must not share blocks โ confirm Megatron-LM's block hash covers the image, not only block_hash_salt; (2) #5097's adapter still marks the "decode gets the frontend's extra_args" fact as a DRAFT assumption (adapter.py L198); it holds at the pinned Dynamo nightly, so the note can cite the router code instead.