[Model] Enable Higgs Audio v3 MRV2 streaming and fix mixed-prefill capture bounds (#8226)

Signed-off-by: Sy03 <1370724210@qq.com>
This commit is contained in:
Sy03 authored and GitHub committed 2026-09-30 11:32:27 +00:00
1 parent b44b2f981c
commit 56763cd6c3
35 files changed
+3231 -90

No files matched your search

@@ -215,6 +215,8 @@ class _MiniDiT(nn.Module):
cnn_cache_buffer[b_idx] = x[:, -2:, :].transpose(1, 2).contiguous()
dt = x.shape[1]
att_cache_buffer[b_idx][:, :, :dt, :] = x.unsqueeze(1)
if att_b is not None:
att_cache_buffer[b_idx][:, :, dt:, :] = att_b
x = self.final_layer(x)
x = x.transpose(1, 2)
return x
@@ -248,6 +250,9 @@ def test_cfm_graph_replay_matches_eager_for_uncached_and_cached_shapes(
with torch.inference_mode():
for _, chunk_size, old_att_len in ((2, 10, 0), (2, 10, 5)):
inputs = _cfm_inputs(2, chunk_size, old_att_len)
# A cache output must overwrite every row, including the old tail.
inputs[4].fill_(float("nan"))
inputs[5].fill_(float("nan"))
eager_inputs = tuple(v.clone() for v in inputs)
with torch.no_grad():
@@ -268,6 +273,8 @@ def test_cfm_graph_replay_matches_eager_for_uncached_and_cached_shapes(
torch.testing.assert_close(graph_result, eager_result, rtol=1e-4, atol=1e-5)
torch.testing.assert_close(graph_cnn, eager_inputs[4], rtol=1e-4, atol=1e-5)
torch.testing.assert_close(graph_att, eager_inputs[5], rtol=1e-4, atol=1e-5)
assert torch.isfinite(graph_att).all()
torch.testing.assert_close(graph_att[:, :, :, chunk_size:, :], inputs[3])
wrapper._flush()