[refactor] Translate into english, void Chinese due to claude.

This commit is contained in:
Zijie Tian
2025-12-11 00:30:24 +08:00
parent e85c2b4776
commit babfa17354
9 changed files with 297 additions and 187 deletions

View File

@@ -27,8 +27,11 @@ class Context:
prev_kv_chunks: List[Tuple[torch.Tensor, torch.Tensor]] = field(default_factory=list)
# Current sequence being processed (for chunked prefill to load KV)
chunked_seq: Any = None
# Position within block for decode (used for reading from Decode)
# Position within block for decode (used for reading from Decode region)
decode_pos_in_block: int = 0
# Starting position within block where decode tokens began (for accumulated token tracking)
# Used when batching decode offloads - we need to attend to all accumulated tokens
decode_start_pos_in_block: int = 0
_CONTEXT = Context()
@@ -53,6 +56,7 @@ def set_context(
offload_engine=None,
chunked_seq=None,
decode_pos_in_block=0,
decode_start_pos_in_block=0,
):
global _CONTEXT
_CONTEXT = Context(
@@ -70,6 +74,7 @@ def set_context(
offload_engine=offload_engine,
chunked_seq=chunked_seq,
decode_pos_in_block=decode_pos_in_block,
decode_start_pos_in_block=decode_start_pos_in_block,
)