[Performance][MiniCPM-o] Whole-Euler CUDA graphs for Code2Wav with a shared attention arena (#8007)

This commit is contained in:
BeatSeat authored and GitHub committed 2026-09-29 09:14:12 +10:00
1 parent 0173cb3748
commit 3e62bba3cb
15 files changed
+3425 -210

No files matched your search

@@ -114,6 +114,7 @@ def _patched_estimator_step(
attn_mask=None,
valid_lengths=None,
valid_frames=None,
time_embedding=None,
):
assert _original_estimator_step is not None
graph_runner = _backend_graph_runners.get(self)
@@ -137,6 +138,7 @@ def _patched_estimator_step(
attn_mask=attn_mask,
valid_lengths=valid_lengths,
valid_frames=valid_frames,
time_embedding=time_embedding,
)
if (cnn_cache is None) != (att_cache is None):
raise ValueError("estimator CNN and attention caches must both be present or absent")
@@ -148,7 +150,8 @@ def _patched_estimator_step(
# The upstream embedder creates a frequency tensor on the host. Keep it
# outside capture while retaining the tensor-only estimator body in graph.
time_embedding = estimator.t_embedder(time).unsqueeze(1)
if time_embedding is None:
time_embedding = estimator.t_embedder(time).unsqueeze(1)
if cnn_cache is None:
return graph_runner.run(
"cfm_estimator",