Prepare separate Strata 512K profile support without activation
This commit is contained in:
1 parent
4110bd5c7c
commit
0c0af6894a
6 files changed
+33
-7
No files matched your search
@@ -0,0 +1,17 @@
|
||||
# Separate 512K profile — prepared, not activated
|
||||
|
||||
User requested IQ2 disabled at the API endpoint, IQ3 262144 retained, and a separate IQ3 524288 profile. User subsequently prohibited restart while using Deck. No production profiles or running workers are changed during preparation.
|
||||
|
||||
Prepared app supports one Strata slot up to 524288. Above native 262144, the worker adds `--rope-scaling yarn --rope-scale 2`. Qualified IQ3 hardware tuning remains the measured 3060/5080 layer-16 resident-expert recipe. Same weights and CPU projector; no download needed. Native 262144 receives no scaling arguments. One million and multi-slot profiles remain rejected.
|
||||
|
||||
Proposed profile: `Qwen3.8 Flash-Next Strata IQ3 XXS · 512K`, API ID `flash-next-strata-iq3-512k`. Duplicate current IQ3 parameters except context=524288; slots=1. Existing IQ3 API identity stays unchanged. Disable IQ2's endpoint checkbox; do not delete its weights.
|
||||
|
||||
After explicit maintenance Go: confirm no active requests, use regular installer to replace app image, then save/enable the new profile through the authenticated Deck profile editor and disable IQ2 there. Do not edit state JSON to bypass admin authentication. Restore previously active IQ3 262144 unless user chooses differently. No host or OpenWebUI restart required.
|
||||
|
||||
**Memory caveat:** full 512K benchmark was run at 45 GiB; production stays 43 GiB. Passing needle test at 45 GiB is not a stability proof at 43 GiB, or with CPU vision/STT simultaneously. Check memory admission and a full-context request separately after activation, before calling this production-qualified.
|
||||
|
||||
Official upstream multi-slot support: https://github.com/Niko1221/Strata/blob/main/docs/BATCHING.md . Two 262K slots are independent session states with shared computation; not a split of one 512K chat. Additional GPU/session/KV state and reduced expert-cache capacity can hurt per-chat speed. A dual-slot profile requires Deck concurrency integration and separate simultaneous tests. Not enabled by this change.
|
||||
|
||||
Validation: five targeted unit tests cover 512K acceptance, rejection of one million/two slots, native/extended scaling, hardware tuning, reserve behavior and server command. No inference tests or service restarts performed during preparation.
|
||||
|
||||
Native Debian/restore: same pinned Strata runtime and weight revision from strata_sources.json; no new dependency. Deploy changed profiles.py, strata_worker.py, strata_sources.json and strata-ui.js with the native Deck app, then restart only in approved idle maintenance window. Profile entries and endpoint selection belong to encrypted Deck state backup. No credentials/weights in Git. Full native fresh-host restore is still unverified (see deploy/NATIVE_INSTALL_REQUIREMENTS.md).
|
||||
+1
-1
@@ -41,7 +41,7 @@ def chat_parameters(params):
|
||||
if params['chat_runtime'] not in ('llama','strata'):raise ValueError('Unbekannte Chat-Laufzeit.')
|
||||
if type(params['strata_layer_split']) is not int or not 1<=params['strata_layer_split']<=47:raise ValueError('Strata-Layer-Schnitt: 1 bis 47.')
|
||||
if params['strata_experts'] not in ('resident','mmap'):raise ValueError('Strata-Experten: resident oder mmap.')
|
||||
if params['chat_runtime']=='strata' and (params.get('slots',1)!=1 or params.get('context',8192)>262144 ):raise ValueError('Strata: ein Slot, höchstens 262144 Kontexttokens.')
|
||||
if params['chat_runtime']=='strata' and (params.get('slots',1)!=1 or params.get('context',8192)>524288 ):raise ValueError('Strata: ein Slot, höchstens 524288 Kontexttokens.')
|
||||
if params['chat_runtime']=='strata' and params['vision_projector'] and params['vision_device']!='cpu':raise ValueError('Strata-Vision ist ausschließlich für CPU qualifiziert.')
|
||||
if params['chat_runtime']=='strata' and params['gpu_reserve_mode']=='none':raise ValueError('Strata verwendet mindestens die automatische qualifizierte Reserve; Modus ohne Reserve ist nicht unterstützt.')
|
||||
if params['gpu_reserve_mode'] not in ('auto','manual','none'):raise ValueError('Ungültiger GPU-Reservemodus.')
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ const StrataUI=(()=>{
|
||||
async function api(path='',body){const r=await fetch('/api/v1/strata-runtime'+path,body!==undefined?{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(body)}:{});const d=await r.json();if(!r.ok)throw Error(d.error);return d;}
|
||||
async function refresh(){const root=document.querySelector('#strata-state');if(!root)return;try{
|
||||
const [d,c]=await Promise.all([api(),fetch('/api/v1/catalog').then(r=>r.json())]);if(!root.isConnected)return;
|
||||
root.innerHTML=`<h2>Strata ${esc(d.version)}</h2><p>${d.installed?'Installiert':'Einrichtung erforderlich'} · ${esc(d.revision?.slice(0,12))}</p><p>${esc(d.job?.phase||'Kein Einrichtungsauftrag aktiv.')}</p><p>CPU-Vision: ${d.vision?'bereit':'Encoder unter CPU-Vision vorbereiten installieren'}. Ein Chat-Slot, Kontext bis 262144. Große Kontexte benötigen zusätzlichen RAM.</p><p>${Object.entries(d.models).map(([q,ready])=>`${esc(q)}: ${ready?'vorbereitet':'Paket fehlt'}`).join(' · ')}</p><button id="strata-install" ${d.installed||d.job?.state==='running'?'disabled':''}>Native Laufzeit installieren</button><button id="strata-vision" ${!d.installed||d.vision||d.job?.state==='running'?'disabled':''}>CPU-Vision vorbereiten</button><label>Modellpaket<select id="strata-model">${(c.entries||[]).filter(m=>m.file.includes('Flash-Next-GSQ-RCO')&&m.file.includes('-00001-of-')&&/IQ[23]_/.test(m.file)).map(m=>`<option value="${esc(m.id)}">${esc(m.file)}</option>`).join('')}</select></label><button id="strata-prepare" ${!d.installed||d.job?.state==='running'?'disabled':''}>Expertenpaket vorbereiten</button>${d.job?.state==='running'?'<button class="secondary" id="strata-cancel">Einrichtung abbrechen</button>':''}`;
|
||||
root.innerHTML=`<h2>Strata ${esc(d.version)}</h2><p>${d.installed?'Installiert':'Einrichtung erforderlich'} · ${esc(d.revision?.slice(0,12))}</p><p>${esc(d.job?.phase||'Kein Einrichtungsauftrag aktiv.')}</p><p>CPU-Vision: ${d.vision?'bereit':'Encoder unter CPU-Vision vorbereiten installieren'}. Ein Chat-Slot, Kontext bis 524288 (oberhalb 262144 mit YaRN ×2). Große Kontexte benötigen zusätzlichen RAM.</p><p>${Object.entries(d.models).map(([q,ready])=>`${esc(q)}: ${ready?'vorbereitet':'Paket fehlt'}`).join(' · ')}</p><button id="strata-install" ${d.installed||d.job?.state==='running'?'disabled':''}>Native Laufzeit installieren</button><button id="strata-vision" ${!d.installed||d.vision||d.job?.state==='running'?'disabled':''}>CPU-Vision vorbereiten</button><label>Modellpaket<select id="strata-model">${(c.entries||[]).filter(m=>m.file.includes('Flash-Next-GSQ-RCO')&&m.file.includes('-00001-of-')&&/IQ[23]_/.test(m.file)).map(m=>`<option value="${esc(m.id)}">${esc(m.file)}</option>`).join('')}</select></label><button id="strata-prepare" ${!d.installed||d.job?.state==='running'?'disabled':''}>Expertenpaket vorbereiten</button>${d.job?.state==='running'?'<button class="secondary" id="strata-cancel">Einrichtung abbrechen</button>':''}`;
|
||||
for(const [id,path,body] of [['strata-install','/install',()=>({})],['strata-prepare','/prepare',()=>({model_id:document.querySelector('#strata-model').value})],['strata-vision','/vision',()=>({})],['strata-cancel','/cancel',()=>({})]])document.querySelector('#'+id)?.addEventListener('click',async event=>{event.target.disabled=true;try{await api(path,body());refresh();}catch(e){document.querySelector('#strata-message').textContent=e.message;event.target.disabled=false;}});
|
||||
}catch(e){if(root.isConnected)root.textContent=e.message;}finally{setTimeout(()=>{if(root.isConnected)refresh();},4000);}}
|
||||
return {render};
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
"cpu_model": "AMD Ryzen 5 5600 6-Core Processor",
|
||||
"layer_split": 16,
|
||||
"experts": "resident",
|
||||
"max_context": 262144,
|
||||
"max_context": 524288,
|
||||
"auto_reserve_mib": 1024,
|
||||
"environment": {
|
||||
"STRATA_STAGE_TRIM": "1",
|
||||
|
||||
@@ -50,6 +50,7 @@ class StrataWorker:
|
||||
with socket.socket() as s:s.bind(('127.0.0.1',0));self.port=s.getsockname()[1]
|
||||
self.key=secrets.token_urlsafe(32);self.devices=params['gpu_devices']
|
||||
args=['--pack',str(data/m['pack']),'--native',str(data/m['native']),'--ple-gguf',str(data/m['ple']),'--expert-profile',str(source/'data/expert-profile.bin'),'--expert-cache','auto','--prefill','auto','--spec','4','--spec-min-p','0.5','--mtp',str(data/'mtp/rt'),'--max-context',str(params['context']),'--kv','int8','--kv-resident','32768','--vram-reserve-mib',str(self.memory_plan['reserve_mib'][0]),'--vram-reserve-later-mib',str(self.memory_plan['reserve_mib'][1])]
|
||||
args += self.context_arguments(params['context'])
|
||||
tuning=self.memory_plan.get('performance',{})
|
||||
for flag,value in tuning.get('arguments',{}).items():
|
||||
if flag in args:
|
||||
@@ -86,6 +87,10 @@ class StrataWorker:
|
||||
except Exception as e:
|
||||
self.stop();self.state='failed';self.error=str(e);self.phase='Strata-Start fehlgeschlagen';raise
|
||||
@staticmethod
|
||||
def context_arguments(context):
|
||||
# Native window stays unchanged; qualified extended window uses the tested YaRN factor.
|
||||
return ['--rope-scaling','yarn','--rope-scale','2'] if context>262144 else []
|
||||
@staticmethod
|
||||
def command(python,source,config,port):return [str(python),str(source/'serve/server.py'),'--engine','strata','--config',str(config),'--host','127.0.0.1','--port',str(port),'--fit-max-tokens']
|
||||
def connect(self):return http.client.HTTPConnection('127.0.0.1',self.port,timeout=120),self.key
|
||||
def prepare_request(self,body):
|
||||
|
||||
+8
-4
@@ -9,8 +9,12 @@ class StrataTests(unittest.TestCase):
|
||||
def params(self):return chat_parameters({**{k:v[2] for k,v in SCHEMAS['chat'].items()},'chat_runtime':'strata','gpu_devices':['GPU-'+'a'*8+'-'+ 'a'*4+'-'+ 'a'*4+'-'+ 'a'*4+'-'+'a'*12,'GPU-'+'b'*8+'-'+ 'b'*4+'-'+ 'b'*4+'-'+ 'b'*4+'-'+'b'*12],'split_mode':'layer'})
|
||||
def test_strata_profile_budget_and_legacy_defaults(self):
|
||||
self.assertEqual(chat_parameters({})['chat_runtime'],'llama')
|
||||
for override in ({'slots':2},{'context':524288},{'vision_projector':'a'*64,'vision_device':'GPU-'+'a'*8+'-'+ 'a'*4+'-'+ 'a'*4+'-'+ 'a'*4+'-'+'a'*12},{'strata_layer_split':0},{'strata_experts':'unknown'}):
|
||||
for override in ({'slots':2},{'context':1048576},{'vision_projector':'a'*64,'vision_device':'GPU-'+'a'*8+'-'+ 'a'*4+'-'+ 'a'*4+'-'+ 'a'*4+'-'+'a'*12},{'strata_layer_split':0},{'strata_experts':'unknown'}):
|
||||
with self.assertRaises(ValueError):chat_parameters({**self.params(),**override})
|
||||
def test_extended_context_scaling_and_profile_acceptance(self):
|
||||
self.assertEqual(chat_parameters({**self.params(),'context':524288})['context'],524288)
|
||||
self.assertEqual(StrataWorker.context_arguments(262144),[])
|
||||
self.assertEqual(StrataWorker.context_arguments(524288),['--rope-scaling','yarn','--rope-scale','2'])
|
||||
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'])
|
||||
@@ -48,12 +52,12 @@ class StrataTests(unittest.TestCase):
|
||||
self.assertEqual(performance_tuning('IQ3_XXS',devices,{**params,'context':262144},'qualified CPU'),{})
|
||||
self.assertEqual(performance_tuning('IQ2_XS',devices,params,'qualified CPU'),{})
|
||||
self.assertEqual(params,before)
|
||||
def test_measured_262k_uses_same_tuning_as_131k(self):
|
||||
def test_measured_512k_uses_same_tuning_as_262k(self):
|
||||
from strata_worker import RECIPE
|
||||
tuning=RECIPE['performance']['IQ3_XXS'];devices=[{'name':name} for name in tuning['gpu_names']]
|
||||
for context in (131072,262144):
|
||||
for context in (131072,262144,524288):
|
||||
self.assertEqual(performance_tuning('IQ3_XXS',devices,{**self.params(),'context':context},tuning['cpu_model']),tuning)
|
||||
self.assertEqual(performance_tuning('IQ3_XXS',devices,{**self.params(),'context':524288},tuning['cpu_model']),{})
|
||||
self.assertEqual(performance_tuning('IQ3_XXS',devices,{**self.params(),'context':1048576},tuning['cpu_model']),{})
|
||||
def test_measured_auto_reserve_preserves_explicit_manual_reserve(self):
|
||||
runtime=Mock();runtime.status.return_value={'installed':True};runtime.prepared.return_value=('IQ3_XXS',{})
|
||||
worker=StrataWorker('/tmp/not-used',Mock(),runtime);params=self.params();devices=[dict(uuid=u,name='qualified card',total_mib=16000,free_mib=16000) for u in params['gpu_devices']]
|
||||
|
||||
Reference in new issue
Block a user