Refactor: Moving extend_logprob_start_len calculation out of prepare_for_extend (#16105)

This commit is contained in:
Cheng Wan
2025-12-30 12:38:33 +08:00
committed by GitHub
parent 9e263c2162
commit 60f1ca6925
7 changed files with 25 additions and 36 deletions
+1 -1
View File
@@ -92,8 +92,8 @@ class TestForwardSplitPrefill(CustomTestCase):
sampling_params=sampling_params,
)
req.fill_ids = req.origin_input_ids
req.extend_input_len = len(req.fill_ids) - len(req.prefix_indices)
req.logprob_start_len = -1
req.set_extend_input_len(len(req.fill_ids) - len(req.prefix_indices))
reqs.append(req)
# Create dummy tree_cache for tests (no prefix caching, just allocation)
+1
View File
@@ -68,6 +68,7 @@ class TestPrefillAdder(CustomTestCase):
req.rid = str(rid)
req.priority = priority
req.extend_input_len = 0
req.extend_logprob_start_len = 0
req.output_ids = [0] * output_len
req.sampling_params = SimpleNamespace(max_new_tokens=max_new_tokens)
req.time_stats = SimpleNamespace(wait_queue_entry_time=wait_time)