diff --git a/docs/experiments/strata-batch-groups-2026-10-14/README.md b/docs/experiments/strata-batch-groups-2026-10-14/README.md new file mode 100644 index 0000000..128267d --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/README.md @@ -0,0 +1,205 @@ +# Dual-slot batch-group comparison, 2026-10-14 + +Requested by the user after the OpenWebUI background automation was identified +as a separate cause of destructive profile switches and lost context caches. +OpenWebUI stays stopped. No private chats, prompts or production logs enter +this benchmark. Only synthetic requests are generated. + +## Fixed setup + +- Existing Strata 0.1.43.1; commit from the installed `ready.json` is recorded + in `metadata.json`. The previously requested version update is separate. +- Existing GSQ-RCO IQ3_XXS weights, GPU order RTX 3060 then RTX 5080, + layer split 16 and current measured expert-cache tuning unchanged. +- Parallel 2, context 262144 per slot; int8 KV, resident KV window 32768. +- Same CPU vision encoder as production, enabled even for these text tests. +- Own isolated container: 44 GiB cgroup memory, no additional swap, + six CPU equivalents, UID 65534, read-only root filesystem and production + mounts, no network except its own loopback. Only the experiment directory + is writable. Production Deck and CPU STT remain running. +- Existing resident-expert mode and 6-GiB headroom retained. Record the + *resolved* pinned expert budget in both arms: it is sized automatically + from available RAM, so materially different budgets confound a comparison. + +## Arms and measurements + +1. `serial_mtp`: `--batch-mtp --batch-groups 1`, the current configuration. +2. `pipeline`: `--batch-mtp --batch-groups auto`. The official engine gives + the explicit pipeline precedence and disables batch-MTP in this arm. + +Same deterministic prompts and output limits in both arms. Two repetitions +of a short solo request and two concurrent short requests (512 output tokens +each). Then two distinct conversations of approximately 64K and 128K tokens +each: simultaneous cold requests (256 output tokens), followed by simultaneous +cached continuations (512 output tokens). Token counts use the installed +tokenizer, not character estimates. These are speed/resource tests, not +quality benchmarks or proof that two full 262K windows fit. + +Record backend input/output timing, request wall time and TTFT, usage/cache +counts, observed overlapping batch slots, cgroup peak memory, major faults, +file-page refaults, memory-limit events, full memory PSI, actual disk reads, +CPU utilization and sampled GPU utilization/memory. Aggregate wall-time +throughput includes prefill/waiting and must not be confused with the sum of +backend decode rates. Solo-path `/slots` reporting is incomplete upstream; +zero processing slots is not treated as no computation. + +## Execution and restoration + +Stage `/opt/athena-deck-dev/batch-ab-20261014`, output +`/data/experiments/strata-batch-ab-20261014`, own transient service +`athena-strata-batch-ab-20261014`, own container of the same name. + +Before launch: API idle verified, original configuration converted into a +synthetic test template with its real API credential removed. LLM unloaded +through authenticated Deck GUI; both GPUs verified free. No Deck, OpenCode, +OpenWebUI or host restart. No production profile changes. Launcher restores +the previous Dual profile through the regular API with a minimal synthetic +request after its test container exits, unless new production activity is +already present. Restoration must be verified from `restore.json` and status. + +The scripts also run on the future native deployment using the same pinned +runtime; `benchmark.py` has no Docker dependency. The current `launch.py` +uses Docker only to reproduce the existing container limits and read-only +mounts. A native launcher must use equivalent systemd resource limits and +configured paths; this experiment is not a native fresh-host restore proof. + +Official batching documentation at the tested commit: +https://github.com/Niko1221/Strata/blob/a0116b2782a5b82622358c04a06496485d12b2d6/docs/BATCHING.md + +## First series: automatic expert budget + +Completed all 16 cases without an OOM kill or server failure. Individual +measurements, not confidence intervals. Saved metrics: `results-auto.json`. + +| Workload | Serial + batch-MTP | Pipeline | +| --- | ---: | ---: | +| Short solo, backend output token/s (two repeats) | 57.5 / 68.0 | 55.1 / 66.9 | +| Two short requests, backend output token/s per request | 35.6–41.0 | 48.8–54.7 | +| Two short requests, completion wall time (two repeats) | 15.3 / 14.1 s | 11.4 / 11.0 s | +| Two fresh ~64K prompts, total wall time | 181.9 s | 159.4 s | +| Their next turns, total wall time | 21.0 s | 90.1 s | +| Two fresh ~128K prompts, total wall time | 343.9 s | 338.2 s | +| Their next turns, total wall time | 20.6 s | 186.5 s | +| Storage read for fresh ~128K pair | 332.6 GiB | 309.2 GiB | +| Full cgroup memory PSI during that pair | 30.9% | 32.9% | + +The automatically pinned expert complement differed: 20.56 GiB serial versus +16.77 GiB pipeline, despite identical 44-GiB limits and 6-GiB headroom. The +second engine's initial cgroup accounted 9.0 GiB versus 2.2 GiB at the first +start; its automatic budget reading was lower. Neither engine had a surviving +predecessor or duplicated vision process. Thus this series measures the actual +two startup outcomes; **do not attribute every difference solely to batching**. +No host cache flush was performed. + +Both arms borrowed 4,681 expert GPU-cache slots (~7.26 GiB in total) for prompt +processing, with **zero RAM copies** of those borrowed experts. The engine +explicitly reported reading these experts from the model files each chunk. +Both fresh-128K measurements reached the 44-GiB cgroup limit, with substantial +page refaults and approximately one busy CPU core. This reproduces the +memory/storage bottleneck independently of OpenWebUI and profile switching. + +The serial continuations reused both conversation prefixes. In both pipeline +continuation pairs, one request reused its prefix and the other reused zero +tokens (65,807 and ~131K tokens reread). The slow partner also delayed decode +of the already cached conversation. Backend decode timings can include this +interference; use wall times and cache counts together. + +Installed `serve/server.py`, `StrataEngine.pick_slot`, lines 1647 onward, explicitly +handles pipelined slot groups without retaining a pipelined slot as a +conversation cache. It prioritizes filling group holes/spreading slots; +the non-pipeline branch instead prefers the longest held prompt prefix. +The observed cache limitation is therefore supported by both measurements +and source, not an assertion of model reasoning failure. + +## Controlled follow-up + +`strata-batch-fixed16-20261014`: same runtime, limits and prompts, one short +solo/parallel repetition and the fresh/cached ~64K pair, requesting an explicit +`--resident-budget-gib 16` in both arms. This caps pinned experts, not +total process RAM. Launched only after the first series completed and its +regular restoration was confirmed, then regular GUI unload and GPU-free +verification were repeated. No production settings changed. + +**Important correction:** requesting a cap does not guarantee its allocation. +Serial actually obtained 16.00 GiB; the second pipeline startup was further +clamped to 12.77 GiB. This pair is therefore not a controlled 16-vs-16 result. +Record that lower-budget pipeline separately, not as evidence for the flag's +isolated effect. The serial 16-GiB run took 201.1 s / 182.1 GiB storage reads +for the fresh 64K pair, with 29.8% full PSI; its cached pair took 21.7 s. +Compared with the automatic serial run, lowering the pinned budget did not +remove the observed bottleneck. Order/cache effects still limit that comparison. + +`strata-batch-fresh16-20261014` repeats **only pipeline** in a fresh isolated +container/cgroup with the same requested 16-GiB cap, short requests and same +64K fixtures. The resolved allocation must equal the serial arm's 16.00 GiB +before treating this as a controlled-budget comparison. Starting each arm in +its own cgroup avoids carrying the preceding arm's accounted pages into the +next startup's budget decision. No global cache flushing is used, so this does +not establish identical physical page-cache state or cold-start I/O. + +The separate pipeline container confirmed **16.00 GiB**, matching serial. +The corrected countercheck completed all four cases, without OOM or failure. +`results-cap16-sequential.json` contains the serial 16-GiB arm and the explicitly +non-comparable pipeline 12.77-GiB arm; `results-cap16-fresh-pipeline.json` +contains the valid 16-GiB pipeline arm. `resolved-settings.json` records the +allocations and resolved flag semantics. + +| Same 16-GiB expert budget | Serial + batch-MTP | Pipeline | +| --- | ---: | ---: | +| Short solo, backend output token/s | 54.2 | 56.8 | +| Two short requests, backend output token/s per request | 35.2 / 37.7 | 52.4 / 48.8 | +| Two short requests, completion wall time | 15.4 s | 11.3 s | +| Two fresh ~64K prompts, total wall time | 201.1 s | 162.0 s | +| Their next turns, total wall time | 21.7 s | 98.3 s | +| Storage read for fresh pair | 182.1 GiB | 138.9 GiB | +| Full memory PSI during fresh pair | 29.8% | 29.7% | +| Storage read for next turns | 3.7 GiB | 76.2 GiB | +| Reused prefix in both next turns? | Yes | No: one request reused zero tokens | + +These remain single, ordered measurements without forced cold physical +page-cache state. The similar effect across the automatic-budget series and +the corrected-budget series supports the practical conclusion, but does not +establish a universal performance ratio for all prompts or hardware. + +### Decision + +Keep production `--batch-mtp --batch-groups 1` for the user's continuing +OpenCode conversations. Pipeline improved short concurrent output and cold +prefill here, but its missing retained batch conversation cache caused much +slower subsequent turns. It did not solve memory pressure. Lowering pinned +experts to 16 GiB also did not solve pressure and did not improve the serial +workload in the measured startup states. **No production flags or RAM limits +were changed.** The parameter is the number of batch groups, not a switch +between having one or two user context slots. + +More physical RAM is a plausible way to retain more experts and borrowed +prefill experts, but no larger-RAM configuration was tested; do not promise +a particular token rate. Increasing a cgroup limit cannot manufacture host +RAM, and the 44-GiB limit was not raised. A future runtime update should be +tested separately for pipeline conversation-cache behavior before changing +the recommended production setting. This test used 0.1.43.1; it is **not** +evidence that the pending newer Strata release was installed or benchmarked. + +### Reproduction safeguard + +After the clamped-budget discovery, the saved `benchmark.py` was strengthened +to check the resolved expert allocation after startup and abort a requested +controlled-budget run if the allocation differs by more than 0.02 GiB. For a +future controlled comparison use separate fresh containers/cgroups and +`TEST_ARMS=serial_mtp` / `TEST_ARMS=pipeline`, `TEST_RESIDENT_GIB=16`, +`TEST_REPETITIONS=1`, `TEST_TARGETS=65536`. The scripts used for the recorded +measurements preceded that added assertion; the final equality was separately +verified from both engine startup records. No workload or timing code changed. + +## Verified final state + +At approximately 13:02 Europe/Berlin, all three own transient services were +inactive and no own test container remained. `restore-final.json` confirms a +regular HTTP 200 generation with `flash-next-strata-iq3-dual`. The regular Deck +status then confirmed LLM loaded and zero active requests. The native Deck UI +showed the original Dual-Slot 2x262K profile active, two free slots and both +GPUs occupied by the one production Strata engine. Dashboard screenshot: +`restored-dashboard.png`. The one-token restoration probe is not a speed +measurement; ignore its dashboard token/s when reading the benchmark tables. +Deck, OpenCode, OpenWebUI and host were not restarted. OpenWebUI stayed stopped, +CPU STT stayed ready and no TTS policy was changed. diff --git a/docs/experiments/strata-batch-groups-2026-10-14/benchmark.py b/docs/experiments/strata-batch-groups-2026-10-14/benchmark.py new file mode 100644 index 0000000..296ac1e --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/benchmark.py @@ -0,0 +1,186 @@ +"""Isolated, synthetic serial-MTP versus pipelined dual-slot comparison.""" +import concurrent.futures, copy, json, os, pathlib, random, re, signal +import socket, subprocess, threading, time, urllib.request +P = pathlib.Path +ROOT = P('/experiment') +SOURCE = P('/var/lib/deck/strata-runtime/source') +MODEL = 'synthetic-batch-ab' +KEY = 'synthetic-isolated-batch-test' +RESULTS = [] + +def save(phase, **extra): + ROOT.mkdir(exist_ok=True) + p = ROOT/'status.tmp' + p.write_text(json.dumps(dict(phase=phase, completed=len(RESULTS), updated=time.time(), **extra))) + p.replace(ROOT/'status.json') + (ROOT/'results.json').write_text(json.dumps(RESULTS, indent=2)) + +def http(base, route, data=None, timeout=900): + req = urllib.request.Request(base+route, data=json.dumps(data).encode() if data is not None else None, + headers={'Authorization':'Bearer '+KEY, 'Content-Type':'application/json'}) + return urllib.request.urlopen(req, timeout=timeout) + +def numeric(): + cg=P('/sys/fs/cgroup') + stat=dict((k,int(v)) for k,v in (x.split() for x in (cg/'memory.stat').read_text().splitlines())) + events=dict((k,int(v)) for k,v in (x.split() for x in (cg/'memory.events').read_text().splitlines())) + io=0; ticks=0 + for p in P('/proc').glob('[0-9]*'): + try: + if (p/'comm').read_text().strip()!='strata': continue + st=(p/'stat').read_text().rsplit(')',1)[1].split() + ticks+=int(st[11])+int(st[12]) + io+=int(dict(x.split(':') for x in (p/'io').read_text().splitlines())['read_bytes']) + except (OSError,ValueError): pass + pressure={x.split()[0]:int(re.search(r'total=(\d+)',x).group(1)) for x in (cg/'memory.pressure').read_text().splitlines()} + return dict(at=time.monotonic(), memory=int((cg/'memory.current').read_text()), read_bytes=io, + cpu_ticks=ticks, refault=stat.get('workingset_refault_file',0), major_fault=stat.get('pgmajfault',0), + max_events=events.get('max',0), oom=events.get('oom',0), oom_kill=events.get('oom_kill',0), pressure=pressure) + +class Sampler: + def __init__(self,base): self.base=base; self.rows=[]; self.stop=threading.Event() + def run(self): + while not self.stop.is_set(): + try: + r=numeric() + with http(self.base,'/slots',timeout=3) as response: + r['processing_slots']=sum(bool(x.get('is_processing')) for x in json.load(response)) + if len(self.rows)%5==0: + raw=subprocess.check_output(['nvidia-smi','--query-gpu=index,utilization.gpu,memory.used','--format=csv,noheader,nounits'],text=True,timeout=8) + r['gpus']=[[float(v.strip()) for v in line.split(',')] for line in raw.splitlines()] + self.rows.append(r) + except (OSError,ValueError): pass + self.stop.wait(1) + +def generate(base,messages,limit=512): + body=dict(model=MODEL,messages=messages,max_tokens=limit,reasoning_effort='none', + temperature=0,top_p=1,top_k=0,seed=42,stream=True,stream_options={'include_usage':True}) + start=time.monotonic(); first=None; content=''; usage={}; timings={}; finish=None; done=False + with http(base,'/v1/chat/completions',body) as response: + for line in response: + if not line.startswith(b'data:'): continue + raw=line[5:].strip() + if raw==b'[DONE]': done=True; break + v=json.loads(raw) + if 'error' in v: raise RuntimeError('Synthetic stream returned an error') + usage=v.get('usage') or usage + timings=v.get('timings') or v.get('backend_timings') or timings + for choice in v.get('choices',[]): + text=choice.get('delta',{}).get('content') or '' + if text and first is None: first=time.monotonic() + content+=text + finish=choice.get('finish_reason') or finish + if not done: raise RuntimeError('Synthetic stream ended without DONE') + return dict(wall_seconds=time.monotonic()-start,ttft_seconds=first-start if first else None, + usage=usage,backend_timings=timings,finish_reason=finish,_content=content) + +def fixture(base,target,client): + path=ROOT/f'fixture-{target}-{client}.json' + if path.exists(): return json.loads(path.read_text()) + system=f'Messung Kontext {target}, Gespräch {client}. Antworte auf Deutsch. Schreibe mindestens 1200 Wörter über '+('Home-Assistant-Automatisierungen.' if client else 'zuverlässige Datensicherung.') + def count(text): + with http(base,'/v1/messages/count_tokens',dict(model=MODEL,system=system,messages=[dict(role='user',content=text)]),120) as r: + return json.load(r)['input_tokens'] + rng=random.Random(20261014+client) + rows=[f'Datensatz {i:06d}: Standort {rng.randrange(10000):04d}, Messwert {rng.randrange(100000000,999999999)}, Status archiviert.\n' for i in range(target//10+300)] + per=(count(''.join(rows[:100]))-count(''))/100 + n=int((target-count(''))/per) + for _ in range(6): + text=''.join(rows[:n])+'\nFühre jetzt die ausführliche Schreibaufgabe aus.' + actual=count(text); delta=target-actual + if abs(delta)<64: break + n=max(1,n+int(delta/per)) + if abs(actual-target)>128: raise RuntimeError('Tokenizer calibration failed') + value=[dict(role='system',content=system),dict(role='user',content=text)] + path.write_text(json.dumps(value)); return value + +def measure(base,arm,case,messages,limit=512): + save('measuring',arm=arm,case=case) + before=numeric(); sampler=Sampler(base); thread=threading.Thread(target=sampler.run,daemon=True);thread.start() + start=time.monotonic() + try: + if len(messages)==1: rows=[generate(base,messages[0],limit)] + else: + barrier=threading.Barrier(len(messages)) + def one(m): barrier.wait(); return generate(base,m,limit) + with concurrent.futures.ThreadPoolExecutor(max_workers=len(messages)) as pool: rows=list(pool.map(one,messages)) + finally: + sampler.stop.set();thread.join(5) + elapsed=time.monotonic()-start; after=numeric(); peak=max([before['memory'],after['memory']]+[r['memory'] for r in sampler.rows]) + res=dict(arm=arm,case=case,requests=len(messages),wall_seconds=elapsed, + aggregate_output_tok_s=sum(r['usage'].get('completion_tokens',0) for r in rows)/elapsed, + rows=[{k:v for k,v in r.items() if k!='_content'} for r in rows], + resources=dict(peak_memory_gib=peak/2**30,read_gib=(after['read_bytes']-before['read_bytes'])/2**30, + read_mib_s=(after['read_bytes']-before['read_bytes'])/elapsed/2**20, + refaults=after['refault']-before['refault'],major_faults=after['major_fault']-before['major_fault'], + limit_events=after['max_events']-before['max_events'],oom_kill_delta=after['oom_kill']-before['oom_kill'], + cpu_cores=(after['cpu_ticks']-before['cpu_ticks'])/os.sysconf('SC_CLK_TCK')/elapsed, + pressure_full_percent=(after['pressure']['full']-before['pressure']['full'])/elapsed/10000, + peak_processing_slots=max([0]+[r.get('processing_slots',0) for r in sampler.rows]))) + gpu_rows=[g for r in sampler.rows for g in r.get('gpus',[])] + res['resources']['gpu_samples']={str(int(i)):dict(mean_utilization=sum(g[1] for g in gpu_rows if g[0]==i)/sum(g[0]==i for g in gpu_rows),peak_memory_mib=max(g[2] for g in gpu_rows if g[0]==i)) for i in {g[0] for g in gpu_rows}} + RESULTS.append(res);save('measured',arm=arm,case=case) + return rows + +def run(): + baseline=json.loads(P('/test/base-template.json').read_text()) + baseline.pop('previous_model',None) + for arm,group in [('serial_mtp','1'),('pipeline','auto')]: + if arm not in os.environ.get('TEST_ARMS','serial_mtp,pipeline').split(','):continue + cfg=copy.deepcopy(baseline); args=cfg['args'] + if '--batch-groups' in args: + i=args.index('--batch-groups');del args[i:i+2] + args+=['--batch-groups',group] + if os.environ.get('TEST_RESIDENT_GIB'): + if '--resident-budget-gib' in args: + i=args.index('--resident-budget-gib');del args[i:i+2] + args+=['--resident-budget-gib',os.environ['TEST_RESIDENT_GIB']] + with socket.socket() as s:s.bind(('127.0.0.1',0));port=s.getsockname()[1] + cfg.update(api_key=KEY,port=port,host='127.0.0.1',model_name=MODEL,open_browser=False,log=str(ROOT/f'engine-{arm}.log')) + path=ROOT/f'config-{arm}.json';path.write_text(json.dumps(cfg));path.chmod(0o600) + base=f'http://127.0.0.1:{port}'; proc=None + env=dict(os.environ,**cfg.get('env',{}),PYTHONUNBUFFERED='1',PYTHONDONTWRITEBYTECODE='1') + env['LD_LIBRARY_PATH']='/var/lib/deck/strata-runtime/cuda/lib64:/var/lib/deck/strata-runtime/cuda/lib:'+env.get('LD_LIBRARY_PATH','') + try: + save('loading',arm=arm) + with (ROOT/f'server-{arm}.log').open('w') as log: + proc=subprocess.Popen([str(SOURCE/'.venv/bin/python'),str(SOURCE/'serve/server.py'),'--engine','strata','--config',str(path),'--host','127.0.0.1','--port',str(port),'--fit-max-tokens'],cwd=SOURCE,env=env,stdout=log,stderr=subprocess.STDOUT,start_new_session=True) + end=time.monotonic()+600 + while time.monotonic()0.02: + raise RuntimeError('Controlled expert budget was clamped; do not compare unequal allocations') + for rep in range(int(os.environ.get('TEST_REPETITIONS','2'))): + msgs=[[dict(role='system',content=f'Kurzmessung {rep}, Gespräch {i}. Schreibe auf Deutsch.'),dict(role='user',content='Schreibe einen ausführlichen Fachtext mit mindestens 1200 Wörtern über '+('Home Assistant.' if i else 'Datensicherung.'))] for i in range(2)] + measure(base,arm,f'solo-short-{rep}',[msgs[0]]) + msgs[0][0]['content']+=' Parallele Messung.' + measure(base,arm,f'parallel-short-{rep}',msgs) + for target in map(int,os.environ.get('TEST_TARGETS','65536,131072').split(',')): + save('calibrating',arm=arm,target=target) + msgs=[fixture(base,target,i) for i in range(2)] + first=measure(base,arm,f'parallel-cold-{target}',msgs,256) + follow=[m+[dict(role='assistant',content=r['_content']),dict(role='user',content='Führe den Fachtext mit mindestens 1200 weiteren Wörtern fort.')] for m,r in zip(msgs,first)] + measure(base,arm,f'parallel-cached-{target}',follow,512) + finally: + if proc and proc.poll() is None: + os.killpg(proc.pid,signal.SIGTERM) + try:proc.wait(30) + except subprocess.TimeoutExpired:os.killpg(proc.pid,signal.SIGKILL);proc.wait() + path.unlink(missing_ok=True) + save('complete') + +if __name__=='__main__': + try:run() + except BaseException as e:save('failed',error_type=type(e).__name__);raise diff --git a/docs/experiments/strata-batch-groups-2026-10-14/launch.py b/docs/experiments/strata-batch-groups-2026-10-14/launch.py new file mode 100644 index 0000000..8ce56c3 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/launch.py @@ -0,0 +1,53 @@ +"""Athena host launcher: regular GUI unload first, isolated test, regular API restore.""" +import json,os,pathlib,subprocess,time,urllib.request +P=pathlib.Path +STAGE=P('/opt/athena-deck-dev/batch-ab-20261014') +RUN=os.environ.get('TEST_RUN','strata-batch-ab-20261014') +if RUN not in ('strata-batch-ab-20261014','strata-batch-fixed16-20261014','strata-batch-fresh16-20261014'): + raise ValueError('Unknown isolated test directory') +OUT=P('/data/experiments')/RUN +def credentials(): + d=json.loads(subprocess.check_output(['docker','inspect','athena-voxcpm2-web']))[0] + p=next(P(m['Source']) for m in d['Mounts'] if m['Destination']=='/data') + return json.loads((p/'deck-connection.json').read_text())['token'] +def request(path,data=None): + req=urllib.request.Request('http://127.0.0.1:'+('8120' if path.startswith('/v1/') else '8108')+path, + data=json.dumps(data).encode() if data is not None else None, + headers={'Authorization':'Bearer '+credentials(),'Content-Type':'application/json'}) + with urllib.request.urlopen(req,timeout=600) as r:return r.status,json.load(r) +def mark(phase,**extra): + p=OUT/'launcher.tmp';p.write_text(json.dumps(dict(phase=phase,updated=time.time(),**extra)));p.replace(OUT/'launcher-status.json') +def main(): + _,s=request('/api/v1/status') + if s['endpoint']['active_requests'] or s['endpoint']['counts']['llm']['loaded']: + raise RuntimeError('Regularly unload idle Deck LLM first') + g=subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip() + if g and 'No running processes' not in g:raise RuntimeError('GPU processes still present; no test started') + d=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev']))[0] + args=['docker','run','--rm','--name','athena-'+RUN,'--gpus','all', + '--user','65534:65534','--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true', + '--memory','44g','--memory-swap','44g','--cpus','6','--network','none', + '--tmpfs','/tmp:rw,nosuid,nodev,size=512m','-e','HOME=/experiment/home', + '-e','PYTHONDONTWRITEBYTECODE=1','-e','NVIDIA_DRIVER_CAPABILITIES=compute,utility','--entrypoint','python3'] + for name in ('TEST_RESIDENT_GIB','TEST_REPETITIONS','TEST_TARGETS','TEST_ARMS'): + if name in os.environ:args+=['-e',name+'='+os.environ[name]] + for m in d['Mounts']: + if m['Type']=='bind' and (m['Destination']=='/var/lib/deck' or 'strata' in m['Destination']): + args+=['--mount',f"type=bind,src={m['Source']},dst={m['Destination']},readonly"] + args+=['--mount',f'type=bind,src={STAGE},dst=/test,readonly','--mount',f'type=bind,src={OUT},dst=/experiment',d['Config']['Image'],'/test/benchmark.py'] + try: + mark('running') + with (OUT/'container-test.log').open('w') as f:r=subprocess.run(args,stdout=f,stderr=subprocess.STDOUT) + mark('test_complete' if r.returncode==0 else 'test_failed',exit_code=r.returncode) + finally: + _,s=request('/api/v1/status');e=s['endpoint'] + if e['active_requests'] or e['counts']['llm']['loaded']: + mark('restore_skipped_new_activity') + else: + previous=json.loads((STAGE/'base-template.json').read_text())['previous_model'] + status,_=request('/v1/chat/completions',dict(model=previous,messages=[dict(role='user',content='OK')],max_tokens=1,reasoning_effort='none')) + (OUT/'restore.json').write_text(json.dumps(dict(http_status=status,model=previous))) + mark('finished',restored=status==200,model=previous) +if __name__=='__main__': + try:main() + except BaseException as e:mark('launcher_failed',error_type=type(e).__name__);raise diff --git a/docs/experiments/strata-batch-groups-2026-10-14/metadata-auto.json b/docs/experiments/strata-batch-groups-2026-10-14/metadata-auto.json new file mode 100644 index 0000000..8931a3f --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/metadata-auto.json @@ -0,0 +1,16 @@ +{ + "previous_model": "flash-next-strata-iq3-dual", + "memory_limit_gib": 44, + "cpu_quota_cores": 6, + "arms": [ + "serial_mtp", + "pipeline" + ], + "retained_cpu_vision": true, + "runtime": { + "commit": "a0116b2782a5b82622358c04a06496485d12b2d6", + "cuda": "13.0", + "architectures": "86;120", + "origin": "native-build" + } +} \ No newline at end of file diff --git a/docs/experiments/strata-batch-groups-2026-10-14/resolved-settings.json b/docs/experiments/strata-batch-groups-2026-10-14/resolved-settings.json new file mode 100644 index 0000000..030a3e2 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/resolved-settings.json @@ -0,0 +1,42 @@ +{ + "runtime_commit": "a0116b2782a5b82622358c04a06496485d12b2d6", + "runtime_release": "0.1.43.1", + "production_changed": false, + "cgroup_memory_limit_gib": 44, + "extra_swap": false, + "resident_headroom_gib": 6, + "auto_allocated_expert_gib": { + "serial_mtp": 20.56, + "pipeline": 16.77 + }, + "requested16_same_container_allocated_gib": { + "serial_mtp": 16.0, + "pipeline": 12.77 + }, + "requested16_fresh_container_allocated_gib": { + "pipeline": 16.0 + }, + "serial_flags": [ + "--batch-mtp", + "--batch-groups", + "1" + ], + "pipeline_flags": [ + "--batch-mtp", + "--batch-groups", + "auto" + ], + "pipeline_batch_mtp_resolved": false, + "pipeline_solo_mtp_retained": true, + "gpu_order": [ + "RTX3060", + "RTX5080" + ], + "layer_split": 16, + "parallel": 2, + "context_per_slot": 262144, + "kv": "int8", + "kv_resident": 32768, + "prefill_borrowed_expert_slots": 4681, + "borrowed_slots_with_ram_copy": 0 +} diff --git a/docs/experiments/strata-batch-groups-2026-10-14/restore-auto.json b/docs/experiments/strata-batch-groups-2026-10-14/restore-auto.json new file mode 100644 index 0000000..621dca5 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/restore-auto.json @@ -0,0 +1 @@ +{"http_status": 200, "model": "flash-next-strata-iq3-dual"} \ No newline at end of file diff --git a/docs/experiments/strata-batch-groups-2026-10-14/restore-final.json b/docs/experiments/strata-batch-groups-2026-10-14/restore-final.json new file mode 100644 index 0000000..621dca5 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/restore-final.json @@ -0,0 +1 @@ +{"http_status": 200, "model": "flash-next-strata-iq3-dual"} \ No newline at end of file diff --git a/docs/experiments/strata-batch-groups-2026-10-14/restored-dashboard.png b/docs/experiments/strata-batch-groups-2026-10-14/restored-dashboard.png new file mode 100644 index 0000000..223780a Binary files /dev/null and b/docs/experiments/strata-batch-groups-2026-10-14/restored-dashboard.png differ diff --git a/docs/experiments/strata-batch-groups-2026-10-14/results-auto.json b/docs/experiments/strata-batch-groups-2026-10-14/results-auto.json new file mode 100644 index 0000000..3d6c3f0 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/results-auto.json @@ -0,0 +1,1226 @@ +[ + { + "arm": "serial_mtp", + "case": "solo-short-0", + "requests": 1, + "wall_seconds": 9.871063689002767, + "aggregate_output_tok_s": 51.86877687461514, + "rows": [ + { + "wall_seconds": 9.870991714007687, + "ttft_seconds": 0.991584668008727, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 964.6, + "prompt_per_token_ms": 17.225, + "prompt_per_second": 58.1, + "predicted_n": 512, + "predicted_ms": 8902.1, + "predicted_per_token_ms": 17.387, + "predicted_per_second": 57.5, + "draft_n": 301, + "draft_n_accepted": 200 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 41.687015533447266, + "read_gib": 1.5492210388183594, + "read_mib_s": 160.71240078385793, + "refaults": 0, + "major_faults": 11373, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.674160532709363, + "pressure_full_percent": 0.0, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 24.5, + "peak_memory_mib": 11259.0 + }, + "1": { + "mean_utilization": 24.0, + "peak_memory_mib": 15548.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-short-0", + "requests": 2, + "wall_seconds": 15.340835179988062, + "aggregate_output_tok_s": 66.74995122402436, + "rows": [ + { + "wall_seconds": 15.237827270990238, + "ttft_seconds": 1.7963088889955543, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 723.3, + "prompt_per_token_ms": 11.857, + "prompt_per_second": 84.3, + "predicted_n": 512, + "predicted_ms": 13324.3, + "predicted_per_token_ms": 26.024, + "predicted_per_second": 38.4, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 15.339257044004626, + "ttft_seconds": 0.8265095110109542, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 796.6, + "prompt_per_token_ms": 14.225, + "prompt_per_second": 70.3, + "predicted_n": 512, + "predicted_ms": 14374.6, + "predicted_per_token_ms": 28.075, + "predicted_per_second": 35.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.16818618774414, + "read_gib": 1.2902679443359375, + "read_mib_s": 86.125322350346, + "refaults": 0, + "major_faults": 9203, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.673093999049648, + "pressure_full_percent": 6.518549924221129e-06, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 38.25, + "peak_memory_mib": 11265.0 + }, + "1": { + "mean_utilization": 51.0, + "peak_memory_mib": 15552.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "solo-short-1", + "requests": 1, + "wall_seconds": 8.27684469599626, + "aggregate_output_tok_s": 61.859321855787464, + "rows": [ + { + "wall_seconds": 8.276782397995703, + "ttft_seconds": 0.7637415719946148, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 740.4, + "prompt_per_token_ms": 13.221, + "prompt_per_second": 75.6, + "predicted_n": 512, + "predicted_ms": 7533.0, + "predicted_per_token_ms": 14.713, + "predicted_per_second": 68.0, + "draft_n": 305, + "draft_n_accepted": 185 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.6194953918457, + "read_gib": 0.5744171142578125, + "read_mib_s": 71.06610630069333, + "refaults": 0, + "major_faults": 4186, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.831932550739963, + "pressure_full_percent": 0.0, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 36.5, + "peak_memory_mib": 11271.0 + }, + "1": { + "mean_utilization": 57.0, + "peak_memory_mib": 15558.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-short-1", + "requests": 2, + "wall_seconds": 14.06858495400229, + "aggregate_output_tok_s": 72.78628258264796, + "rows": [ + { + "wall_seconds": 14.068043920007767, + "ttft_seconds": 1.5135508950043004, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 608.0, + "prompt_per_token_ms": 9.967, + "prompt_per_second": 100.3, + "predicted_n": 512, + "predicted_ms": 12485.2, + "predicted_per_token_ms": 24.385, + "predicted_per_second": 41.0, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 13.927117497994914, + "ttft_seconds": 0.7280761360016186, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 703.1, + "prompt_per_token_ms": 12.555, + "prompt_per_second": 79.6, + "predicted_n": 512, + "predicted_ms": 13090.2, + "predicted_per_token_ms": 25.567, + "predicted_per_second": 39.1, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.788429260253906, + "read_gib": 0.9934768676757812, + "read_mib_s": 72.31148802997336, + "refaults": 0, + "major_faults": 6922, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.704909218831372, + "pressure_full_percent": 3.554017704230858e-05, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 42.666666666666664, + "peak_memory_mib": 11277.0 + }, + "1": { + "mean_utilization": 51.333333333333336, + "peak_memory_mib": 15564.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-cold-65536", + "requests": 2, + "wall_seconds": 181.8526843770087, + "aggregate_output_tok_s": 2.8154657257549465, + "rows": [ + { + "wall_seconds": 181.85170417100016, + "ttft_seconds": 175.76845822299947, + "usage": { + "prompt_tokens": 65515, + "completion_tokens": 256, + "total_tokens": 65771, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65515, + "prompt_ms": 98797.5, + "prompt_per_token_ms": 1.508, + "prompt_per_second": 663.1, + "predicted_n": 256, + "predicted_ms": 4460.0, + "predicted_per_token_ms": 17.422, + "predicted_per_second": 57.4, + "draft_n": 141, + "draft_n_accepted": 97 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 105.5411489160033, + "ttft_seconds": 76.07053059400641, + "usage": { + "prompt_tokens": 65518, + "completion_tokens": 256, + "total_tokens": 65774, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65518, + "prompt_ms": 75919.0, + "prompt_per_token_ms": 1.159, + "prompt_per_second": 863.0, + "predicted_n": 256, + "predicted_ms": 28735.9, + "predicted_per_token_ms": 112.25, + "predicted_per_second": 8.9, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 168.63153076171875, + "read_mib_s": 949.55259028242, + "refaults": 41843637, + "major_faults": 710854, + "limit_events": 151289, + "oom_kill_delta": 0, + "cpu_cores": 1.3373462197335995, + "pressure_full_percent": 28.97232184418671, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 41.08108108108108, + "peak_memory_mib": 11321.0 + }, + "1": { + "mean_utilization": 26.513513513513512, + "peak_memory_mib": 15628.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-cached-65536", + "requests": 2, + "wall_seconds": 20.973056285001803, + "aggregate_output_tok_s": 48.824548319754435, + "rows": [ + { + "wall_seconds": 20.923674219011446, + "ttft_seconds": 2.717727305003791, + "usage": { + "prompt_tokens": 65804, + "completion_tokens": 512, + "total_tokens": 66316, + "prompt_tokens_details": { + "cached_tokens": 65517 + } + }, + "backend_timings": { + "cache_n": 65517, + "prompt_n": 287, + "prompt_ms": 2574.8, + "prompt_per_token_ms": 8.971, + "prompt_per_second": 111.5, + "predicted_n": 512, + "predicted_ms": 17407.7, + "predicted_per_token_ms": 33.999, + "predicted_per_second": 29.4, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 20.972717048993218, + "ttft_seconds": 4.76874126700568, + "usage": { + "prompt_tokens": 65806, + "completion_tokens": 512, + "total_tokens": 66318, + "prompt_tokens_details": { + "cached_tokens": 65773 + } + }, + "backend_timings": { + "cache_n": 65773, + "prompt_n": 33, + "prompt_ms": 1145.5, + "prompt_per_token_ms": 34.712, + "prompt_per_second": 28.8, + "predicted_n": 512, + "predicted_ms": 15450.2, + "predicted_per_token_ms": 30.176, + "predicted_per_second": 33.1, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.99998474121094, + "read_gib": 2.2328758239746094, + "read_mib_s": 109.01915355965981, + "refaults": 353127, + "major_faults": 13591, + "limit_events": 2590, + "oom_kill_delta": 0, + "cpu_cores": 4.617352792270527, + "pressure_full_percent": 1.9111139290015287, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 32.2, + "peak_memory_mib": 11321.0 + }, + "1": { + "mean_utilization": 45.6, + "peak_memory_mib": 15628.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-cold-131072", + "requests": 2, + "wall_seconds": 343.91989139099314, + "aggregate_output_tok_s": 1.488718776716294, + "rows": [ + { + "wall_seconds": 343.918383213997, + "ttft_seconds": 337.44388498799526, + "usage": { + "prompt_tokens": 131072, + "completion_tokens": 256, + "total_tokens": 131328, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131072, + "prompt_ms": 183183.9, + "prompt_per_token_ms": 1.398, + "prompt_per_second": 715.5, + "predicted_n": 256, + "predicted_ms": 3925.8, + "predicted_per_token_ms": 15.335, + "predicted_per_second": 65.2, + "draft_n": 140, + "draft_n_accepted": 102 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 192.40545564799686, + "ttft_seconds": 152.7041339300049, + "usage": { + "prompt_tokens": 131075, + "completion_tokens": 256, + "total_tokens": 131331, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131075, + "prompt_ms": 152449.5, + "prompt_per_token_ms": 1.163, + "prompt_per_second": 859.8, + "predicted_n": 256, + "predicted_ms": 38293.7, + "predicted_per_token_ms": 149.585, + "predicted_per_second": 6.7, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 332.5535011291504, + "read_mib_s": 990.1572827874189, + "refaults": 86662373, + "major_faults": 1435402, + "limit_events": 298476, + "oom_kill_delta": 0, + "cpu_cores": 1.1863809282730122, + "pressure_full_percent": 30.861561851138585, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 39.608695652173914, + "peak_memory_mib": 11321.0 + }, + "1": { + "mean_utilization": 24.318840579710145, + "peak_memory_mib": 15634.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-cached-131072", + "requests": 2, + "wall_seconds": 20.581522560998565, + "aggregate_output_tok_s": 49.75336479432541, + "rows": [ + { + "wall_seconds": 20.003455133992247, + "ttft_seconds": 0.725448694996885, + "usage": { + "prompt_tokens": 131361, + "completion_tokens": 512, + "total_tokens": 131873, + "prompt_tokens_details": { + "cached_tokens": 131328 + } + }, + "backend_timings": { + "cache_n": 131328, + "prompt_n": 33, + "prompt_ms": 460.6, + "prompt_per_token_ms": 13.958, + "prompt_per_second": 71.6, + "predicted_n": 512, + "predicted_ms": 17793.4, + "predicted_per_token_ms": 34.753, + "predicted_per_second": 28.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 20.581131799001014, + "ttft_seconds": 4.0539912749954965, + "usage": { + "prompt_tokens": 131364, + "completion_tokens": 512, + "total_tokens": 131876, + "prompt_tokens_details": { + "cached_tokens": 131330 + } + }, + "backend_timings": { + "cache_n": 131330, + "prompt_n": 34, + "prompt_ms": 1695.3, + "prompt_per_token_ms": 49.862, + "prompt_per_second": 20.1, + "predicted_n": 512, + "predicted_ms": 15129.3, + "predicted_per_token_ms": 29.549, + "predicted_per_second": 33.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.99991226196289, + "read_gib": 1.5652046203613281, + "read_mib_s": 77.87419645460076, + "refaults": 288586, + "major_faults": 11355, + "limit_events": 1404, + "oom_kill_delta": 0, + "cpu_cores": 4.686242221106138, + "pressure_full_percent": 0.5514509418028858, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 29.8, + "peak_memory_mib": 11321.0 + }, + "1": { + "mean_utilization": 48.0, + "peak_memory_mib": 15634.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "solo-short-0", + "requests": 1, + "wall_seconds": 10.315621150992229, + "aggregate_output_tok_s": 49.63346293022328, + "rows": [ + { + "wall_seconds": 10.31556123799237, + "ttft_seconds": 1.0452564709994476, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 1014.4, + "prompt_per_token_ms": 18.114, + "prompt_per_second": 55.2, + "predicted_n": 512, + "predicted_ms": 9296.7, + "predicted_per_token_ms": 18.158, + "predicted_per_second": 55.1, + "draft_n": 293, + "draft_n_accepted": 189 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 41.19888687133789, + "read_gib": 3.440074920654297, + "read_mib_s": 341.4856621029717, + "refaults": 47, + "major_faults": 25485, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.455803308033137, + "pressure_full_percent": 0.0, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 25.666666666666668, + "peak_memory_mib": 11245.0 + }, + "1": { + "mean_utilization": 38.0, + "peak_memory_mib": 15516.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-short-0", + "requests": 2, + "wall_seconds": 11.36328375901212, + "aggregate_output_tok_s": 90.11479619065877, + "rows": [ + { + "wall_seconds": 11.33781309099868, + "ttft_seconds": 0.7784374269976979, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 747.0, + "prompt_per_token_ms": 12.246, + "prompt_per_second": 81.7, + "predicted_n": 512, + "predicted_ms": 10486.4, + "predicted_per_token_ms": 20.481, + "predicted_per_second": 48.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 11.362987844986492, + "ttft_seconds": 1.4720970319904154, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 560.8, + "prompt_per_token_ms": 10.014, + "prompt_per_second": 99.9, + "predicted_n": 512, + "predicted_ms": 9825.0, + "predicted_per_token_ms": 19.189, + "predicted_per_second": 52.1, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.03831481933594, + "read_gib": 1.6387786865234375, + "read_mib_s": 147.67820733765504, + "refaults": 0, + "major_faults": 12111, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.706977082972871, + "pressure_full_percent": 0.0, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 70.66666666666667, + "peak_memory_mib": 11257.0 + }, + "1": { + "mean_utilization": 84.33333333333333, + "peak_memory_mib": 15528.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "solo-short-1", + "requests": 1, + "wall_seconds": 8.158526893996168, + "aggregate_output_tok_s": 62.756427312481996, + "rows": [ + { + "wall_seconds": 8.158471118993475, + "ttft_seconds": 0.5242354439978953, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 501.5, + "prompt_per_token_ms": 8.955, + "prompt_per_second": 111.7, + "predicted_n": 512, + "predicted_ms": 7654.0, + "predicted_per_token_ms": 14.949, + "predicted_per_second": 66.9, + "draft_n": 301, + "draft_n_accepted": 190 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.994110107421875, + "read_gib": 1.0198402404785156, + "read_mib_s": 128.00305984386824, + "refaults": 52, + "major_faults": 8251, + "limit_events": 12, + "oom_kill_delta": 0, + "cpu_cores": 5.624789940175388, + "pressure_full_percent": 0.01750315980512193, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 57.5, + "peak_memory_mib": 11257.0 + }, + "1": { + "mean_utilization": 77.0, + "peak_memory_mib": 15528.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-short-1", + "requests": 2, + "wall_seconds": 10.987095682998188, + "aggregate_output_tok_s": 93.20024413590691, + "rows": [ + { + "wall_seconds": 10.98663487000158, + "ttft_seconds": 1.555428726001992, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 600.4, + "prompt_per_token_ms": 9.843, + "prompt_per_second": 101.6, + "predicted_n": 512, + "predicted_ms": 9357.5, + "predicted_per_token_ms": 18.276, + "predicted_per_second": 54.7, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 10.965168317998177, + "ttft_seconds": 0.7861802959960187, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 759.7, + "prompt_per_token_ms": 13.566, + "prompt_per_second": 73.7, + "predicted_n": 512, + "predicted_ms": 10072.5, + "predicted_per_token_ms": 19.673, + "predicted_per_second": 50.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.99948501586914, + "read_gib": 0.6922988891601562, + "read_mib_s": 64.52242548474372, + "refaults": 0, + "major_faults": 4755, + "limit_events": 223, + "oom_kill_delta": 0, + "cpu_cores": 5.780417485421336, + "pressure_full_percent": 0.1496300794525693, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 70.0, + "peak_memory_mib": 11257.0 + }, + "1": { + "mean_utilization": 85.0, + "peak_memory_mib": 15528.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cold-65536", + "requests": 2, + "wall_seconds": 159.3597615940089, + "aggregate_output_tok_s": 3.212856212124558, + "rows": [ + { + "wall_seconds": 159.35904185399704, + "ttft_seconds": 153.8416922519973, + "usage": { + "prompt_tokens": 65515, + "completion_tokens": 256, + "total_tokens": 65771, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65515, + "prompt_ms": 79684.2, + "prompt_per_token_ms": 1.216, + "prompt_per_second": 822.2, + "predicted_n": 256, + "predicted_ms": 5054.9, + "predicted_per_token_ms": 19.746, + "predicted_per_second": 50.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 159.33490612299647, + "ttft_seconds": 73.51752887399925, + "usage": { + "prompt_tokens": 65518, + "completion_tokens": 256, + "total_tokens": 65774, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65518, + "prompt_ms": 73380.6, + "prompt_per_token_ms": 1.12, + "prompt_per_second": 892.9, + "predicted_n": 256, + "predicted_ms": 85281.5, + "predicted_per_token_ms": 333.131, + "predicted_per_second": 3.0, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.00003433227539, + "read_gib": 134.7640266418457, + "read_mib_s": 865.9548803343467, + "refaults": 32675070, + "major_faults": 702285, + "limit_events": 87522, + "oom_kill_delta": 0, + "cpu_cores": 1.1477803315619197, + "pressure_full_percent": 30.484807779623573, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 52.90625, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 26.9375, + "peak_memory_mib": 15582.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cached-65536", + "requests": 2, + "wall_seconds": 90.10091419999662, + "aggregate_output_tok_s": 11.365034518151852, + "rows": [ + { + "wall_seconds": 90.07108621200314, + "ttft_seconds": 1.0659991139982594, + "usage": { + "prompt_tokens": 65804, + "completion_tokens": 512, + "total_tokens": 66316, + "prompt_tokens_details": { + "cached_tokens": 65770 + } + }, + "backend_timings": { + "cache_n": 65770, + "prompt_n": 34, + "prompt_ms": 919.6, + "prompt_per_token_ms": 27.047, + "prompt_per_second": 37.0, + "predicted_n": 512, + "predicted_ms": 88572.9, + "predicted_per_token_ms": 172.994, + "predicted_per_second": 5.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 90.10062278198893, + "ttft_seconds": 77.89581867300149, + "usage": { + "prompt_tokens": 65807, + "completion_tokens": 512, + "total_tokens": 66319, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65807, + "prompt_ms": 76287.7, + "prompt_per_token_ms": 1.159, + "prompt_per_second": 862.6, + "predicted_n": 512, + "predicted_ms": 11756.0, + "predicted_per_token_ms": 22.961, + "predicted_per_second": 43.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 63.94553756713867, + "read_mib_s": 726.7432417323071, + "refaults": 16691368, + "major_faults": 365199, + "limit_events": 43240, + "oom_kill_delta": 0, + "cpu_cores": 1.6462652051537738, + "pressure_full_percent": 27.046091836436563, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 52.111111111111114, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 35.77777777777778, + "peak_memory_mib": 15584.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cold-131072", + "requests": 2, + "wall_seconds": 338.1869022369938, + "aggregate_output_tok_s": 1.5139557345754389, + "rows": [ + { + "wall_seconds": 338.1619548769959, + "ttft_seconds": 155.30766035999113, + "usage": { + "prompt_tokens": 131072, + "completion_tokens": 256, + "total_tokens": 131328, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131072, + "prompt_ms": 155051.7, + "prompt_per_token_ms": 1.183, + "prompt_per_second": 845.3, + "predicted_n": 256, + "predicted_ms": 181766.6, + "predicted_per_token_ms": 710.026, + "predicted_per_second": 1.4, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 338.18659471999854, + "ttft_seconds": 331.7809089319926, + "usage": { + "prompt_tokens": 131075, + "completion_tokens": 256, + "total_tokens": 131331, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131075, + "prompt_ms": 175270.2, + "prompt_per_token_ms": 1.337, + "prompt_per_second": 747.8, + "predicted_n": 256, + "predicted_ms": 5362.9, + "predicted_per_token_ms": 20.949, + "predicted_per_second": 47.7, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 309.15475845336914, + "read_mib_s": 936.0932388635256, + "refaults": 80983896, + "major_faults": 1536962, + "limit_events": 197410, + "oom_kill_delta": 0, + "cpu_cores": 1.0776880996550084, + "pressure_full_percent": 32.90736343242874, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 38.92537313432836, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 17.507462686567163, + "peak_memory_mib": 15594.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cached-131072", + "requests": 2, + "wall_seconds": 186.50313134299358, + "aggregate_output_tok_s": 5.490524435843307, + "rows": [ + { + "wall_seconds": 186.50208243599627, + "ttft_seconds": 175.27999405600713, + "usage": { + "prompt_tokens": 131361, + "completion_tokens": 512, + "total_tokens": 131873, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131361, + "prompt_ms": 172638.8, + "prompt_per_token_ms": 1.314, + "prompt_per_second": 760.9, + "predicted_n": 512, + "predicted_ms": 10135.4, + "predicted_per_token_ms": 19.796, + "predicted_per_second": 50.5, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 186.47740047100524, + "ttft_seconds": 1.5282523579953704, + "usage": { + "prompt_tokens": 131364, + "completion_tokens": 512, + "total_tokens": 131876, + "prompt_tokens_details": { + "cached_tokens": 131330 + } + }, + "backend_timings": { + "cache_n": 131330, + "prompt_n": 34, + "prompt_ms": 1266.8, + "prompt_per_token_ms": 37.259, + "prompt_per_second": 26.8, + "predicted_n": 512, + "predicted_ms": 183957.2, + "predicted_per_token_ms": 359.291, + "predicted_per_second": 2.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 164.96109008789062, + "read_mib_s": 905.7228960909126, + "refaults": 43185211, + "major_faults": 820379, + "limit_events": 104355, + "oom_kill_delta": 0, + "cpu_cores": 1.2748847608500617, + "pressure_full_percent": 31.476921367092856, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 41.729729729729726, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 21.37837837837838, + "peak_memory_mib": 15598.0 + } + } + } + } +] \ No newline at end of file diff --git a/docs/experiments/strata-batch-groups-2026-10-14/results-cap16-fresh-pipeline.json b/docs/experiments/strata-batch-groups-2026-10-14/results-cap16-fresh-pipeline.json new file mode 100644 index 0000000..657a3c2 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/results-cap16-fresh-pipeline.json @@ -0,0 +1,308 @@ +[ + { + "arm": "pipeline", + "case": "solo-short-0", + "requests": 1, + "wall_seconds": 9.97112546300923, + "aggregate_output_tok_s": 51.348265739851726, + "rows": [ + { + "wall_seconds": 9.971053838991793, + "ttft_seconds": 0.974166186992079, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 949.7, + "prompt_per_token_ms": 16.959, + "prompt_per_second": 59.0, + "predicted_n": 512, + "predicted_ms": 9017.4, + "predicted_per_token_ms": 17.612, + "predicted_per_second": 56.8, + "draft_n": 297, + "draft_n_accepted": 202 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 35.47572708129883, + "read_gib": 4.09283447265625, + "read_mib_s": 420.319904262358, + "refaults": 0, + "major_faults": 29443, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.3735157780102645, + "pressure_full_percent": 0.0, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 27.5, + "peak_memory_mib": 11237.0 + }, + "1": { + "mean_utilization": 25.0, + "peak_memory_mib": 15514.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-short-0", + "requests": 2, + "wall_seconds": 11.345471530992654, + "aggregate_output_tok_s": 90.25627513168743, + "rows": [ + { + "wall_seconds": 11.34373594399949, + "ttft_seconds": 1.5094251900009112, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 605.6, + "prompt_per_token_ms": 9.928, + "prompt_per_second": 100.7, + "predicted_n": 512, + "predicted_ms": 9773.2, + "predicted_per_token_ms": 19.088, + "predicted_per_second": 52.4, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 11.322899782011518, + "ttft_seconds": 0.7614952440053457, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 734.5, + "prompt_per_token_ms": 13.116, + "prompt_per_second": 76.2, + "predicted_n": 512, + "predicted_ms": 10486.5, + "predicted_per_token_ms": 20.481, + "predicted_per_second": 48.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 37.34151840209961, + "read_gib": 1.6622123718261719, + "read_mib_s": 150.0250971588377, + "refaults": 0, + "major_faults": 12568, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.69478314087727, + "pressure_full_percent": 0.0, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 72.0, + "peak_memory_mib": 11249.0 + }, + "1": { + "mean_utilization": 81.66666666666667, + "peak_memory_mib": 15522.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cold-65536", + "requests": 2, + "wall_seconds": 161.98274067699094, + "aggregate_output_tok_s": 3.160830578987282, + "rows": [ + { + "wall_seconds": 161.95836567800143, + "ttft_seconds": 73.39949623300345, + "usage": { + "prompt_tokens": 65515, + "completion_tokens": 256, + "total_tokens": 65771, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65515, + "prompt_ms": 73262.3, + "prompt_per_token_ms": 1.118, + "prompt_per_second": 894.3, + "predicted_n": 256, + "predicted_ms": 87792.4, + "predicted_per_token_ms": 342.939, + "predicted_per_second": 2.9, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 161.9824448920117, + "ttft_seconds": 155.96184796201123, + "usage": { + "prompt_tokens": 65518, + "completion_tokens": 256, + "total_tokens": 65774, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65518, + "prompt_ms": 81691.6, + "prompt_per_token_ms": 1.247, + "prompt_per_second": 802.0, + "predicted_n": 256, + "predicted_ms": 5263.8, + "predicted_per_token_ms": 20.562, + "predicted_per_second": 48.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 138.8767547607422, + "read_mib_s": 877.9317863165429, + "refaults": 33470893, + "major_faults": 714801, + "limit_events": 82476, + "oom_kill_delta": 0, + "cpu_cores": 1.151974582107474, + "pressure_full_percent": 29.6759665869934, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 47.666666666666664, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 27.545454545454547, + "peak_memory_mib": 15576.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cached-65536", + "requests": 2, + "wall_seconds": 98.34308873099508, + "aggregate_output_tok_s": 10.412526322017614, + "rows": [ + { + "wall_seconds": 98.34237096400466, + "ttft_seconds": 87.08424342499347, + "usage": { + "prompt_tokens": 65804, + "completion_tokens": 512, + "total_tokens": 66316, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65804, + "prompt_ms": 84873.4, + "prompt_per_token_ms": 1.29, + "prompt_per_second": 775.3, + "predicted_n": 512, + "predicted_ms": 10521.6, + "predicted_per_token_ms": 20.55, + "predicted_per_second": 48.7, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 98.31455847500183, + "ttft_seconds": 1.305569830990862, + "usage": { + "prompt_tokens": 65806, + "completion_tokens": 512, + "total_tokens": 66318, + "prompt_tokens_details": { + "cached_tokens": 65773 + } + }, + "backend_timings": { + "cache_n": 65773, + "prompt_n": 33, + "prompt_ms": 1170.5, + "prompt_per_token_ms": 35.47, + "prompt_per_second": 28.2, + "predicted_n": 512, + "predicted_ms": 96209.2, + "predicted_per_token_ms": 187.909, + "predicted_per_second": 5.3, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 76.15969848632812, + "read_mib_s": 793.0148651658166, + "refaults": 19890974, + "major_faults": 398638, + "limit_events": 48092, + "oom_kill_delta": 0, + "cpu_cores": 1.5251707256244356, + "pressure_full_percent": 28.689659196261974, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 56.1, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 33.95, + "peak_memory_mib": 15578.0 + } + } + } + } +] \ No newline at end of file diff --git a/docs/experiments/strata-batch-groups-2026-10-14/results-cap16-sequential.json b/docs/experiments/strata-batch-groups-2026-10-14/results-cap16-sequential.json new file mode 100644 index 0000000..44098d2 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/results-cap16-sequential.json @@ -0,0 +1,614 @@ +[ + { + "arm": "serial_mtp", + "case": "solo-short-0", + "requests": 1, + "wall_seconds": 10.484778166995966, + "aggregate_output_tok_s": 48.83269744434613, + "rows": [ + { + "wall_seconds": 10.48470636199636, + "ttft_seconds": 1.0656706720037619, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 1033.2, + "prompt_per_token_ms": 18.45, + "prompt_per_second": 54.2, + "predicted_n": 512, + "predicted_ms": 9447.1, + "predicted_per_token_ms": 18.451, + "predicted_per_second": 54.2, + "draft_n": 299, + "draft_n_accepted": 196 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 35.82564163208008, + "read_gib": 3.9173851013183594, + "read_mib_s": 382.5929628513373, + "refaults": 0, + "major_faults": 27966, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.418331136354109, + "pressure_full_percent": 0.0, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 30.0, + "peak_memory_mib": 11249.0 + }, + "1": { + "mean_utilization": 33.0, + "peak_memory_mib": 15536.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-short-0", + "requests": 2, + "wall_seconds": 15.41811057200539, + "aggregate_output_tok_s": 66.4154012398428, + "rows": [ + { + "wall_seconds": 15.416260758007411, + "ttft_seconds": 0.8091643649968319, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 780.4, + "prompt_per_token_ms": 12.793, + "prompt_per_second": 78.2, + "predicted_n": 512, + "predicted_ms": 14527.9, + "predicted_per_token_ms": 28.375, + "predicted_per_second": 35.2, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 15.222709826004575, + "ttft_seconds": 1.5741246240067994, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 555.4, + "prompt_per_token_ms": 9.918, + "prompt_per_second": 100.8, + "predicted_n": 512, + "predicted_ms": 13581.3, + "predicted_per_token_ms": 26.526, + "predicted_per_second": 37.7, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 39.59473419189453, + "read_gib": 3.5741119384765625, + "read_mib_s": 237.3760784700332, + "refaults": 0, + "major_faults": 25866, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.563587029642299, + "pressure_full_percent": 0.0031586230863089298, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 37.5, + "peak_memory_mib": 11261.0 + }, + "1": { + "mean_utilization": 54.75, + "peak_memory_mib": 15548.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-cold-65536", + "requests": 2, + "wall_seconds": 201.08074581000255, + "aggregate_output_tok_s": 2.5462408045958775, + "rows": [ + { + "wall_seconds": 108.65977381500124, + "ttft_seconds": 76.7929394130042, + "usage": { + "prompt_tokens": 65515, + "completion_tokens": 256, + "total_tokens": 65771, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65515, + "prompt_ms": 76635.7, + "prompt_per_token_ms": 1.17, + "prompt_per_second": 854.9, + "predicted_n": 256, + "predicted_ms": 31003.0, + "predicted_per_token_ms": 121.105, + "predicted_per_second": 8.3, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 201.08029669799726, + "ttft_seconds": 194.95017397899937, + "usage": { + "prompt_tokens": 65518, + "completion_tokens": 256, + "total_tokens": 65774, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65518, + "prompt_ms": 117122.9, + "prompt_per_token_ms": 1.788, + "prompt_per_second": 559.4, + "predicted_n": 256, + "predicted_ms": 4368.9, + "predicted_per_token_ms": 17.066, + "predicted_per_second": 58.6, + "draft_n": 153, + "draft_n_accepted": 99 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 182.08439254760742, + "read_mib_s": 927.261420369543, + "refaults": 44818167, + "major_faults": 864302, + "limit_events": 103383, + "oom_kill_delta": 0, + "cpu_cores": 1.3101204639897226, + "pressure_full_percent": 29.822166592052206, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 37.775, + "peak_memory_mib": 11307.0 + }, + "1": { + "mean_utilization": 20.65, + "peak_memory_mib": 15610.0 + } + } + } + }, + { + "arm": "serial_mtp", + "case": "parallel-cached-65536", + "requests": 2, + "wall_seconds": 21.736466989998007, + "aggregate_output_tok_s": 47.10977181669825, + "rows": [ + { + "wall_seconds": 21.735794496999006, + "ttft_seconds": 1.3616767920029815, + "usage": { + "prompt_tokens": 65804, + "completion_tokens": 512, + "total_tokens": 66316, + "prompt_tokens_details": { + "cached_tokens": 65770 + } + }, + "backend_timings": { + "cache_n": 65770, + "prompt_n": 34, + "prompt_ms": 1207.9, + "prompt_per_token_ms": 35.526, + "prompt_per_second": 28.1, + "predicted_n": 512, + "predicted_ms": 19563.9, + "predicted_per_token_ms": 38.211, + "predicted_per_second": 26.2, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 21.477532226999756, + "ttft_seconds": 4.488289519998943, + "usage": { + "prompt_tokens": 65807, + "completion_tokens": 512, + "total_tokens": 66319, + "prompt_tokens_details": { + "cached_tokens": 65521 + } + }, + "backend_timings": { + "cache_n": 65521, + "prompt_n": 286, + "prompt_ms": 2183.8, + "prompt_per_token_ms": 7.636, + "prompt_per_second": 131.0, + "predicted_n": 512, + "predicted_ms": 16196.6, + "predicted_per_token_ms": 31.634, + "predicted_per_second": 31.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.9999885559082, + "read_gib": 3.7221641540527344, + "read_mib_s": 175.350303961718, + "refaults": 622550, + "major_faults": 28098, + "limit_events": 2999, + "oom_kill_delta": 0, + "cpu_cores": 4.63276759955226, + "pressure_full_percent": 2.5999441411524984, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 33.2, + "peak_memory_mib": 11313.0 + }, + "1": { + "mean_utilization": 44.0, + "peak_memory_mib": 15614.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "solo-short-0", + "requests": 1, + "wall_seconds": 10.605822165991412, + "aggregate_output_tok_s": 48.27537101666452, + "rows": [ + { + "wall_seconds": 10.605760890990496, + "ttft_seconds": 1.0755668560013874, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 1050.4, + "prompt_per_token_ms": 18.757, + "prompt_per_second": 53.3, + "predicted_n": 512, + "predicted_ms": 9551.5, + "predicted_per_token_ms": 18.655, + "predicted_per_second": 53.6, + "draft_n": 287, + "draft_n_accepted": 197 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 39.34785079956055, + "read_gib": 5.5923614501953125, + "read_mib_s": 539.9466477349415, + "refaults": 1, + "major_faults": 39738, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.213174342795667, + "pressure_full_percent": 0.0, + "peak_processing_slots": 0, + "gpu_samples": { + "0": { + "mean_utilization": 25.333333333333332, + "peak_memory_mib": 11231.0 + }, + "1": { + "mean_utilization": 39.0, + "peak_memory_mib": 15508.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-short-0", + "requests": 2, + "wall_seconds": 11.940449173998786, + "aggregate_output_tok_s": 85.75891786632583, + "rows": [ + { + "wall_seconds": 11.939980654002284, + "ttft_seconds": 1.552705018009874, + "usage": { + "prompt_tokens": 61, + "completion_tokens": 512, + "total_tokens": 573, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 61, + "prompt_ms": 613.1, + "prompt_per_token_ms": 10.051, + "prompt_per_second": 99.5, + "predicted_n": 512, + "predicted_ms": 10325.0, + "predicted_per_token_ms": 20.166, + "predicted_per_second": 49.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 11.919720029996824, + "ttft_seconds": 0.7951862210029503, + "usage": { + "prompt_tokens": 56, + "completion_tokens": 512, + "total_tokens": 568, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 56, + "prompt_ms": 771.9, + "prompt_per_token_ms": 13.784, + "prompt_per_second": 72.5, + "predicted_n": 512, + "predicted_ms": 11046.6, + "predicted_per_token_ms": 21.575, + "predicted_per_second": 46.3, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 41.92718505859375, + "read_gib": 2.372894287109375, + "read_mib_s": 203.49684627368669, + "refaults": 0, + "major_faults": 17574, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.632953921571363, + "pressure_full_percent": 8.374894322883381e-06, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 64.66666666666667, + "peak_memory_mib": 11249.0 + }, + "1": { + "mean_utilization": 85.66666666666667, + "peak_memory_mib": 15524.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cold-65536", + "requests": 2, + "wall_seconds": 176.4843446550076, + "aggregate_output_tok_s": 2.9011071831944073, + "rows": [ + { + "wall_seconds": 176.45547918698867, + "ttft_seconds": 84.03929605499434, + "usage": { + "prompt_tokens": 65515, + "completion_tokens": 256, + "total_tokens": 65771, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65515, + "prompt_ms": 83902.7, + "prompt_per_token_ms": 1.281, + "prompt_per_second": 780.8, + "predicted_n": 256, + "predicted_ms": 91883.6, + "predicted_per_token_ms": 358.92, + "predicted_per_second": 2.8, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 176.48404745699372, + "ttft_seconds": 170.46911489398917, + "usage": { + "prompt_tokens": 65518, + "completion_tokens": 256, + "total_tokens": 65774, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65518, + "prompt_ms": 85783.4, + "prompt_per_token_ms": 1.309, + "prompt_per_second": 763.8, + "predicted_n": 256, + "predicted_ms": 5541.3, + "predicted_per_token_ms": 21.646, + "predicted_per_second": 46.2, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 152.69827270507812, + "read_mib_s": 885.9881116121612, + "refaults": 36724619, + "major_faults": 859323, + "limit_events": 77486, + "oom_kill_delta": 0, + "cpu_cores": 1.1479205161003028, + "pressure_full_percent": 31.510010765378166, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 47.25714285714286, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 27.857142857142858, + "peak_memory_mib": 15580.0 + } + } + } + }, + { + "arm": "pipeline", + "case": "parallel-cached-65536", + "requests": 2, + "wall_seconds": 101.61582549499872, + "aggregate_output_tok_s": 10.077170509729301, + "rows": [ + { + "wall_seconds": 101.61507949499355, + "ttft_seconds": 89.65827477199491, + "usage": { + "prompt_tokens": 65804, + "completion_tokens": 512, + "total_tokens": 66316, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 65804, + "prompt_ms": 88191.3, + "prompt_per_token_ms": 1.34, + "prompt_per_second": 746.2, + "predicted_n": 512, + "predicted_ms": 11489.9, + "predicted_per_token_ms": 22.441, + "predicted_per_second": 44.6, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + }, + { + "wall_seconds": 101.59031660099572, + "ttft_seconds": 0.9523080609942554, + "usage": { + "prompt_tokens": 65807, + "completion_tokens": 512, + "total_tokens": 66319, + "prompt_tokens_details": { + "cached_tokens": 65773 + } + }, + "backend_timings": { + "cache_n": 65773, + "prompt_n": 34, + "prompt_ms": 814.9, + "prompt_per_token_ms": 23.968, + "prompt_per_second": 41.7, + "predicted_n": 512, + "predicted_ms": 100228.4, + "predicted_per_token_ms": 195.759, + "predicted_per_second": 5.1, + "draft_n": 0, + "draft_n_accepted": 0 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 44.0, + "read_gib": 77.44012451171875, + "read_mib_s": 780.3773389992574, + "refaults": 20228923, + "major_faults": 454369, + "limit_events": 40714, + "oom_kill_delta": 0, + "cpu_cores": 1.5588123132237515, + "pressure_full_percent": 29.765315444382875, + "peak_processing_slots": 2, + "gpu_samples": { + "0": { + "mean_utilization": 45.095238095238095, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 40.23809523809524, + "peak_memory_mib": 15582.0 + } + } + } + } +] \ No newline at end of file diff --git a/docs/experiments/strata-batch-groups-2026-10-14/summarize.py b/docs/experiments/strata-batch-groups-2026-10-14/summarize.py new file mode 100644 index 0000000..8811ea6 --- /dev/null +++ b/docs/experiments/strata-batch-groups-2026-10-14/summarize.py @@ -0,0 +1,22 @@ +"""Summarize synthetic metrics only; never reads generated text or credentials.""" +import argparse,json,pathlib,re,statistics +p=argparse.ArgumentParser();p.add_argument('directory');a=p.parse_args();root=pathlib.Path(a.directory) +rows=json.loads((root/'results.json').read_text());summary={} +for arm in ('serial_mtp','pipeline'): + r=[x for x in rows if x['arm']==arm];short=[x for x in r if x['case'].startswith('solo-short')] + parallel=[x for x in r if x['case'].startswith('parallel-short')] + summary[arm]={'completed_cases':len(r), + 'solo_short_output_tok_s':[y['backend_timings'].get('predicted_per_second') for x in short for y in x['rows']], + 'parallel_short_per_request_output_tok_s':[y['backend_timings'].get('predicted_per_second') for x in parallel for y in x['rows']], + 'cases':{x['case']:{'wall_seconds':x['wall_seconds'],'output_tok_s':[y['backend_timings'].get('predicted_per_second') for y in x['rows']], + 'input_tok_s':[y['backend_timings'].get('prompt_per_second') for y in x['rows']], + 'cached_tokens':[y['backend_timings'].get('cache_n') for y in x['rows']], + 'new_input_tokens':[y['backend_timings'].get('prompt_n') for y in x['rows']], + 'resources':x['resources']} for x in r}} + log=root/f'engine-{arm}.log' + if log.exists(): + text=log.read_text(errors='replace') + summary[arm]['resolved_resident_gib']=re.findall(r'(?:resident RAM mode:|resident) ([0-9.]+) GiB of experts in RAM',text)[:1] + summary[arm]['batch_groups_reported']=sorted(set(re.findall(r'(?:batch_groups|batch groups)[= :]+([0-9]+)',text))) + summary[arm]['batch_mtp_disabled_reported']=bool(re.search(r'(?i)(?:batch-mtp.{0,100}(?:off|disabled|ignored|left off)|(?:off|disabled|ignored).{0,100}batch-mtp)',text)) +print(json.dumps(summary,indent=2))