rtx-csm: drop Mimi reload cadence to every-10 clips

Empirical: with 25-clip cadence the cumulative state still tipped over
once at position 8102 mid-window during a 167-clip lora_eval load.
Drop to 10 — costs ~200ms×(N/10) at load time but eliminates the
state-leak panic across every corpus size we've tried up to 1505 clips.

Found while running the first successful 3-lecture Amini corpus through
the full data-prep + train + eval pipeline.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-04-28 16:33:55 -07:00
co-authored by Claude Opus 4.7
parent d42aba0f1b
commit 0568dd3653
+5 -4
View File
@@ -193,10 +193,11 @@ impl TrainingDataset {
let speaker = row.speaker.unwrap_or(default_speaker);
let audio = audio_io::load_mono_24k(&wav_path)?;
// Mimi's transformer carries a position counter across encode()
// calls that `reset_state()` does NOT fully clear. Without an
// explicit reload it overflows after ~80-100 clips with
// `narrow invalid args [8192, 32]`. Reload every 50 clips.
if !examples.is_empty() && examples.len() % 50 == 0 {
// calls that `reset_state()` does NOT fully clear. Reload every
// 10 clips — empirical floor; 25 still tipped over occasionally
// (single-window cumulative reaches ~8102 frames before the
// 25-clip mark). Cost: ~200ms × N/10 reload overhead at load.
if !examples.is_empty() && examples.len() % 10 == 0 {
generator.mimi.reload().map_err(|e| {
CsmError::Config(format!("mimi reload at clip {}: {e}", examples.len()))
})?;