jaytonde05's picture
Add KV cache quantization run commands
9d6c277 verified
Raw History Blame Contribute Delete
637 Bytes
"""Lean RULER subsets: first 20 items per task (13 tasks) at 4K/32K/128K -> 260 rows each."""
import json, os, collections
os.chdir(os.path.expanduser("~/bench/data"))
for n in ["4k", "32k", "128k"]:
rows = [json.loads(l) for l in open(f"ruler_{n}.jsonl")]
seen, out = collections.Counter(), []
for r in rows:
if seen[r["task"]] < 20:
out.append(r); seen[r["task"]] += 1
with open(f"ruler_{n}_260.jsonl", "w") as f:
for r in out:
f.write(json.dumps(r, ensure_ascii=False) + "\n")
print(f"ruler_{n}_260.jsonl", len(out), dict(seen) == {t: 20 for t in seen}, len(seen), "tasks")