[Qwen3-next] support mamba radix cache for overlap scheduler (#14792)

This commit is contained in:
Hanming Lu
2025-12-14 18:54:16 -08:00
committed by GitHub
parent 36e7c8c59f
commit e61dabf5e4
30 changed files with 1414 additions and 204 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
import inspect
import json
import os
import random
import numpy as np
import requests
@@ -79,8 +80,9 @@ def get_input_ids(
break
text = format_longbench_v2_example(example)
tokens = tokenizer.encode(text)
# Truncate to max_tokens
input_ids.append(tokens[:max_prompt_tokens])
# Truncate to a random length between 0.5x and 1.5x of max_prompt_tokens
truncate_len = int(max_prompt_tokens * random.uniform(0.5, 1.5))
input_ids.append(tokens[:truncate_len])
# Save to local cache
with open(cache_file, "w") as f: