From 482add7ca4d7ab76b83e373a50d6b775284324cd Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:37:45 +0200 Subject: [PATCH] Test single-slot memory pressure and update Strata to 0.1.44.1 --- deploy/STRATA_NATIVE.md | 34 ++- deploy/install_strata.py | 4 + .../README.md | 162 ++++++++++ .../acceptance.json | 43 +++ .../after_tests.py | 12 + .../build.py | 28 ++ .../final-status.json | 40 +++ .../launch.py | 33 ++ .../measure.py | 186 ++++++++++++ .../restore-after-update.json | 1 + .../results/262144.json | 287 ++++++++++++++++++ .../results/524288.json | 287 ++++++++++++++++++ .../results/settings-262144.json | 1 + .../results/settings-524288.json | 1 + .../single.py | 57 ++++ .../smoke.py | 30 ++ .../update.py | 40 +++ .../versions.json | 21 ++ strata_sources.json | 4 +- 19 files changed, 1268 insertions(+), 3 deletions(-) create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/README.md create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/acceptance.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/after_tests.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/build.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/final-status.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/launch.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/measure.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/restore-after-update.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/results/262144.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/results/524288.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-262144.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-524288.json create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/single.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/smoke.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/update.py create mode 100644 docs/experiments/strata-single-slot-memory-2026-10-14/versions.json diff --git a/deploy/STRATA_NATIVE.md b/deploy/STRATA_NATIVE.md index bc4e92c..48b56bc 100644 --- a/deploy/STRATA_NATIVE.md +++ b/deploy/STRATA_NATIVE.md @@ -1,6 +1,6 @@ # Strata in Athena Deck -Strata 0.1.43.1, Commit `a0116b2782a5b82622358c04a06496485d12b2d6`, ist eine +Strata 0.1.44.1, Commit `296b59d2f73c8f04a805df29c2fa97655adace78`, ist eine zweite Chat-Laufzeit. Deck startet das unveränderte `serve/server.py` und dessen Engine als eigene Prozessgruppe auf einem zufälligen Loopback-Port mit einem zufälligen, nur lokal gespeicherten Token. Clients verwenden weiterhin den @@ -166,6 +166,38 @@ aktuelle qualifizierte Runtime gepinnt. Eine frühere Sicherung mit 0.1.42 kann wegen der Versionsprüfung nicht blind in den neuen Stand eingespielt werden. Historische Benchmarkzahlen sind kein Geschwindigkeitsnachweis für 0.1.43.1. +## Direktes Update vom 14. Oktober 2026 + +Nutzerauftrag: zuerst den Speicherdruck der Single-Slot-Profile 262K und 512K +messen, danach die bestehende Strata-Laufzeit direkt durch das neueste offizielle +Release ersetzen, ohne eine neue Rückfallsicherung. Neues gepinntes Release: +v0.1.44.1, Commit `296b59d2f73c8f04a805df29c2fa97655adace78`. +Gewichte, IQ3_XXS-Quantisierung, API-IDs, Kontextgrößen, GPU-Zuordnung und +44-GiB-Speicherlimit bleiben unverändert. Keine Treiberänderung oder Host-Reboot. + +Der native Installer baut die Engine und kopiert auch das neue optionale +K-Quant-MMQ-Modul `libstrata_kq.so` neben die Engine, sofern das Build dieses +Target aktiviert. Der vorhandene IQ3-Buildcache auf Athena hält +`STRATA_MMQ_KQUANTS=OFF` bei; IQ3_XXS benötigt das Modul nicht. Bei einem frischen +Build gilt der neue upstream-Standard ON und das Modul wird mitkopiert. CPU-Vision +wird aus derselben Revision neu gebaut. Vorhandene Modellpakete werden durch +das offizielle Setup mit explizitem `--model IQ3_XXS` bzw. `IQ2_XS` und +`--no-start` geprüft; der geänderte upstream-Standard IQ3_S darf nicht still +übernommen werden. Erst nach erfolgreicher Prüfung werden die Commit-Marker +angepasst. Keine neuen Modellgewichte erforderlich. + +Heutiger Containertransport: native Installer in einem temporären Build-Container +mit bestehenden Runtime-/Modell-Mounts ausführen; danach ein minimales Deck-App- +Image mit identischem Rezept einspielen. Das Deployment erhält insbesondere +`strata_storage_mounts`, die Samsung-980-Symlinks sowie RAM-/Swap-Limits. +Beim zukünftigen nativen Dienst dieselben Installer im konfigurierten Dienstkonto +ausführen und Deck anschließend regulär neu starten. Ein produktiver GPU-Worker +muss vor Quell-/Binary-Austausch regulär entladen und der Endpunkt inaktiv sein. +Das ist kein neuer vollständiger Restore-Nachweis auf einem frischen Debian. + +Messungen, tatsächlicher Installationsnachweis und Einschränkungen: +`docs/experiments/strata-single-slot-memory-2026-10-14/README.md`. + ## Hardwarequalifiziertes Tuning (13. Oktober 2026) `strata_sources.json.performance` enthält die gemessenen IQ3-Laufzeitoptionen diff --git a/deploy/install_strata.py b/deploy/install_strata.py index eb40086..599dc40 100644 --- a/deploy/install_strata.py +++ b/deploy/install_strata.py @@ -38,6 +38,10 @@ def install(destination,nvcc=None,architectures='86;120',update=False): run([cmake,'-S',source,'-B',source/'build','-G','Ninja','-DCMAKE_BUILD_TYPE=Release','-DSTRATA_ENABLE_CUDA=ON','-DSTRATA_BUILD_TESTS=OFF','-DSTRATA_GGML_DIR='+str(source/'third_party/llama.cpp'),'-DCMAKE_CUDA_ARCHITECTURES='+architectures,'-DCMAKE_CUDA_COMPILER='+str(nvcc)],env=env) run([cmake,'--build',source/'build','--target','strata','-j','2'],env=env) (source/'engine').mkdir(exist_ok=True);shutil.copy2(source/'build/strata',source/'engine/strata') + # Since 0.1.44 CUDA K-quant MMQ kernels are a separately loaded library. + # IQ3 does not need them, but a restored runtime must include what we built. + kq=source/'build/libstrata_kq.so' + if kq.is_file():shutil.copy2(kq,source/'engine/libstrata_kq.so') (source/'engine/BUILD.json').write_text(json.dumps(dict(source='local',version=RECIPE['version'],cuda_architectures=architectures,vision=False))) version_output=subprocess.check_output([source/'engine/strata','--version'],text=True,stderr=subprocess.STDOUT) if RECIPE['version'] not in version_output:raise ValueError('Gebautes Strata-Binary meldet nicht die erwartete Version.') diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/README.md b/docs/experiments/strata-single-slot-memory-2026-10-14/README.md new file mode 100644 index 0000000..f991ffb --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/README.md @@ -0,0 +1,162 @@ +# Single-slot memory pressure and direct Strata update, 2026-10-14 + +Explicit user request: test existing single-slot 262K and 512K profiles for the +same memory pressure as dual-slot; then compile and directly replace Strata +with the newest official release. No extra fallback generation. User reported +the system idle and authorized maintenance while away. + +## Protocol + +Test the old installed runtime 0.1.43.1 first, before modifying its source or +binaries. Exact same IQ3_XXS weights, layer split 16, GPU order 3060 / 5080, +1024-MiB reserves, int8 KV, 32768 GPU-resident KV, CPU vision, resident experts +with 6-GiB headroom and previous measured performance arguments. Actual profiles +were read and confirmed to differ in context/slot count only for this purpose. +Single-slot tests remove dual-only batch flags. 512K uses the existing YaRN +factor 2; 262K does not change native RoPE. + +Each profile uses a separate fresh isolated container/cgroup: 44 GiB, no extra +swap, six CPU equivalents, UID 65534, read-only production mounts/root, no +network beyond loopback. CPU STT and Deck remain running. Production LLM was +regularly unloaded through the authenticated GUI with no active requests. +OpenWebUI remains stopped. No private inputs, raw model responses or production +logs are used/saved. Generated text is held in RAM only for a cached follow-up. + +Five cases per profile: short request (512 output tokens), identical fresh +~131072-token prompt (128 output), its cached continuation (256 output), +near-full window (~245760 or ~491520 input tokens, 128 output), then its cached +continuation (256 output). Installed tokenizer calibrates exact input size. +The first 128K fixture is copied unchanged between the two fresh containers. +Measure actual backend timings/usage/cache, peak cgroup memory, full memory PSI, +major faults, file refaults, cgroup limit/OOM events, engine disk reads and GPU +samples. One measurement per case, not a statistically estimated speed ratio. + +Paths: `/opt/athena-deck-dev/single-update-20261014` and +`/data/experiments/strata-single-memory-20261014/{262144,524288}`. +Own unit `athena-strata-single-memory-20261014`; temporary test containers named +`athena-strata-single-{262144,524288}-20261014`, removed on exit. +The launcher intentionally leaves LLM unloaded after tests for the subsequent +authorized runtime replacement. It never starts an update before tests finish. + +## Direct update + +Official latest release verified at execution: +https://github.com/Niko1221/Strata/releases/tag/v0.1.44.1 + +Annotated tag object `9791ea335ba2001c87b5f783146d6eb08fdd9e5e`, peeled source +commit **296b59d2f73c8f04a805df29c2fa97655adace78**. Use the peeled commit in +`strata_sources.json`; do not confuse the tag object with the source revision. + +`build.py` uses the native version-pinned installers in the existing runtime +path. Compiler targets sm_86 and sm_120, private CUDA 13.0, two build jobs. +CPU vision is rebuilt; official setup verifies existing explicitly selected +IQ3_XXS/IQ2_XS packs without starting inference or accepting the new IQ3_S default. +No new weights or driver changes. Only successful setup advances prepared +markers. `deploy/install_strata.py` now also copies the K-quant MMQ shared +library supplied by 0.1.44 **if built**. The existing Athena build cache retains +`STRATA_MMQ_KQUANTS=OFF` (also `STRATA_PREFILL_MMQ=OFF`), so that optional library +is not built/present in this qualified IQ3 installation and is not required +by IQ3. A fresh build uses upstream's new ON default and copies its library. + +`update.py` checks tests complete, zero active requests and LLM unloaded before +changing the runtime. A temporary build container has 16-GiB memory/no additional +swap and six CPU equivalents, existing writable runtime/model mounts, no exposed +ports. Then a minimal child image replaces the installed Deck image, carrying +only matching recipe/installers, with existing manifest/mounts/limits preserved. +No fallback image/container/config copy is created. A brief regular Deck restart +is needed to load the matching pinned recipe; no host/OpenCode/OpenWebUI restart. +Finally restore previous `flash-next-strata-iq3-dual` via regular inference API +and verify actual loaded state. This is a maintenance action explicitly requested +in this turn, not a production restart during an active coding task. + +Native restore requirements remain in `deploy/STRATA_NATIVE.md`; Docker here is +only the current transport/toolchain. No complete native fresh-host restore +test is claimed. Credentials stay in their existing files and are used internally; +no keys, templates with real auth, raw responses or weights belong in Git. + +## Pre-update memory results (0.1.43.1) + +Both profiles completed all five cases with zero OOM kills. Engine-confirmed +one serving slot, actual expert RAM: 21.72 GiB for 262K and 21.92 GiB for 512K. +These are actual automatic allocations, not a claim of identical pinned budgets. +The fresh 128K input was identical; near-full inputs differ in size as shown. +Files `results/262144.json` and `results/524288.json` contain metrics only. + +| Profile / case | Actual input tokens | Wall time | Backend input token/s | Backend output token/s | Peak cgroup RAM | Full memory PSI | Engine storage read | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| 262K / short | 47 | 8.3 s | 79.7 | 66.1 | 30.95 GiB | 0% | 0.05 GiB | +| 262K / fresh 128K | 131072 | 68.2 s | 1981.3 | 64.7 | 39.13 GiB | 0.012% | 7.17 GiB | +| 262K / cached 128K | 131233 | 4.2 s | 88.4 | 67.5 | 39.09 GiB | 0% | 0.02 GiB | +| 262K / fresh near-full | 245732 | 131.3 s | 1900.6 | 67.5 | 40.71 GiB | 0.002% | 1.56 GiB | +| 262K / cached near-full | 245893 | 4.2 s | 104.8 | 68.3 | 40.68 GiB | 0% | 0.02 GiB | +| 512K / short | 47 | 8.6 s | 76.2 | 64.3 | 37.49 GiB | 0% | 0.05 GiB | +| 512K / fresh 128K | 131072 | 71.2 s | 1893.0 | 66.3 | 43.42 GiB | 0% | 8.05 GiB | +| 512K / cached 128K | 131233 | 4.2 s | 89.1 | 68.1 | 43.37 GiB | 0% | 0.02 GiB | +| 512K / fresh near-full | 491504 | 301.1 s | 1644.5 | 64.3 | 44.00 GiB | 0.251% | 2.18 GiB | +| 512K / cached near-full | 491665 | 4.8 s | 91.0 | 61.2 | 43.89 GiB | 0.019% | 0.02 GiB | + +The small cached input rates describe only 33–34 *new* tokens and are not +whole-context rereading rates. Both near-full continuations reused their +prefixes (245859 and 491632 tokens). No cgroup memory-limit events occurred +in any 262K case. 512K near-full had 1970 limit events, 11 in its continuation; +these are memory reclamation events, not OOMs or aborted generations. + +**Conclusion:** the severe dual-slot pressure was not reproduced by either +single-slot profile. 262K has clear reserve in these tests. 512K has much less +reserve and briefly hits the cap, but measured full memory PSI stayed about +0.25%, versus roughly 30% in the prior dual-slot fresh-context cases. Do not +confuse high RAM/cache occupancy with severe memory stalls. Host page cache +was not flushed and measurement order affects physical storage reads; these +are warm-system experiments, not guaranteed first-boot cold-start numbers. +Both single-slot near-full tests also had zero prefix reuse on the initial +request, so their low storage traffic is not explained by skipping prompt work. +CPU vision was present but these memory cases did not process an image. + +## Validation + +Python compile checks pass. Existing 14 `test_strata.py` tests, including the +encrypted backup/restore-version plan, pass in an isolated container using the +existing application image with the new pinned recipe. No production mounts, +network or exposed ports. Synthetic setup mode was enabled **only in that test +container**. Local macOS attempts first encountered the sandbox loopback bind +restriction, then a missing local `cryptography` package; no production workaround +or dependency change was made for those local test-environment limitations. +This does not constitute a native fresh-host restore acceptance. + +## Installed update and endpoint acceptance + +Completed 14 October 2026, approximately 13:33 Europe/Berlin. Direct native +build in the existing path; no new fallback generation. CPU vision and both +existing prepared packs were checked successfully. Minimal Deck image now +`athena-deck-standalone:strata-0.1.44.1-20261014`; installed binary reports +`strata 0.1.44.1`. Source HEAD, runtime `ready.json`, CPU `vision-ready.json` +and the recipe actually loaded by Deck all match +`296b59d2f73c8f04a805df29c2fa97655adace78`. +See `versions.json` (including binary SHA-256). Actual cgroup memory and +memory+swap limit remain 44 GiB; Samsung-980 extra mount is present. + +`restore-after-update.json` confirms regular HTTP 200 generation on the prior +`flash-next-strata-iq3-dual` and actual loaded state. `acceptance.json` records: + +- Two synchronized synthetic text requests, HTTP 200 each, 256 output tokens + each, nonempty replies, completed in 9.62 and 9.35 seconds. Regular Deck status + observed **two active requests at once**. These short acceptance timings are + not the earlier resource benchmark or a statistically qualified speed claim. +- Synthetic red 128×128 image through the normal Deck API: HTTP 200 and correct + red-color recognition, confirming CPU-Vision integration after the rebuild. +- Zero active requests after acceptance, LLM still loaded. Final status also + confirms CPU STT loaded and unchanged IQ3 API IDs, contexts and slot counts. +- Both own single-memory/update systemd jobs inactive, test containers removed. + +The native Mac app could not be visually rechecked after activation because +the user's Mac was locked while away. No automatic unlock/login bypass was +attempted. Verification above comes from the actual regular endpoint, runtime +files and container settings; no GUI confirmation or fresh-host restore is +claimed. The earlier memory table explicitly describes **pre-update 0.1.43.1**; +the new release was accepted with short parallel text and CPU vision, not +silently credited with the old version's long-context measurements. + +Reproduction uses existing `test_strata.py`, the native pinned installers and +the included synthetic harness. `after_tests.py` is a one-shot sequence, not +a recurring automation. Build/progress logs and synthetic fixture text remain +in the experiment directory on Athena and are not committed to Git. diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/acceptance.json b/docs/experiments/strata-single-slot-memory-2026-10-14/acceptance.json new file mode 100644 index 0000000..0041706 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/acceptance.json @@ -0,0 +1,43 @@ +{ + "text_requests": [ + { + "http_status": 200, + "seconds": 9.624581525989925, + "usage": { + "prompt_tokens": 26, + "completion_tokens": 256, + "total_tokens": 282, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "nonempty": true + }, + { + "http_status": 200, + "seconds": 9.345493546003127, + "usage": { + "prompt_tokens": 31, + "completion_tokens": 256, + "total_tokens": 287, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "nonempty": true + } + ], + "max_observed_active_requests": 2, + "vision_http_status": 200, + "vision_red_recognized": true, + "vision_usage": { + "prompt_tokens": 48, + "completion_tokens": 2, + "total_tokens": 50, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "active_requests_after": 0, + "loaded_after": true +} \ No newline at end of file diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/after_tests.py b/docs/experiments/strata-single-slot-memory-2026-10-14/after_tests.py new file mode 100644 index 0000000..5b42c68 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/after_tests.py @@ -0,0 +1,12 @@ +"""One-shot sequencing only; never interrupt a test or start extra tests.""" +import json,pathlib,subprocess,time +root=pathlib.Path('/data/experiments/strata-single-memory-20261014') +deadline=time.monotonic()+7200 +while time.monotonic()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-single-slot-memory-2026-10-14/restore-after-update.json b/docs/experiments/strata-single-slot-memory-2026-10-14/restore-after-update.json new file mode 100644 index 0000000..a315682 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/restore-after-update.json @@ -0,0 +1 @@ +{"version": "0.1.44.1", "http_status": 200, "model": "flash-next-strata-iq3-dual", "loaded": true, "active_requests": 0, "backup_created": false} \ No newline at end of file diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/results/262144.json b/docs/experiments/strata-single-slot-memory-2026-10-14/results/262144.json new file mode 100644 index 0000000..97f3b14 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/results/262144.json @@ -0,0 +1,287 @@ +[ + { + "arm": "single-262144", + "case": "short", + "requests": 1, + "wall_seconds": 8.340111433004495, + "aggregate_output_tok_s": 61.39006704081337, + "rows": [ + { + "wall_seconds": 8.340038196009118, + "ttft_seconds": 0.6307227550132666, + "usage": { + "prompt_tokens": 47, + "completion_tokens": 512, + "total_tokens": 559, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 47, + "prompt_ms": 589.6, + "prompt_per_token_ms": 12.545, + "prompt_per_second": 79.7, + "predicted_n": 512, + "predicted_ms": 7746.8, + "predicted_per_token_ms": 15.13, + "predicted_per_second": 66.1, + "draft_n": 269, + "draft_n_accepted": 172 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 30.94940948486328, + "read_gib": 0.054141998291015625, + "read_mib_s": 6.647561809618105, + "refaults": 0, + "major_faults": 1, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.878818334006015, + "pressure_full_percent": 0.0, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 20.5, + "peak_memory_mib": 11249.0 + }, + "1": { + "mean_utilization": 29.0, + "peak_memory_mib": 15524.0 + } + } + } + }, + { + "arm": "single-262144", + "case": "cold-131072", + "requests": 1, + "wall_seconds": 68.19656064300216, + "aggregate_output_tok_s": 1.8769274988816382, + "rows": [ + { + "wall_seconds": 68.19648740600678, + "ttft_seconds": 66.23631558900524, + "usage": { + "prompt_tokens": 131072, + "completion_tokens": 128, + "total_tokens": 131200, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131072, + "prompt_ms": 66153.0, + "prompt_per_token_ms": 0.505, + "prompt_per_second": 1981.3, + "predicted_n": 128, + "predicted_ms": 1978.0, + "predicted_per_token_ms": 15.453, + "predicted_per_second": 64.7, + "draft_n": 69, + "draft_n_accepted": 49 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 39.1279296875, + "read_gib": 7.173004150390625, + "read_mib_s": 107.70566991568228, + "refaults": 5, + "major_faults": 30766, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 1.16838736805382, + "pressure_full_percent": 0.012450774525784367, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 95.85714285714286, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 52.07142857142857, + "peak_memory_mib": 15580.0 + } + } + } + }, + { + "arm": "single-262144", + "case": "cached-131072", + "requests": 1, + "wall_seconds": 4.248033206997206, + "aggregate_output_tok_s": 60.26318240128775, + "rows": [ + { + "wall_seconds": 4.247962383989943, + "ttft_seconds": 0.47587463600211777, + "usage": { + "prompt_tokens": 131233, + "completion_tokens": 256, + "total_tokens": 131489, + "prompt_tokens_details": { + "cached_tokens": 131199 + } + }, + "backend_timings": { + "cache_n": 131199, + "prompt_n": 34, + "prompt_ms": 384.6, + "prompt_per_token_ms": 11.312, + "prompt_per_second": 88.4, + "predicted_n": 256, + "predicted_ms": 3793.4, + "predicted_per_token_ms": 14.818, + "predicted_per_second": 67.5, + "draft_n": 151, + "draft_n_accepted": 108 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 39.09386444091797, + "read_gib": 0.0212554931640625, + "read_mib_s": 5.123694646300893, + "refaults": 0, + "major_faults": 0, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.755604725435489, + "pressure_full_percent": 0.0, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 28.0, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 67.0, + "peak_memory_mib": 15580.0 + } + } + } + }, + { + "arm": "single-262144", + "case": "cold-245760", + "requests": 1, + "wall_seconds": 131.31004364699766, + "aggregate_output_tok_s": 0.9747921518029795, + "rows": [ + { + "wall_seconds": 131.3099300640024, + "ttft_seconds": 129.42870114000107, + "usage": { + "prompt_tokens": 245732, + "completion_tokens": 128, + "total_tokens": 245860, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 245732, + "prompt_ms": 129293.8, + "prompt_per_token_ms": 0.526, + "prompt_per_second": 1900.6, + "predicted_n": 128, + "predicted_ms": 1897.7, + "predicted_per_token_ms": 14.826, + "predicted_per_second": 67.5, + "draft_n": 67, + "draft_n_accepted": 46 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 40.7127685546875, + "read_gib": 1.5624160766601562, + "read_mib_s": 12.184247435032981, + "refaults": 0, + "major_faults": 6218, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 1.0954226805885983, + "pressure_full_percent": 0.0021582507486012843, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 91.70370370370371, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 42.7037037037037, + "peak_memory_mib": 15590.0 + } + } + } + }, + { + "arm": "single-262144", + "case": "cached-245760", + "requests": 1, + "wall_seconds": 4.193191621001461, + "aggregate_output_tok_s": 61.05134778907611, + "rows": [ + { + "wall_seconds": 4.193123763005133, + "ttft_seconds": 0.4659214749990497, + "usage": { + "prompt_tokens": 245893, + "completion_tokens": 256, + "total_tokens": 246149, + "prompt_tokens_details": { + "cached_tokens": 245859 + } + }, + "backend_timings": { + "cache_n": 245859, + "prompt_n": 34, + "prompt_ms": 324.3, + "prompt_per_token_ms": 9.538, + "prompt_per_second": 104.8, + "predicted_n": 256, + "predicted_ms": 3747.1, + "predicted_per_token_ms": 14.637, + "predicted_per_second": 68.3, + "draft_n": 154, + "draft_n_accepted": 105 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 40.67921447753906, + "read_gib": 0.015766143798828125, + "read_mib_s": 3.850177313419366, + "refaults": 0, + "major_faults": 0, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.709254945587821, + "pressure_full_percent": 0.0, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 40.0, + "peak_memory_mib": 11289.0 + }, + "1": { + "mean_utilization": 48.0, + "peak_memory_mib": 15590.0 + } + } + } + } +] \ No newline at end of file diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/results/524288.json b/docs/experiments/strata-single-slot-memory-2026-10-14/results/524288.json new file mode 100644 index 0000000..aa757be --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/results/524288.json @@ -0,0 +1,287 @@ +[ + { + "arm": "single-524288", + "case": "short", + "requests": 1, + "wall_seconds": 8.589486170996679, + "aggregate_output_tok_s": 59.60775648359769, + "rows": [ + { + "wall_seconds": 8.589409957989119, + "ttft_seconds": 0.6589462979900418, + "usage": { + "prompt_tokens": 47, + "completion_tokens": 512, + "total_tokens": 559, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 47, + "prompt_ms": 616.8, + "prompt_per_token_ms": 13.123, + "prompt_per_second": 76.2, + "predicted_n": 512, + "predicted_ms": 7966.1, + "predicted_per_token_ms": 15.559, + "predicted_per_second": 64.3, + "draft_n": 303, + "draft_n_accepted": 191 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 37.48900604248047, + "read_gib": 0.05385589599609375, + "read_mib_s": 6.42045826748224, + "refaults": 0, + "major_faults": 0, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.8757880268108895, + "pressure_full_percent": 0.0, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 18.0, + "peak_memory_mib": 11249.0 + }, + "1": { + "mean_utilization": 26.0, + "peak_memory_mib": 15520.0 + } + } + } + }, + { + "arm": "single-524288", + "case": "cold-131072", + "requests": 1, + "wall_seconds": 71.242702189993, + "aggregate_output_tok_s": 1.7966752532581411, + "rows": [ + { + "wall_seconds": 71.2426205160009, + "ttft_seconds": 69.33030188399425, + "usage": { + "prompt_tokens": 131072, + "completion_tokens": 128, + "total_tokens": 131200, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 131072, + "prompt_ms": 69238.7, + "prompt_per_token_ms": 0.528, + "prompt_per_second": 1893.0, + "predicted_n": 128, + "predicted_ms": 1930.9, + "predicted_per_token_ms": 15.085, + "predicted_per_second": 66.3, + "draft_n": 69, + "draft_n_accepted": 51 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.41750717163086, + "read_gib": 8.048011779785156, + "read_mib_s": 115.67730882136, + "refaults": 6, + "major_faults": 34819, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 1.1639086875012896, + "pressure_full_percent": 2.8073050832158457e-06, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 91.46666666666667, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 42.333333333333336, + "peak_memory_mib": 15578.0 + } + } + } + }, + { + "arm": "single-524288", + "case": "cached-131072", + "requests": 1, + "wall_seconds": 4.198339095004485, + "aggregate_output_tok_s": 60.97649432476976, + "rows": [ + { + "wall_seconds": 4.198248294997029, + "ttft_seconds": 0.45782527899427805, + "usage": { + "prompt_tokens": 131233, + "completion_tokens": 256, + "total_tokens": 131489, + "prompt_tokens_details": { + "cached_tokens": 131200 + } + }, + "backend_timings": { + "cache_n": 131200, + "prompt_n": 33, + "prompt_ms": 370.5, + "prompt_per_token_ms": 11.227, + "prompt_per_second": 89.1, + "predicted_n": 256, + "predicted_ms": 3757.4, + "predicted_per_token_ms": 14.677, + "predicted_per_second": 68.1, + "draft_n": 138, + "draft_n_accepted": 94 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.36903381347656, + "read_gib": 0.023090362548828125, + "read_mib_s": 5.631877443661978, + "refaults": 0, + "major_faults": 10, + "limit_events": 0, + "oom_kill_delta": 0, + "cpu_cores": 5.764184229138391, + "pressure_full_percent": 2.381894309561319e-05, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 21.0, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 52.0, + "peak_memory_mib": 15578.0 + } + } + } + }, + { + "arm": "single-524288", + "case": "cold-491520", + "requests": 1, + "wall_seconds": 301.10723286500433, + "aggregate_output_tok_s": 0.4250977260894505, + "rows": [ + { + "wall_seconds": 301.1071569240012, + "ttft_seconds": 299.1330768480111, + "usage": { + "prompt_tokens": 491504, + "completion_tokens": 128, + "total_tokens": 491632, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "backend_timings": { + "cache_n": 0, + "prompt_n": 491504, + "prompt_ms": 298873.8, + "prompt_per_token_ms": 0.608, + "prompt_per_second": 1644.5, + "predicted_n": 128, + "predicted_ms": 1991.8, + "predicted_per_token_ms": 15.561, + "predicted_per_second": 64.3, + "draft_n": 65, + "draft_n_accepted": 49 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.999996185302734, + "read_gib": 2.179107666015625, + "read_mib_s": 7.410669709818656, + "refaults": 142628, + "major_faults": 18521, + "limit_events": 1970, + "oom_kill_delta": 0, + "cpu_cores": 1.0547405220995982, + "pressure_full_percent": 0.25061337544764895, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 96.13333333333334, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 48.516666666666666, + "peak_memory_mib": 15596.0 + } + } + } + }, + { + "arm": "single-524288", + "case": "cached-491520", + "requests": 1, + "wall_seconds": 4.785418961007963, + "aggregate_output_tok_s": 53.49583852237635, + "rows": [ + { + "wall_seconds": 4.785312750987941, + "ttft_seconds": 0.6256935699930182, + "usage": { + "prompt_tokens": 491665, + "completion_tokens": 256, + "total_tokens": 491921, + "prompt_tokens_details": { + "cached_tokens": 491632 + } + }, + "backend_timings": { + "cache_n": 491632, + "prompt_n": 33, + "prompt_ms": 362.7, + "prompt_per_token_ms": 10.991, + "prompt_per_second": 91.0, + "predicted_n": 256, + "predicted_ms": 4181.8, + "predicted_per_token_ms": 16.335, + "predicted_per_second": 61.2, + "draft_n": 151, + "draft_n_accepted": 99 + }, + "finish_reason": "length" + } + ], + "resources": { + "peak_memory_gib": 43.89266586303711, + "read_gib": 0.020603179931640625, + "read_mib_s": 4.4087375466820475, + "refaults": 6, + "major_faults": 8, + "limit_events": 11, + "oom_kill_delta": 0, + "cpu_cores": 5.57317973981163, + "pressure_full_percent": 0.01863995623514051, + "peak_processing_slots": 1, + "gpu_samples": { + "0": { + "mean_utilization": 48.0, + "peak_memory_mib": 11295.0 + }, + "1": { + "mean_utilization": 50.0, + "peak_memory_mib": 15596.0 + } + } + } + } +] \ No newline at end of file diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-262144.json b/docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-262144.json new file mode 100644 index 0000000..bc89e56 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-262144.json @@ -0,0 +1 @@ +{"context": 262144, "slots": 1, "allocated_expert_gib": 21.72, "memory_limit_gib": 44, "vision": "cpu", "rope_scale": 1} \ No newline at end of file diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-524288.json b/docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-524288.json new file mode 100644 index 0000000..5c49db2 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/results/settings-524288.json @@ -0,0 +1 @@ +{"context": 524288, "slots": 1, "allocated_expert_gib": 21.92, "memory_limit_gib": 44, "vision": "cpu", "rope_scale": 2} \ No newline at end of file diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/single.py b/docs/experiments/strata-single-slot-memory-2026-10-14/single.py new file mode 100644 index 0000000..28c1530 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/single.py @@ -0,0 +1,57 @@ +"""Synthetic single-slot pressure test; no production inputs or responses saved.""" +import copy,json,os,pathlib,re,signal,socket,subprocess,time +import measure as b +P=pathlib.Path +CTX=int(os.environ['TEST_CONTEXT']) +b.ROOT=P('/experiment');b.RESULTS=[] +def run(): + cfg=json.loads(P('/test/base-template.json').read_text());cfg.pop('previous_model',None) + args=cfg['args'] + for flag in ('--batch-groups','--resident-budget-gib','--rope-scaling','--rope-scale'): + if flag in args:i=args.index(flag);del args[i:i+2] + if '--batch-mtp' in args:args.remove('--batch-mtp') + args[args.index('--max-context')+1]=str(CTX) + if CTX>262144:args+=['--rope-scaling','yarn','--rope-scale','2'] + cfg['parallel']=1 + with socket.socket() as s:s.bind(('127.0.0.1',0));port=s.getsockname()[1] + cfg.update(api_key=b.KEY,port=port,host='127.0.0.1',model_name=b.MODEL,open_browser=False,log=str(b.ROOT/'engine.log')) + path=b.ROOT/'config.json';path.write_text(json.dumps(cfg));path.chmod(0o600) + 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','') + base=f'http://127.0.0.1:{port}';proc=None;arm=f'single-{CTX}' + try: + b.save('loading',context=CTX) + with (b.ROOT/'server.log').open('w') as log: + proc=subprocess.Popen([str(b.SOURCE/'.venv/bin/python'),str(b.SOURCE/'serve/server.py'),'--engine','strata','--config',str(path),'--host','127.0.0.1','--port',str(port),'--fit-max-tokens'],cwd=b.SOURCE,env=env,stdout=log,stderr=subprocess.STDOUT,start_new_session=True) + end=time.monotonic()+600 + while time.monotonic()262144 else 1))) + short=[dict(role='system',content='Synthetischer Geschwindigkeitstest. Antworte auf Deutsch.'),dict(role='user',content='Schreibe mindestens 1200 Wörter über zuverlässige Datensicherung.')] + b.measure(base,arm,'short',[short],512) + for target in (131072,245760 if CTX==262144 else 491520): + b.save('calibrating',context=CTX,target=target) + msgs=b.fixture(base,target,0) + first=b.measure(base,arm,f'cold-{target}',[msgs],128)[0] + follow=msgs+[dict(role='assistant',content=first['_content']),dict(role='user',content='Führe den Fachtext mit mindestens 1200 weiteren Wörtern fort.')] + b.measure(base,arm,f'cached-{target}',[follow],256) + b.save('complete',context=CTX) + 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) +if __name__=='__main__': + try:run() + except BaseException as e:b.save('failed',context=CTX,error_type=type(e).__name__);raise diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/smoke.py b/docs/experiments/strata-single-slot-memory-2026-10-14/smoke.py new file mode 100644 index 0000000..409c21f --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/smoke.py @@ -0,0 +1,30 @@ +"""Post-update endpoint acceptance with synthetic text/image; metrics only saved.""" +import base64,concurrent.futures,json,pathlib,struct,sys,threading,time,zlib +sys.path.insert(0,'/opt/athena-deck-dev/batch-ab-20261014') +from launch import request +OUT=pathlib.Path('/data/experiments/strata-single-memory-20261014') +MODEL='flash-next-strata-iq3-dual' +barrier=threading.Barrier(2) +def one(i): + barrier.wait();t=time.monotonic() + status,r=request('/v1/chat/completions',dict(model=MODEL,messages=[dict(role='user',content='Schreibe mindestens 1000 Wörter über '+('Datensicherung.' if i==0 else 'Home-Assistant-Automatisierungen.'))],max_tokens=256,reasoning_effort='none',temperature=0)) + return dict(http_status=status,seconds=time.monotonic()-t,usage=r.get('usage'),nonempty=bool(r.get('choices',[{}])[0].get('message',{}).get('content'))) +def chunk(k,v):return struct.pack('>I',len(v))+k+v+struct.pack('>I',zlib.crc32(k+v)&0xffffffff) +def main(): + _,s=request('/api/v1/status') + if s['endpoint']['active_requests']:raise RuntimeError('New production request; skip synthetic smoke') + maximum=0 + with concurrent.futures.ThreadPoolExecutor(max_workers=2) as p: + f=[p.submit(one,i) for i in range(2)] + while not all(x.done() for x in f): + _,s=request('/api/v1/status');maximum=max(maximum,s['endpoint']['active_requests']);time.sleep(.25) + rows=[x.result() for x in f] + png=b'\x89PNG\r\n\x1a\n'+chunk(b'IHDR',struct.pack('>IIBBBBB',128,128,8,2,0,0,0))+chunk(b'IDAT',zlib.compress((b'\x00'+b'\xff\x00\x00'*128)*128))+chunk(b'IEND',b'') + data='data:image/png;base64,'+base64.b64encode(png).decode() + status,r=request('/v1/chat/completions',dict(model=MODEL,messages=[dict(role='user',content=[dict(type='text',text='Welche Hauptfarbe hat das einfarbige Bild? Antworte mit einem Wort.'),dict(type='image_url',image_url=dict(url=data))])],max_tokens=32,reasoning_effort='none',temperature=0)) + text=r.get('choices',[{}])[0].get('message',{}).get('content','').lower() + _,s=request('/api/v1/status') + result=dict(text_requests=rows,max_observed_active_requests=maximum,vision_http_status=status,vision_red_recognized=('rot' in text or 'red' in text),vision_usage=r.get('usage'),active_requests_after=s['endpoint']['active_requests'],loaded_after=s['endpoint']['counts']['llm']['loaded']) + (OUT/'acceptance.json').write_text(json.dumps(result,indent=2));print(json.dumps(result)) + if not all(x['http_status']==200 and x['nonempty'] for x in rows) or status!=200 or not result['vision_red_recognized']:raise RuntimeError('Post-update synthetic acceptance failed') +if __name__=='__main__':main() diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/update.py b/docs/experiments/strata-single-slot-memory-2026-10-14/update.py new file mode 100644 index 0000000..b932eac --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/update.py @@ -0,0 +1,40 @@ +"""Host update driver: no fallback, no host restart, preserve production manifest.""" +import importlib.util,json,os,pathlib,subprocess,sys,time +P=pathlib.Path;STAGE=P('/opt/athena-deck-dev/single-update-20261014');OUT=P('/data/experiments/strata-single-memory-20261014') +sys.path.insert(0,'/opt/athena-deck-dev/batch-ab-20261014') +from launch import request +def mark(phase,**extra): + p=OUT/'update.tmp';p.write_text(json.dumps(dict(phase=phase,updated=time.time(),**extra)));p.replace(OUT/'update-status.json') +def idle(): + _,s=request('/api/v1/status');e=s['endpoint'] + if e['active_requests'] or e['counts']['llm']['loaded']:raise RuntimeError('Maintenance needs the regularly unloaded idle model') +def main(): + if json.loads((OUT/'launcher-status.json').read_text())['phase']!='tests_complete_ready_for_update':raise RuntimeError('Tests not complete') + idle() + d=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev']))[0] + if d['Config']['Labels'].get('de.casaderoll.athena-deck.standalone')!='/opt/athena-deck-dev/runtime':raise RuntimeError('Wrong owner') + progress=OUT/'build';progress.mkdir(exist_ok=False);progress.chmod(0o700);os.chown(progress,65534,65534);(progress/'home').mkdir();os.chown(progress/'home',65534,65534) + args=['docker','run','--rm','--name','athena-strata-update-20261014','--gpus','all','--user','65534:65534','--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true','--memory','16g','--memory-swap','16g','--cpus','6','--tmpfs','/tmp:rw,nosuid,nodev,size=2g','-e','HOME=/progress/home','-e','PYTHONDONTWRITEBYTECODE=1','-e','NVIDIA_DRIVER_CAPABILITIES=compute,utility','--entrypoint','python3'] + 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']}"] + args+=['--mount',f'type=bind,src={STAGE},dst=/update,readonly','--mount',f'type=bind,src={progress},dst=/progress',d['Config']['Image'],'/update/build.py'] + mark('building_direct_replacement') + with (OUT/'build-container.log').open('w') as f:subprocess.run(args,stdout=f,stderr=subprocess.STDOUT,check=True) + spec=importlib.util.spec_from_file_location('deck_install',STAGE/'install-deck.py');m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m) + base=P('/opt/athena-deck-dev/runtime');c=m.load_manifest(base);m.owned(c['name'],base) + image='athena-deck-standalone:strata-0.1.44.1-20261014' + (STAGE/'Dockerfile').write_text('FROM '+d['Config']['Image']+'\nCOPY app/strata_sources.json /app/strata_sources.json\nCOPY app/deploy/install_strata.py /app/deploy/install_strata.py\nCOPY app/deploy/install_strata_vision.py /app/deploy/install_strata_vision.py\n') + mark('building_matching_deck_recipe') + with (OUT/'image-build.log').open('w') as f:subprocess.run(['docker','build','-t',image,str(STAGE)],stdout=f,stderr=subprocess.STDOUT,check=True) + idle();mark('activating_matching_deck_recipe') + m.run('docker','stop','--time','30',c['name']);m.run('docker','rm',c['name']) + c['image']=image;c.pop('previous_image',None);m.launch(c);m.ready(c);m.write_manifest(base,c) + mark('restoring_previous_profile') + previous=json.loads((STAGE/'base-template.json').read_text())['previous_model'] + status,_=request('/v1/chat/completions',dict(model=previous,messages=[dict(role='user',content='Antworte nur mit OK.')],max_tokens=8,reasoning_effort='none')) + _,s=request('/api/v1/status') + result=dict(version='0.1.44.1',http_status=status,model=previous,loaded=s['endpoint']['counts']['llm']['loaded'],active_requests=s['endpoint']['active_requests'],backup_created=False) + (OUT/'restore-after-update.json').write_text(json.dumps(result));mark('complete',**result) +if __name__=='__main__': + try:main() + except BaseException as e:mark('failed',error_type=type(e).__name__);raise diff --git a/docs/experiments/strata-single-slot-memory-2026-10-14/versions.json b/docs/experiments/strata-single-slot-memory-2026-10-14/versions.json new file mode 100644 index 0000000..e5da309 --- /dev/null +++ b/docs/experiments/strata-single-slot-memory-2026-10-14/versions.json @@ -0,0 +1,21 @@ +{ + "image": "athena-deck-standalone:strata-0.1.44.1-20261014", + "memory_gib": 44.0, + "memory_swap_gib": 44.0, + "recipe_version": "0.1.44.1", + "recipe_commit": "296b59d2f73c8f04a805df29c2fa97655adace78", + "runtime": { + "commit": "296b59d2f73c8f04a805df29c2fa97655adace78", + "cuda": "13.0", + "architectures": "86;120", + "origin": "native-build" + }, + "source_commit": "296b59d2f73c8f04a805df29c2fa97655adace78", + "binary_version": "strata 0.1.44.1", + "vision_code": "296b59d2f73c8f04a805df29c2fa97655adace78", + "extra_mounts": [ + "/opt/athena-deck-dev/runtime/state/strata-ssd" + ], + "binary_sha256": "00edfdbd0a0dce84e0b722dbc7b7c83c7eb45731fdd5a592e88a6e8898ad12d7", + "kquant_library_present": false +} \ No newline at end of file diff --git a/strata_sources.json b/strata_sources.json index 7a44c26..74f607d 100644 --- a/strata_sources.json +++ b/strata_sources.json @@ -1,6 +1,6 @@ { - "code": "a0116b2782a5b82622358c04a06496485d12b2d6", - "version": "0.1.43.1", + "code": "296b59d2f73c8f04a805df29c2fa97655adace78", + "version": "0.1.44.1", "repo": "ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF", "revision": "ed59f92082b1e93c0e96d60a8b11aab089b52f09", "models": {