diff --git a/LLM_SAMPLING.md b/LLM_SAMPLING.md index 20970df..6b57de4 100644 --- a/LLM_SAMPLING.md +++ b/LLM_SAMPLING.md @@ -16,6 +16,18 @@ Hermes-spezifische Übersetzung. Neue Felder werden bei älteren Profilen mit neutralen Werten ergänzt; das Speichern verändert keine GPU-Einstellungen. Backup/Restore übernimmt die Parameter zusammen mit den Profilen. +## Strata-Schleifenschutz + +Das gepinnte Strata-Rezept ab 0.1.45 setzt global +`reasoning_loop_recovery: "stop"`. Jeder neue Strata-Worker erhält diese +offizielle Serveroption, unabhängig vom verwendeten Client oder Profil. +Sampling und normale Denkbudgets bleiben unverändert. Bei einer erkannten +Wiederholung von Denkpassagen beendet Strata die Ausgabe als `length`; eine +fertige Antwort ist dann nicht garantiert. Ein anschließender Client-Aufruf +ist eine neue Anfrage und wird dadurch nicht grundsätzlich verhindert. +Die Erkennung ist heuristisch, kein Beweis der Fehlerursache. +Details und Abnahme: [Strata 0.1.45](docs/experiments/strata-0.1.45-2026-10-17.md). + ## Geprüfte Empfehlungen (2026-10-01) | Gewichte | Temperatur | Top-p | Top-k | Wiederholung | Presence | Frequency | diff --git a/deploy/install_strata.py b/deploy/install_strata.py index 599dc40..5381ef4 100644 --- a/deploy/install_strata.py +++ b/deploy/install_strata.py @@ -34,15 +34,10 @@ def install(destination,nvcc=None,architectures='86;120',update=False): run([python,'-m','pip','install','--no-cache-dir','-r',source/'requirements.txt']) env=dict(os.environ,PATH=str(python.parent)+os.pathsep+str(Path(nvcc).parent)+os.pathsep+os.environ.get('PATH',''),CUDAToolkit_ROOT=str(Path(nvcc).parent.parent),LD_LIBRARY_PATH=str(Path(nvcc).parent.parent/'lib')+os.pathsep+str(Path(nvcc).parent.parent/'lib64')+os.pathsep+os.environ.get('LD_LIBRARY_PATH',''),STRATA_NVCC=str(nvcc),CMAKE_BUILD_PARALLEL_LEVEL='2') run([python,'-c','import setup;setup.get_llama_cpp()'],source,env) - cmake=python.parent/'cmake' - 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))) + # Upstream owns compiler options, companion libraries and BUILD.json. This + # prevents a later official package check from treating our local build as + # unknown and trying to install another toolkit or rebuilding it differently. + run([python,'-c','import json,setup,sys; archs=json.loads(sys.argv[1]); setup.build_engine({"arch":archs[0],"archs":archs},"none",False,setup.get_llama_cpp(),toolkit=13)',json.dumps([int(x) for x in architectures.split(';')])],source,env) 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.') (destination/'ready.json').write_text(json.dumps(dict(commit=RECIPE['code'],cuda='13.0',architectures=architectures,origin='native-build'))) diff --git a/docs/CURRENT_SYSTEM.md b/docs/CURRENT_SYSTEM.md index ec0ed54..de36ab5 100644 --- a/docs/CURRENT_SYSTEM.md +++ b/docs/CURRENT_SYSTEM.md @@ -11,6 +11,16 @@ Vollständiger frischer Restore weiterhin offen. Die nachfolgenden datierten Abschnitte sind historische Änderungsstände; spätere Experimentberichte können frühere Images, Profile und Speicherwerte ablösen. +Am 17. Oktober 2026: Strata **0.1.45** direkt ersetzt und produktiv geprüft. +Der native Reasoning-Schleifenschutz steht global für alle Strata-Profile auf +`stop`; er beendet erkannte Wiederholungspassagen, garantiert aber keine +vollständige Antwort und unterbindet keine neuen Client-Anfragen. +IQ3-Single-Profil wieder geladen, API-Test und CPU-Vision bestanden; +Profile, Kontext-/Slot- und ausgewählte persistente Einstellungen erhalten. +[Release, Installation, Tests und Grenzen](experiments/strata-0.1.45-2026-10-17.md). +Das separat vorbereitete MP3-Update ist weiterhin nicht aktiviert und muss vor +einer späteren Aktivierung auf die neue Strata-App-Version aufgesetzt werden. + Am 11. Oktober 2026: Strata-Q4 nach Vergleich verworfen, keine produktive Q4-Profilfreigabe. Isolierte Q4-Testdateien und Gewichte entfernt; historische Messberichte bleiben erhalten. Project Maya-S24 nach dem Vergleich am diff --git a/docs/experiments/strata-0.1.45-2026-10-17-results.json b/docs/experiments/strata-0.1.45-2026-10-17-results.json new file mode 100644 index 0000000..c5d92ba --- /dev/null +++ b/docs/experiments/strata-0.1.45-2026-10-17-results.json @@ -0,0 +1,55 @@ +{ + "activation": { + "version": "0.1.45", + "commit": "477ac13cbe8e582c20484871ce459d20d82df09d", + "image": "athena-deck-standalone:strata-0.1.45-loop-stop-20261017", + "loop_guard": "stop", + "selected_settings_unchanged": true, + "deck_state": "ready", + "mp3_activated": false, + "fallback_created": false, + "official_package_checks": { + "IQ3_XXS": true, + "IQ2_XS": true + } + }, + "verification": { + "version": "0.1.45", + "revision": "477ac13cbe8e582c20484871ce459d20d82df09d", + "native_vision_ready": true, + "worker": { + "loop_guard": "stop", + "model": "flash-next-strata-iq3", + "parallel": 1 + }, + "http_smoke_passed": true, + "synthetic_reply_ok": true, + "usage": { + "prompt_tokens": 19, + "completion_tokens": 2, + "total_tokens": 21, + "prompt_tokens_details": { + "cached_tokens": 0 + } + }, + "load_and_request_seconds": 62.3, + "loop_reproduction_not_run": true + }, + "official-checks": { + "IQ3_XXS": true, + "IQ2_XS": true + }, + "offline_excerpt_check": { + "official_detector_on_user_excerpt": true, + "characters": 14047, + "repetition_coverage": 1.0, + "threshold": 0.25, + "would_flag": true, + "full_inference_replay": false + }, + "tests": { + "deck_passed": 15, + "official_reasoning_loop_passed": 18, + "native_installer_exit": 0 + } +} diff --git a/docs/experiments/strata-0.1.45-2026-10-17.md b/docs/experiments/strata-0.1.45-2026-10-17.md new file mode 100644 index 0000000..32d5fa3 --- /dev/null +++ b/docs/experiments/strata-0.1.45-2026-10-17.md @@ -0,0 +1,112 @@ +# Strata 0.1.45 direct update and native reasoning-loop stop + +User requested the newest official release, direct replacement of the old +runtime without fallback, and activation of the native loop guard. + +Official release: https://github.com/Niko1221/Strata/releases/tag/v0.1.45 + +- Release commit pinned in `strata_sources.json`: + `477ac13cbe8e582c20484871ce459d20d82df09d`. +- Global native `reasoning_loop_recovery` set to `stop`; the Deck worker writes + this field into every newly generated Strata server config, including future + profiles. It is not a system-prompt instruction or an OpenCode-only setting. +- No additional experimental speed flags, sampling overrides, quantization, + context size or slot changes are part of this update. +- The separately prepared MP3 endpoint update is NOT included. Its earlier + image was based on the previous Deck image and must be rebased before eventual + activation so it cannot remove this Strata update. + +## Why stop mode + +The pasted output establishes a generation loop, but not its root cause. The +upstream server has separate identical-token and repeated-reasoning-passage +guards. Stop mode bounds a recognized passage loop; it does not guarantee that +every loop is recognized or that the model produces a useful final answer. +Recover mode also changes the effort hint and resumes inference, and was not +selected here. Upstream implementation remains unmodified. + +The active IQ3 profile had temperature 1, top-p 0.95, top-k 20; OpenCode's global +model options contained no explicit sampling overrides. The actual request that +looped has not been captured. Current worker was single-slot, so a reported +batch-window penalty bug is not established as this incident's cause. + +## Deployment and preservation + +Native installer is `deploy/install_strata.py --update`, in the existing runtime +directory with CUDA 13.0 and architectures 86/120. CPU vision is rebuilt through +`deploy/install_strata_vision.py`. Existing model packages are checked by the +official no-start setup and their commit marker updated; no model replacement is +requested. Both active-request checks must be idle before stopping Deck. + +The optional current Docker deployment uses its existing image as build/runtime +base. A new app layer carries only the Strata recipe, worker and native installer +files. Original installation options and persistent state are retained using the +regular deployment helper. No fallback container or source copy is created. +Stage: `/opt/athena-deck-dev/strata-update-20261017`. + +The first package check failed because it did not discover the private CUDA +toolkit, despite the completed native build. A proposed manual compatibility +stamp/resume was rejected by automatic approval and was not executed. The safer +route runs the unchanged upstream setup with documented `STRATA_NVCC` and the +existing toolkit library paths. Upstream then builds with its canonical options +and writes its own `BUILD.json`; no upstream stamp is synthesized by us. +The native installer now delegates building and stamping to upstream +`setup.build_engine`, preventing the custom-minimal-stamp/second-build mismatch +on future rebuilds. No host driver or system CUDA installation is performed. + +The existing extra SSD mount must also be passed into the temporary build +container. The first invocation lacked this absolute alias; it was supplied +inside that temporary container as a symlink to the already mounted same SSD +directory. No host data changed. The saved update recipe includes the explicit +mount for subsequent use. No such alias is a new native-runtime dependency. + +## Validation + +15 Deck Strata integration tests pass in the isolated target-runtime image, +including global guard validation, context/parallel behavior, CPU vision and +backup/restore document/version checks. The test-only setup flag was disabled +because the production image otherwise demands a preconfigured login; this was +never applied to the live container. A full native restore is not claimed. + +18 official upstream `serve/test_reasoning_loop_recovery.py` CPU tests pass on +the pinned new source, including stop mode ending a synthetic repeated passage +as `finish_reason=length`. This can leave an unfinished answer; it does not +fabricate a final answer. OpenCode may initiate a subsequent continuation, which +is a separate request and not eliminated by this per-reply guard. + +Both unchanged official setup checks (IQ3_XXS and IQ2_XS) completed with +exit code 0. The updated native installer then completed against the canonical +build with exit code 0. The new app image was activated; Deck reports ready, +selected persistent setting hashes match, and no fallback was created. +The administrative runtime API correctly denied the service credential (401). +No replacement authentication was created: acceptance instead reads only our +build markers and uses the normal chat-completions API for the synthetic probe. +Live acceptance passed: the previous `flash-next-strata-iq3` profile was loaded +through the regular chat-completions API and replied `OK` (19 input / 2 output +tokens). Loading plus request took 62.3 seconds; this is not a throughput +benchmark. The live worker config confirms `reasoning_loop_recovery=stop`, +model `flash-next-strata-iq3`, parallel=1. CPU vision and pinned runtime markers +are present. Temporary build/check containers were started with `--rm` and +exited; no host, OpenCode or Hermes restart was performed. + +[Sanitized acceptance evidence](strata-0.1.45-2026-10-17-results.json). + +The unchanged official `reasoning_repeat_coverage` function was additionally +extracted from the pinned source and evaluated locally on the user's pasted +14,047-character excerpt. It returned coverage 1.0, above the official 0.25 +threshold. This establishes detection of this finished text, not a full GPU +replay or the exact token where a live request would stop. The private excerpt +was not transferred to Athena or stored in Git. + +## Release scope relevant to this machine + +The release's headline Qwen3.6-35B-A3B vision, parallelism and large speed gains +are a different model family; they are not a performance promise for Flash-Next. +Flash-Next changes include resident-RAM copy handling, small NVIDIA/CPU +optimizations and reduced server parsing/tokenization/cache-copy overhead. +The release says tested Flash-Next outputs match 0.1.44.1 byte for byte. +Other fixes cover explicit reasoning-off, idle Prometheus rates, benchmark bind +addresses, Uncensored conversion metadata and setup/package checks. AMD, Intel +and Mac receive additional platform fixes. Extra multi-user and decode switches +remain opt-in; this update does not enable unmeasured performance flags. +No release claim establishes a general fix for the user's reasoning loop. diff --git a/strata_sources.json b/strata_sources.json index 74f607d..6f86169 100644 --- a/strata_sources.json +++ b/strata_sources.json @@ -1,6 +1,7 @@ { - "code": "296b59d2f73c8f04a805df29c2fa97655adace78", - "version": "0.1.44.1", + "code": "477ac13cbe8e582c20484871ce459d20d82df09d", + "version": "0.1.45", + "reasoning_loop_recovery": "stop", "repo": "ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF", "revision": "ed59f92082b1e93c0e96d60a8b11aab089b52f09", "models": { diff --git a/strata_worker.py b/strata_worker.py index fe897ac..fa7e609 100644 --- a/strata_worker.py +++ b/strata_worker.py @@ -61,6 +61,7 @@ class StrataWorker: else:args.append('--mmap-experts') config=dict(exe=str(source/'engine/strata'),args=args,cwd=str(source),tokenizer=str(data/m['pack']/'tokenizer'),model_name=p['api_id'],host='127.0.0.1',port=self.port,api_key=self.key,gpu=[i for uuid in self.devices for i,g in enumerate(probe()) if g['uuid']==uuid],gpu_order='as_given',layer_split=str(params['strata_layer_split']),vram_elastic=False,open_browser=False,log=str(self.root/'engine.log')) config['parallel']=params.get('slots',1) + config.update(self.reasoning_guard_config()) if params.get('vision_projector'): config['vision']=self.runtime.vision_config(params['vision_projector'],data/m['native']);args.append('--vision') path=self.root/'worker.json' @@ -93,6 +94,11 @@ class StrataWorker: except Exception as e: self.stop();self.state='failed';self.error=str(e);self.phase='Strata-Start fehlgeschlagen';raise @staticmethod + def reasoning_guard_config(): + mode=RECIPE.get('reasoning_loop_recovery',False) + if mode is not False and mode not in ('stop','recover'):raise ValueError('Ungültiger Strata-Schleifenschutz im Laufzeitrezept.') + return {'reasoning_loop_recovery':mode} + @staticmethod def parallel_arguments(slots): # Explicit serial group keeps opt-in batch MTP on our two-stage GPU split. return ['--batch-mtp','--batch-groups','1'] if slots==2 else [] diff --git a/test_strata.py b/test_strata.py index 8991425..7790563 100644 --- a/test_strata.py +++ b/test_strata.py @@ -25,6 +25,12 @@ class StrataTests(unittest.TestCase): from inference import InferenceError for s in ({},{'concurrency':{'serving':1}}): with self.assertRaises(InferenceError):StrataWorker.verify_capacity(s,2) + def test_native_loop_guard_is_global_and_validated(self): + self.assertEqual(StrataWorker.reasoning_guard_config(),{'reasoning_loop_recovery':'stop'}) + for mode in (False,'stop','recover'): + with patch.dict(RECIPE,reasoning_loop_recovery=mode):self.assertEqual(StrataWorker.reasoning_guard_config()['reasoning_loop_recovery'],mode) + with patch.dict(RECIPE,reasoning_loop_recovery='invalid'): + with self.assertRaises(ValueError):StrataWorker.reasoning_guard_config() def test_cpu_vision_profile_and_projector_identity(self): self.assertEqual(chat_parameters({**self.params(),'vision_projector':'a'*64})['vision_device'],'cpu') validate_projector(RECIPE['vision'])