[mem_cache] Move kv_committed_len into ReqKvInfo (#37078)

This commit is contained in:
Liangsheng Yin
2026-08-29 22:42:25 -07:00
committed by GitHub
parent 5b7c62d5d6
commit 0438b16154
37 changed files with 117 additions and 116 deletions
@@ -96,10 +96,10 @@ class TestSWABasic(ScriptedTestCase):
r = t.start_req(prompt_len=VERY_LONG_PROMPT_LEN, max_new_tokens=2)
for _ in range(400):
if r.is_chunking:
assert len(r.req.prefix_indices) <= r.req.kv_committed_len, (
assert len(r.req.prefix_indices) <= r.req.kv.kv_committed_len, (
f"prefix_indices must be bounded by kv_committed_len, "
f"got prefix_indices_len={len(r.req.prefix_indices)}, "
f"kv_committed_len={r.req.kv_committed_len}"
f"kv_committed_len={r.req.kv.kv_committed_len}"
)
if r.finished:
break
@@ -509,7 +509,7 @@ class TestRegressionGptOss(ScriptedTestCase):
r = t.start_req(prompt_len=VERY_LONG_PROMPT_LEN, max_new_tokens=2)
yield from run_until(r, lambda h: h.is_chunking and h.chunks_done >= 1)
committed = r.req.kv_committed_len
committed = r.req.kv.kv_committed_len
assert committed > 0
assert len(r.req.prefix_indices) <= committed, (
@@ -225,10 +225,10 @@ class TestSpecialCaseBasic(ScriptedTestCase):
)
for _ in range(DEFAULT_MAX_STEPS):
if r.is_chunking:
assert len(r.req.prefix_indices) <= r.req.kv_committed_len, (
assert len(r.req.prefix_indices) <= r.req.kv.kv_committed_len, (
f"streaming-session chunked stash must stay bounded by "
f"kv_committed_len; prefix_indices_len={len(r.req.prefix_indices)}, "
f"kv_committed_len={r.req.kv_committed_len}"
f"kv_committed_len={r.req.kv.kv_committed_len}"
)
if r.finished:
break