make radix cache deterministic (#10721)

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
This commit is contained in:
Alex Chi Z
2025-10-14 15:01:52 +02:00
committed by GitHub
parent 817e46f412
commit dc965db0e0
5 changed files with 81 additions and 17 deletions

View File

@@ -277,9 +277,10 @@ def test_deterministic(args):
elif args.test_mode == "prefix":
# In prefix mode, we create prompts from the same long prompt, with different lengths of common prefix.
len_prefix = [1, 511, 2048, 4097]
len_prefix = [1, 8000, 10000, 12500]
num_prompts = len(len_prefix)
outputs = {i: [] for i in range(4)}
assert all(i <= len(LONG_PROMPT) for i in len_prefix)
prompts = [LONG_PROMPT[: len_prefix[i]] for i in range(4)]
for i in range(args.n_start, args.n_start + args.n_trials):
batch_size = i