Skip to content

fix(rollout): read the waveform from the response's audio stream - #408

Merged
Rockdu merged 2 commits into
mainfrom
rockdu/rollout-waveform-from-extra-streams
Nov 24, 2026
Merged

Rockdu merged 2 commits into
mainfrom
rockdu/rollout-waveform-from-extra-streams

Conversation

@Rockdu

@Rockdu Rockdu commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Independent of the AV rollout stack (#403 … #407); based on main.

This branch also carries #422, which was merged into it: rewards score GeneratedMedia and each scorer declares required_media (commit 3dcb12a). Its description and its run-ci-e2e run (45373265854, all stages green on this branch's tree) are on #422. Merged into main with a rebase merge, so the two commits stay separate.

What

  • A sample's waveform is read from the response's audio stream: extra_streams.audio.generated_output and .sample_rate ([Feat] diffusion: [sglang-miles] Roll out the LTX-2 audio stream as a named extra stream sgl-project/sglang#51078). The parser used to read a top-level generated_audio / audio_sample_rate, which the engine does not send, so Sample.generated_audio was always None and saved or logged videos had no sound.
  • With --use-output-store, a training rollout's waveform is a store ref like its video. release_generated_outputs now releases it with the sample's output: the few samples kept for media logging read it back as a tensor, the others drop it, and both fields are deleted from the store.
  • docs/models/h3/h3.md said the saved eval videos are silent until an engine change adds audio to the rollout response. With the parser fixed they carry the engine's audio track, so that sentence is replaced.

Why

write_sample_media muxes sample.generated_audio into the mp4. Once the parser fills that field, a waveform left as a store ref would reach the muxer in the media-logging thread and fail there, and that round's videos would not be logged either. So the release has to change in the same PR as the parser.

Behaviour change: eval media and logged training media of models that return audio (LTX, H3) gain their audio track. For LTX video-only recipes the engine runs with audio-video cross attention patched off, so that track comes from an audio branch that did not see the video.

With --rm-type none the engine skips the whole decode stage, so there is no waveform either; "has a waveform" implies "has a generated output", which is why the release keeps selecting samples by their stored output.

GPU run

At the previous head 13aa699, merged with the audio-video recipe branch of #413: a 100-rollout LTX-2.3 audio-video Flow-GRPO run on 5 H200 with the output store on. All 40 logged training videos carry an audio track, so the LTX waveform layout is the [C, L] that _mux_audio assumes and media logging with the store on writes sound.

Not validated

  • No GPU run at the current head fd1f509, which rewrote how release_generated_outputs names the fields it deletes (same behaviour, covered by the CPU tests).
  • H3: that its saved eval videos now have sound is traced through the code (the engine sends the audio stream on eval responses too), not run.

Validation

CPU only.

Scope Commit Result
tests/fast/rollout, tests/fast/utils/test_diffusion_rollout_response.py, test_api_rm_config.py, test_output_store_materialize.py, on Linux (two test_sft_read_media.py cases that need a writable HF cache are deselected; they fail on main there too) fd1f509, on main 4cb1a29 243 passed
tests/fast/rollout and tests/fast/utils on macOS (minus two files that fail on main on that machine) 13aa699 419 passed
Mutation check: 4 single-line breaks 13aa699, not re-run each turns a test red

The four mutations: the waveform read from the top level; a released sample keeping its waveform's store ref; only the output field deleted; the waveform read through the video layout normalisation.

Files

  • miles/utils/diffusion_rollout_response.py: read the waveform from the audio stream.
  • miles/rollout/sglang_diffusion_rollout.py: release_generated_outputs handles a stored waveform.
  • miles/utils/types.py: field comment.
  • docs/models/h3/h3.md: the sentence about silent eval videos.
  • tests/fast/utils/test_diffusion_rollout_response.py, tests/fast/rollout/test_generated_output_store.py: the cases above.

Checklist

  • pre-commit run --all-files passes — run on the touched files only, clean (at fd1f509)
  • Added/updated tests for new behaviour
  • pytest -x is green — CPU subset only, see Validation
  • If launch flags changed, python3 train.py --help still parses — no flag changed
  • If a public flag was added, it appears in the CLI reference docs — none added
  • If an example was added, it has a real walkthrough — none added

@Rockdu
Rockdu marked this pull request as ready for review November 24, 2026 23:28
@Rockdu
Rockdu merged commit a48dc5b into main Nov 24, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant