Launch authorized million-token test at 43 GiB with 512K fallback
This commit is contained in:
1 parent
511d5dbf26
commit
77550233cb
4 files changed
+60
-16
No files matched your search
@@ -152,3 +152,26 @@ ist nicht linear mit Kontext extrapolierbar. Unter hypothetischen 43 GiB könnte
|
||||
1M knapp passen, ist aber ungemessen; 512K ist sinnvoller nächster Versuch.
|
||||
Belastbar voll getestet bleibt 262144. Aktuelles Deck-Limit bleibt 40 GiB;
|
||||
43 GiB wurde als hypothetischer Grenzwert gefragt, nicht heimlich eingestellt.
|
||||
|
||||
## Autorisierter Erweiterungstest mit 43 GiB
|
||||
|
||||
Nutzer-Go: RAM-Limit 43 GiB, zuerst 1000000 Tokens, bei nicht nutzbarem Ergebnis
|
||||
524288. Deck ohne Neustart per docker update --memory 43g --memory-swap 43g
|
||||
angepasst; installation.json trägt beide Werte ebenfalls 43g. Native Entsprechung
|
||||
MemoryMax=43G, MemorySwapMax=0; keine zusätzliche Bibliothek.
|
||||
|
||||
Separater transienter Dienst athena-strata-extended-20261013 startet die bereits
|
||||
vorhandene Testumgebung unter 43 GiB, ohne Swap. Million mit YaRN Faktor 4,
|
||||
512K-Fallback mit demselben Faktor (Benchmark hält Skalierung konstant; diese
|
||||
Option ist für zukünftige speziell optimierte 512K-Läufe separat zu untersuchen).
|
||||
Vorher regulär IQ3 entladen und TTS auto temporär auf unload; freie GPUs bestätigt.
|
||||
Die kurzen/kleinen/123K-Baseline-Fixtures werden unverändert wiederverwendet.
|
||||
Million/512K jeweils zusätzlich fast voller eigener Prompt mit 8192 Tokens Reserve.
|
||||
Optimierte Tokenzählvorbereitung: zunächst pro Zeile kalibrieren, danach tatsächliche
|
||||
Tokenizerzählungen nachjustieren; keine bloße Zeichen-Schätzung im Ergebnis.
|
||||
|
||||
Eigene Ergebnispfade unter bestehendem autorisierten Verzeichnis:
|
||||
extended-1000000/, optional extended-524288/, extended-status.json, extended-restore.json.
|
||||
Nur synthetische Eingaben/Logs/Messdaten. Aktives Produktionsprofil bleibt 262144;
|
||||
Testdienste werden danach beendet und IQ3 regulär über API wiederhergestellt.
|
||||
TTS nach Abschluss über GUI wieder auto. Keine vollständige native Restore-Abnahme.
|
||||
@@ -19,14 +19,20 @@ def prompt(rows):
|
||||
|
||||
def choose_prompt(target,count):
|
||||
# Exact deployed tokenizer count, never characters-as-tokens.
|
||||
rows=corpus(max(100,int(target/12)+1000))
|
||||
lo,hi=0,len(rows)
|
||||
while count(prompt(rows[:hi]))<target:
|
||||
hi*=2;rows=corpus(hi)
|
||||
while lo<hi:
|
||||
mid=(lo+hi+1)//2
|
||||
if count(prompt(rows[:mid]))<=target:lo=mid
|
||||
else:hi=mid-1
|
||||
# Calibrate on a small sample instead of tokenizing multi-million-token
|
||||
# overshoots and ~20 full-sized binary-search probes.
|
||||
overhead=count(prompt([]));sample=count(prompt(corpus(100)));per_row=max(1,(sample-overhead)/100)
|
||||
n=max(0,int((target-overhead)/per_row));rows=corpus(n+1000)
|
||||
for _ in range(8):
|
||||
if n>len(rows):rows=corpus(n+1000)
|
||||
actual=count(prompt(rows[:n]));delta=target-actual
|
||||
if 0<=delta<max(64,per_row*2):break
|
||||
step=int(delta/per_row)
|
||||
if step==0:step=1 if delta>0 else -1
|
||||
n=max(0,n+step)
|
||||
else:raise RuntimeError('exact tokenizer calibration did not converge')
|
||||
while count(prompt(rows[:n]))>target:n-=1
|
||||
lo=n
|
||||
text=prompt(rows[:lo]);actual=count(text)
|
||||
prefix=''.join(rows[:lo//2])
|
||||
position=count(prefix)
|
||||
@@ -120,7 +126,10 @@ def run(a):
|
||||
# Fresh first system token sequence defeats shared-prefix caching.
|
||||
system='Messkennung '+secrets.token_hex(16)+'. '+SYSTEM
|
||||
def count(text):return request('/v1/messages/count_tokens',{'model':'synthetic-context-test','system':system,'messages':[{'role':'user','content':text}]})['input_tokens']
|
||||
if name in shared_fixtures:
|
||||
baseline=P(a.reuse_fixtures)/f'fixture-131072-{name}.json' if a.reuse_fixtures else None
|
||||
if baseline and baseline.exists():
|
||||
case=json.loads(baseline.read_text());case.pop('system',None);case['counted_tokens']=count(case['text'])
|
||||
elif name in shared_fixtures:
|
||||
case=dict(shared_fixtures[name]);case['counted_tokens']=count(case['text'])
|
||||
else:
|
||||
case=choose_prompt(target,count);shared_fixtures[name]=dict(case)
|
||||
@@ -143,6 +152,7 @@ def run(a):
|
||||
save('complete')
|
||||
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('--go',action='store_true');p.add_argument('--base-config',default='/var/lib/deck/strata-worker/worker.json');p.add_argument('--output',default='/experiment');a=p.parse_args()
|
||||
p=argparse.ArgumentParser();p.add_argument('--go',action='store_true');p.add_argument('--contexts',nargs='+',type=int,choices=(131072,262144,524288,1000000));p.add_argument('--reuse-fixtures');p.add_argument('--base-config',default='/var/lib/deck/strata-worker/worker.json');p.add_argument('--output',default='/experiment');a=p.parse_args()
|
||||
if not a.go:print(json.dumps({'state':'prepared_only','contexts':CONTEXTS,'output_tokens':OUTPUT,'inference_started':False}));raise SystemExit(0)
|
||||
if a.contexts:CONTEXTS=tuple(a.contexts)
|
||||
run(a)
|
||||
@@ -1,7 +1,18 @@
|
||||
"""Run the authorized isolated test and restore prior IQ3 through normal API."""
|
||||
import json,pathlib,subprocess,time,urllib.request
|
||||
stage=pathlib.Path('/opt/athena-deck-dev/context-prepared-20261013');out=pathlib.Path('/data/experiments/strata-context-20261013')
|
||||
rc=subprocess.run(['python3',str(stage/'launch.py'),'--go']).returncode
|
||||
attempts=[]
|
||||
for context in (1000000,524288):
|
||||
out.mkdir(parents=True,exist_ok=True)
|
||||
(out/'extended-status.json').write_text(json.dumps({'phase':'running','context':context,'attempts':attempts}))
|
||||
rc=subprocess.run(['python3',str(stage/'launch.py'),'--go','--context',str(context)]).returncode
|
||||
resultpath=out/f'extended-{context}'/'results.json'
|
||||
rows=json.loads(resultpath.read_text()) if resultpath.exists() else []
|
||||
full=next((r for r in rows if r['case']=='full-max'),None)
|
||||
usable=rc==0 and full is not None and full.get('needle_exact') is True
|
||||
attempts.append({'context':context,'returncode':rc,'complete':rc==0,'full_needle_ok':bool(full and full.get('needle_exact')),'usable':usable})
|
||||
if usable:break
|
||||
(out/'extended-status.json').write_text(json.dumps({'phase':'complete','attempts':attempts}))
|
||||
result={'benchmark_returncode':rc,'restored':False}
|
||||
try:
|
||||
c=json.loads(subprocess.check_output(['docker','inspect','athena-voxcpm2-web']))[0]
|
||||
@@ -15,6 +26,6 @@ try:
|
||||
with urllib.request.urlopen(urllib.request.Request('http://127.0.0.1:8120/v1/chat/completions',headers=headers,data=json.dumps(body).encode()),timeout=240) as r:
|
||||
value=json.load(r);result.update(restored=r.status==200,restore_usage=value.get('usage',{}))
|
||||
except Exception as e:result['restore_error_type']=type(e).__name__
|
||||
out.mkdir(parents=True,exist_ok=True);(out/'restore.json').write_text(json.dumps(result))
|
||||
out.mkdir(parents=True,exist_ok=True);(out/'extended-restore.json').write_text(json.dumps(result))
|
||||
print(json.dumps(result),flush=True)
|
||||
raise SystemExit(rc)
|
||||
@@ -1,16 +1,16 @@
|
||||
"""Athena host launcher. Explicit --go, regularly unloaded Deck required."""
|
||||
import argparse,json,pathlib,subprocess,urllib.request
|
||||
p=argparse.ArgumentParser();p.add_argument('--go',action='store_true');a=p.parse_args()
|
||||
p=argparse.ArgumentParser();p.add_argument('--go',action='store_true');p.add_argument('--context',type=int,choices=(1000000,524288),required=True);a=p.parse_args()
|
||||
if not a.go:print('Prepared only. No services changed.');raise SystemExit(0)
|
||||
stage=pathlib.Path('/opt/athena-deck-dev/context-prepared-20261013');output=pathlib.Path('/data/experiments/strata-context-20261013')
|
||||
c=json.loads(subprocess.check_output(['docker','inspect','athena-voxcpm2-web']))[0]
|
||||
f=next(pathlib.Path(m['Source']) for m in c['Mounts'] if m['Destination']=='/data');token=json.loads((f/'deck-connection.json').read_text())['token']
|
||||
status=json.load(urllib.request.urlopen(urllib.request.Request('http://127.0.0.1:8108/api/v1/status',headers={'Authorization':'Bearer '+token}),timeout=15))
|
||||
if status['endpoint']['active_requests'] or status['endpoint']['counts']['llm']['loaded']:raise SystemExit('Regularly unload the Deck LLM first; no test started.')
|
||||
output.mkdir(parents=True,exist_ok=True);subprocess.run(['chown','65534:65534',str(output)],check=True)
|
||||
if not output.is_dir():raise SystemExit('Previously authorized result directory missing')
|
||||
c=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev']))[0]
|
||||
args=['docker','run','--rm','--name','athena-strata-context-test','--gpus','all','--user','65534:65534','--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true','--memory','40g','--memory-swap','40g','--cpus','6','--network','none','--tmpfs','/tmp:rw,nosuid,nodev,size=512m','--entrypoint','python3']
|
||||
args=['docker','run','--rm','--name','athena-strata-context-test','--gpus','all','--user','65534:65534','--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true','--memory','43g','--memory-swap','43g','--cpus','6','--network','none','--tmpfs','/tmp:rw,nosuid,nodev,size=512m','--entrypoint','python3']
|
||||
for m in c['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={output},dst=/experiment',c['Config']['Image'],'/test/benchmark.py','--go','--base-config','/test/base-template.json']
|
||||
args+=['--mount',f'type=bind,src={stage},dst=/test,readonly','--mount',f'type=bind,src={output},dst=/experiment',c['Config']['Image'],'/test/benchmark.py','--go','--base-config','/test/base-template.json','--contexts',str(a.context),'--output',f'/experiment/extended-{a.context}','--reuse-fixtures','/experiment']
|
||||
raise SystemExit(subprocess.run(args).returncode)
|
||||
Reference in new issue
Block a user