Repository navigation
feat(rm): add CLAP as a built-in reward that scores the soundtrack (--rm-type clap) - #424
Open
ruiling-smartbear wants to merge 1 commit into
Open
ruiling-smartbear wants to merge 1 commit into
ruiling-smartbear wants to merge 1 commit into
Conversation
ruiling-smartbear
requested review from
Rockdu,
guapisolo and
zhihengy
as code owners
November 25, 2026 08:46
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #413 and #422: the audio-video LTX recipe has no reward that hears the audio. This adds CLAP as a built-in reward,
--rm-type clap, scored onGeneratedMedia.audio.What
rm_hub/clap.py:ClapRewardActor(required_media = frozenset({"audio"})) andAsyncClapPool, standalone or colocated like the other pools. Score = cosine of CLAP's prompt and audio embeddings, in [−1, 1].laion/larger_clap_general(--clap-model-path), loaded with transformersClapModel, so no new dependency.clapinasync_rm,batched_async_rmandweighted_mixture_rm, e.g.--custom-rm-args "pickscore=1.0,clap=1.0".--clap-{num-workers,num-gpus-per-worker,reward-colocate,batch-size,model-path}, checked like the other pools'; docs inrewards.mdandcli-reference.md.Making the score a function of the clip
audio_sample_rateis_longerzeroedValidation
tests/fast/rollout/test_clap_reward.py(CPU): resampling, windowing, per-clip averaging, the pool refusing a sample with no audio and sending no video, dispatch, argument checks.tests/fast/rolloutpasses (237).tests/fast-gpu/test_clap_scorer.py: both an unfused and a fusion checkpoint; each caption prefers its own clip, a clip scores the same alone and in a batch, a long clip scores the same on every call. Passes on CPU; the same tests passed on an H200 before the port onto feat(rm): score GeneratedMedia and let each reward declare the fields it requires #422.Slope +0.0033 per rollout (t = 4.4); per-rollout std ~0.14, so the reward is not constant within a group.
No recipe changes here; a PickScore + CLAP recipe for the audio-video run can follow once there is a reference curve on the 5-GPU setup.