[mem_cache] Move req_pool_idx into ReqKvInfo (#37094)
This commit is contained in:
@@ -19,7 +19,7 @@ def _drain_until_released(t, *handles):
|
||||
if all(
|
||||
h.kv_pages == 0
|
||||
and h.lock_refs == 0
|
||||
and (h.req is None or h.req.req_pool_idx is None)
|
||||
and (h.req is None or h.req.kv.req_pool_idx is None)
|
||||
for h in handles
|
||||
):
|
||||
return
|
||||
@@ -41,7 +41,7 @@ class TestRegressionBasic(ScriptedTestCase):
|
||||
yield from _drain_until_released(t, r)
|
||||
|
||||
assert r.kv_pages == 0
|
||||
assert r.req.req_pool_idx is None
|
||||
assert r.req.kv.req_pool_idx is None
|
||||
assert r.lock_refs == 0
|
||||
assert not r.is_chunking
|
||||
assert r.req.inflight_middle_chunks == 0
|
||||
@@ -58,7 +58,7 @@ class TestRegressionBasic(ScriptedTestCase):
|
||||
yield
|
||||
|
||||
assert r.kv_pages == 0
|
||||
assert r.req.req_pool_idx is None
|
||||
assert r.req.kv.req_pool_idx is None
|
||||
assert r.lock_refs == 0
|
||||
assert not r.is_chunking
|
||||
|
||||
@@ -240,7 +240,7 @@ class TestRegressionBasic(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)
|
||||
|
||||
assert r.req.req_pool_idx is not None, "row must be held mid-chunk"
|
||||
assert r.req.kv.req_pool_idx is not None, "row must be held mid-chunk"
|
||||
assert r.kv_pages > 0, "committed KV must be held mid-chunk"
|
||||
assert r.lock_refs >= 1, "radix lock_ref must be held mid-chunk"
|
||||
|
||||
@@ -248,8 +248,8 @@ class TestRegressionBasic(ScriptedTestCase):
|
||||
yield from _drain_until_released(t, r)
|
||||
|
||||
assert (
|
||||
r.req.req_pool_idx is None
|
||||
), f"96d4749094: abort must release row; got row_idx={r.req.req_pool_idx!r}"
|
||||
r.req.kv.req_pool_idx is None
|
||||
), f"96d4749094: abort must release row; got row_idx={r.req.kv.req_pool_idx!r}"
|
||||
assert (
|
||||
r.kv_pages == 0
|
||||
), f"96d4749094: abort must release KV; got kv_pages={r.kv_pages}"
|
||||
@@ -269,14 +269,14 @@ class TestRegressionBasic(ScriptedTestCase):
|
||||
def _script_pause_retract_releases_waiting_chunked_resume(t: ScriptedContext):
|
||||
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)
|
||||
assert r.req.req_pool_idx is not None and r.kv_pages > 0 and r.lock_refs >= 1
|
||||
assert r.req.kv.req_pool_idx is not None and r.kv_pages > 0 and r.lock_refs >= 1
|
||||
|
||||
t.pause_generation(mode="retract")
|
||||
yield
|
||||
|
||||
assert r.req.req_pool_idx is None, (
|
||||
assert r.req.kv.req_pool_idx is None, (
|
||||
f"f38e69f87d: pause(retract) must release waiting "
|
||||
f"chunked-resume row; got row_idx={r.req.req_pool_idx!r}"
|
||||
f"chunked-resume row; got row_idx={r.req.kv.req_pool_idx!r}"
|
||||
)
|
||||
assert r.kv_pages == 0
|
||||
assert r.lock_refs == 0
|
||||
|
||||
Reference in New Issue
Block a user