okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Hugua700bench: RX 6800M (gfx1031) community report - self-built HIP engine on Windows (#1078)1be67e894

main
1.4 KiB42 linesraw
1#!/usr/bin/env python3
2"""Recall checks: put a needle at several depths and verify the answer.
3
4Reuses the prompt builder from strata-bench.py so the prompts are identical in shape.
5"""
6from __future__ import annotations
7
8import importlib.util
9import json
10import random
11from pathlib import Path
12
13spec = importlib.util.spec_from_file_location("sb", r"F:\harness\strata-bench.py")
14sb = importlib.util.module_from_spec(spec)
15spec.loader.exec_module(sb)
16
17CHECKS = [
18    (2048, 0.25),
19    (2048, 0.50),
20    (2048, 0.75),
21    (8192, 0.25),
22    (8192, 0.50),
23    (8192, 0.75),
24]
25
26rows = []
27print(f"{'target':>7}{'depth':>7}{'prompt_n':>10}{'prompt_tok/s':>14}{'found':>8}   answer")
28print("-" * 90)
29for size, depth in CHECKS:
30    prompt = sb.build_prompt(size, needle_depth=depth, nonce=f"recall-{random.randrange(10**9)}")
31    r = sb.call(prompt, max_tokens=32)
32    ans = (r.get("answer_head") or "").strip()
33    ok = sb.NEEDLE.lower() in ans.lower()
34    r.update(target=size, depth=depth, needle=sb.NEEDLE, found=ok)
35    rows.append(r)
36    print(f"{size:>7}{depth:>7.2f}{r.get('prompt_n'):>10}{r.get('prompt_tok_s'):>14.1f}{('YES' if ok else 'NO'):>8}   {ans[:40]!r}")
37
38out = Path(r"F:\harness\strata-bench\strata-bench-recall.json")
39out.parent.mkdir(parents=True, exist_ok=True)
40out.write_text(json.dumps({"needle": sb.NEEDLE, "checks": rows}, ensure_ascii=False, indent=1),
41               encoding="utf-8")
42print(f"\n{sum(1 for r in rows if r['found'])}/{len(rows)} found  ->  {out}")