Add caching mechanism for completed AV blocks in streaming model. Introduce CompletedBlockPieceCache class to manage reusable blocks during strict-window replay, enhancing efficiency. Update profiling hooks for cache operations and refine README documentation to reflect changes in block handling and replay strategies.

This commit is contained in:
Xin Wang
2026-08-18 11:02:42 +08:00
parent d610305355
commit 43f47e8f3a
4 changed files with 220 additions and 22 deletions
+11 -1
View File
@@ -231,6 +231,16 @@ def _install_profiling_hooks() -> None:
"_cache_from_intervals",
"rolling_cache_rebuild",
)
_patch_function(
core.CompletedBlockPieceCache,
"put",
"completed_block_cache_store",
)
_patch_function(
core.CompletedBlockPieceCache,
"get_many",
"completed_block_cache_lookup",
)
_patch_function(torch, "save", "output_save")
original_extract = core.OpenStreamReplayExtractor.extract
@@ -423,7 +433,7 @@ def _print_summary(
bottleneck = max(totals, key=totals.get)
advice = {
"media_frames": "bulk-decode/cache the selected 2-FPS resized frames",
"processor": "cache processor-ready AV tensors for every causal prefix",
"processor": "prefetch or microbatch the ten causal prefixes per 2-s block",
"audio_tower": "microbatch the ten 0.2-s prefixes in each 2-s block",
"video_tower": "cache unique 2-FPS visual inputs and batch equal shapes",
"tmrope": "cache position IDs for the ten repeated prefix shapes",