Add online current-tail LoRA benchmark

This commit is contained in:
Xin Wang
2026-08-23 15:10:16 +08:00
parent 1069a0beee
commit dc932cc165
2 changed files with 236 additions and 17 deletions
+8 -1
View File
@@ -192,6 +192,7 @@ def reconstruct_open_stream_sequence(
store: CachedBlockStore,
static: dict[str, Any],
anchor: dict[str, Any],
current_piece: dict[str, torch.Tensor] | None = None,
) -> tuple[torch.Tensor, torch.LongTensor]:
"""Materialize one differentiable Thinker input from frozen AV embeddings.
@@ -219,7 +220,13 @@ def reconstruct_open_stream_sequence(
last_shift = 0
for sequence_index, (block_index, tail_steps) in enumerate(selected):
piece = store.variant(block_index, tail_steps)
is_current = sequence_index == len(selected) - 1
piece = (
current_piece
if is_current and current_piece is not None
else store.variant(block_index, tail_steps)
)
validate_piece(piece)
local_payload_positions = _strip_position_batch(piece["payload_position_ids"])
local_payload_base = int(local_payload_positions.min().item())
if first_payload_base is None: