Compare MTP steps and prefill batches; retain qualified MTP 2 baseline
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Paired API qualification. Run identically on baseline and MTP; synthetic data only."""
|
||||
import argparse,base64,concurrent.futures,hashlib,json,random,time,urllib.request
|
||||
from pathlib import Path
|
||||
p=argparse.ArgumentParser();p.add_argument('--output',type=Path,required=True);p.add_argument('--soak-seconds',type=int,default=600);p.add_argument('--assets',type=Path,default=Path('/data/flash-next/cache/qualification'));a=p.parse_args()
|
||||
p=argparse.ArgumentParser();p.add_argument('--output',type=Path,required=True);p.add_argument('--soak-seconds',type=int,default=600);p.add_argument('--screen',action='store_true',help='Skip 16K output and soak for parameter screening');p.add_argument('--assets',type=Path,default=Path('/data/flash-next/cache/qualification'));a=p.parse_args()
|
||||
key=(Path(__file__).resolve().parents[1]/'secrets/api-key').read_text().strip();url='http://127.0.0.1:8000';model='qwen3.8-flash-next'
|
||||
def req(path,body=None):
|
||||
return urllib.request.urlopen(urllib.request.Request(url+path,data=None if body is None else json.dumps(body).encode(),headers={'Authorization':'Bearer '+key,'Content-Type':'application/json'}),timeout=1200)
|
||||
@@ -65,7 +65,7 @@ with a.output.open('x') as out:
|
||||
for tag,prompt in prompts:
|
||||
record(run('warmup-'+tag,text(prompt),256,forced=True,effort='xhigh'))
|
||||
for i in range(3):record(run(f'perf-{tag}-{i}',text(prompt),2048,forced=True,effort='xhigh'))
|
||||
record(run('long-output-16384',text('Write an extensive technical textbook chapter explaining algorithms, with many worked examples and Python implementations. Continue with additional examples throughout.'),16384,forced=True,effort='xhigh'))
|
||||
if not a.screen:record(run('long-output-16384',text('Write an extensive technical textbook chapter explaining algorithms, with many worked examples and Python implementations. Continue with additional examples throughout.'),16384,forced=True,effort='xhigh'))
|
||||
# Exact token count, fresh random filler, two needles at separated positions.
|
||||
rng=random.Random(927);lines=[f'Item {i:06d}: batch {rng.randrange(10**8):08d}, archived in shelf {rng.randrange(1000):03d}.\n' for i in range(16000)]
|
||||
lines[20]='The northern access code is NORTH-49273.\n';lines[2500]='The southern access code is SOUTH-18362.\n'
|
||||
@@ -87,7 +87,7 @@ with a.output.open('x') as out:
|
||||
fs=[pool.submit(run,f'queued-{i}',text(f'Compute {43+i} * 17. Reply only with the integer.'),2048,str((43+i)*17)) for i in range(4)]
|
||||
for f in concurrent.futures.as_completed(fs):record(f.result())
|
||||
start=time.monotonic();i=0
|
||||
while time.monotonic()-start<a.soak_seconds:
|
||||
while not a.screen and time.monotonic()-start<a.soak_seconds:
|
||||
mode=i%5
|
||||
if mode==0:r=run(f'soak-{i}-long',longmessages,4096,['NORTH-49273','SOUTH-18362'])
|
||||
elif mode==1:r=run(f'soak-{i}-image',image_msgs,4096,['SPARK-82741','1368'])
|
||||
|
||||
Reference in New Issue
Block a user