Integrate Basalt telemetry and shared GPU speech runtimes
Publish the reviewed accumulated runtime, scheduler, profile, UI, native recipes and historical maintenance evidence. Includes Qwen GPU ASR correction and shared Anna/atelier ownership. Validated with 784 local tests, Python/JSON parsing and eight JavaScript syntax checks. Live GPU acceptance and full fresh-host restore limits remain documented.
This commit is contained in:
1 parent
4e404d077d
commit
c0bc5d3a1b
172 files changed
+52473
-147
No files matched your search
@@ -0,0 +1,86 @@
|
||||
# Kleiner 64K-Chatvergleich: Basalt und Strata vollständig beendet
|
||||
|
||||
Auftrag: kleiner Test mit64K Gesprächsinhalt und kurzen Chat-Häppchen. Beide
|
||||
Laufzeiten wurden vollständig gemessen; kein vorzeitiger Strata-Abbruch.
|
||||
|
||||
## Ablauf und tatsächlicher Umfang
|
||||
|
||||
Zwei getrennte synthetische Gespräche mit exakt64000 Eingabetokens je Archiv,
|
||||
kurze OK-Bestätigung, anschließend drei parallele Fragerunden mit jeweils einer
|
||||
kurzen Antwort pro Gespräch, maximal96 Tokens pro Antwort. Erste Folgeeingabe
|
||||
64132 Tokens; spätere Verläufe enthalten die tatsächlich erzeugten Antworten.
|
||||
Basalt erzeugte34–52, Strata34–50 Tokens pro kurzer Antwort. Acht echte Requests
|
||||
je Laufzeit einschließlich zweier Archivbestätigungen, alle vollständig beendet;
|
||||
beide eigenen Archivkennungen korrekt gefunden.
|
||||
|
||||
Dies sind rund64K **belegte** Gesprächstokens. Die bestehenden Grenzen von
|
||||
262144 pro Slot wurden bei beiden unverändert gelassen, keine temporären
|
||||
Produktionsprofile gespeichert und keine64K-Maximalgrenzen-Konfiguration getestet.
|
||||
Basalt nutzt5080+RAM; Strata die bestehende optimierte3060+5080+RAM-Konfiguration.
|
||||
Modellbasis und IQ3_XXS-Quellen sind im [gepaarten Volltest](PAIRED_RESULTS.md) geprüft.
|
||||
|
||||
## Gemessene Ergebnisse
|
||||
|
||||
| Gleicher Schritt | Basalt | Strata |
|
||||
|---|---:|---:|
|
||||
| Beide frischen Archive lesen und kurz bestätigen |25,669s |64,882s |
|
||||
| Frisches Einlesen, Backendrate pro Archiv |5095,0 /5108,1 Token/s |1993,3 /1980,7 Token/s |
|
||||
| Erste kurze Fragerunde, beide Antworten fertig |2,738s |35,160s |
|
||||
| Zweite Runde, beide Antworten fertig |2,414s |3,377s |
|
||||
| Dritte Runde, beide Antworten fertig |2,114s |2,899s |
|
||||
| Erste sichtbare Antwort, Median der vier Antworten aus Runde2+3 |0,704s |1,268s |
|
||||
| Ganze kurze Antwort, Median dieser vier Antworten |2,206s |2,977s |
|
||||
| Beobachtetes Schreibtempo, Median dieser vier Antworten |33,27 Token/s |26,06 Token/s |
|
||||
| Gesamte Arbeit ohne Modellladen und Restore |32,938s |106,319s |
|
||||
|
||||
**Einordnung:** Beim laufenden kurzen Chat liegt Basalt in diesem kleinen Lauf
|
||||
etwas vorne; kein nachgewiesener mittlerer/großer Basalt-Leistungsnachteil. Der
|
||||
wesentliche Unterschied ist das frische Lesen sowie Stratas zusätzlicher
|
||||
Lesedurchgang in der ersten Fragerunde, nicht bloß Zehntelsekunden beim Schreiben.
|
||||
|
||||
## Warum Stratas erste Runde35 Sekunden dauerte
|
||||
|
||||
Basalt verwendete bei beiden Fortsetzungen jeweils63993 Tokens wieder. Strata
|
||||
meldete für Gespräch B ebenfalls63993, für Gespräch A jedoch **null**: dort
|
||||
wurden64132 Tokens erneut gelesen, laut Antwortstatistik32,272s. Währenddessen
|
||||
hatte die Antwort des anderen Gesprächs bereits begonnen, wurde aber erst nach
|
||||
rund35s vollständig beendet. In Runde2+3 verwendeten beide Laufzeiten die
|
||||
Verläufe wieder. Die genaue Ursache des fehlenden Strata-Cachetreffers wurde
|
||||
nicht durch zusätzliche Varianten-/Konfigtests untersucht.
|
||||
|
||||
## Messmethode und keine geschönten Spitzenwerte
|
||||
|
||||
Reaktionszeit ist Clientzeit von Absenden bis zum ersten sichtbaren Inhalt;
|
||||
Antwortzeit reicht bis zum vollständigen Streamende. Der beobachtete Schreibwert
|
||||
ist `(completion_tokens-1)/(finish-first_content)` je Antwort, danach Median.
|
||||
Bei gebündelten Streamstücken ist dies eine Näherung, aber für beide identisch.
|
||||
|
||||
Zwei Basalt-Antworten meldeten Backend-`predicted_ms` von nur14,7/15,3ms trotz
|
||||
realem Antwortverlauf über mehr als eine Sekunde. Die gleichzeitig gemeldeten
|
||||
65,4/68,0 Token/s werden deshalb **nicht** als Gesamtantworttempo übernommen.
|
||||
Rohdaten bleiben erhalten. Die Tabelle benutzt den vollständigen sichtbaren
|
||||
Verlauf, nicht einen letzten Solo-/Batch-Teilabschnitt oder einen Spitzenwert.
|
||||
Sechs kurze Antworten je Laufzeit, kein Dauertest und keine allgemeine Qualitätsabnahme.
|
||||
|
||||
## Schlusszustand und Ausführungsumgebung
|
||||
|
||||
Strata/Qwen im Originalprofil bereit und geladen; TTS/STT geladen; aktive und
|
||||
wartende Requests null. Zwölf geschützte Hashes, Produktionsimage und
|
||||
Containerstart unverändert. Eigener Basalt-Container entfernt. Kein Deck-/Host-
|
||||
oder Gateway-Neustart, keine Produktionsaktivierung von Basalt, keine neuen Pakete.
|
||||
|
||||
`chat64_prepare.py`: CPU-only im eigenen vorhandenen Builder, echter Tokenizer
|
||||
und Chatvorlage, vorab geprüfter Fortsetzungspräfix. `chat64_client.py`: für
|
||||
Basalt im eigenen isolierten GPU-Container, für Strata nativ auf Athena über die
|
||||
bestehende Deck-API. `chat64_host.py`/`chat64_runner.py`: begrenzter Basalt-Start
|
||||
mit eigenem Cleanup. `chat64_transport.py`: nur eigenes NAS-Hermes-Profil,
|
||||
bestehende `/opt/hermes`-Umgebung, vorhandene verwaltete API-Identität ausschließlich
|
||||
im Speicher/SSH-stdin. Keine Zugangsdaten in Artefakten. Native Neuinstallation
|
||||
und vollständiger Restore weiterhin nicht geprüft; alte Ganzbaum-Manifeste sind
|
||||
keine aktualisierte Inventur der neu hinzugekommenen eigenen Testdateien.
|
||||
|
||||
[Vergleich und Berechnungsmethode](evidence/chat64-comparison.json),
|
||||
[Basalt-Rohdaten](evidence/chat64-basalt.json),
|
||||
[Strata-Rohdaten](evidence/chat64-strata.json),
|
||||
[Fixture-Prüfung ohne Inferenz](evidence/chat64-fixtures-proof.json),
|
||||
[Schlusszustand](evidence/chat64-final-state.json).
|
||||
@@ -0,0 +1,90 @@
|
||||
# Zusätzlicher Vollkontextversuch: Teilmessung, kein bestandener Paralleltest
|
||||
|
||||
Historischer Fehlversuch. Der anschließend neu beauftragte
|
||||
[direkte Vergleich](PAIRED_RESULTS.md) bestätigt zwei gleichzeitig volle,
|
||||
gleichzeitig schreibende Basalt-Gespräche. Strata wurde dort auf Wunsch nach
|
||||
nachweislich längerer Gesamtarbeit gestoppt. Die Fehlernachweise unten bleiben erhalten.
|
||||
|
||||
Michael gab nach der Kurzabnahme ausdrücklich ein neues Go: Basalt noch einmal
|
||||
laden, beide Slots bis zum Rand füllen und Eingabe-/Ausgabegeschwindigkeit messen.
|
||||
|
||||
**Ergebnis unvollständig:** Zwei verschiedene Eingaben mit jeweils 261632 echten
|
||||
Tokens wurden vollständig verarbeitet. Ein voller Kontext lieferte 504 weitere
|
||||
Tokens. Zwei gleichzeitig volle, gleichzeitig schreibende Slots sind damit
|
||||
weiterhin **nicht nachgewiesen**. Ein Kapazitäts-/GPU-OOM ist ebenfalls nicht
|
||||
nachgewiesen. Die Zeitgrenze des Testablaufs, nicht ein belegter Speichermangel,
|
||||
beendete die zweite Messung. Das vollständige Abnahmeziel ist offen.
|
||||
|
||||
## Unveränderte Konfiguration und tatsächliche Messungen
|
||||
|
||||
Derselbe Basalt-Pin, offizielle Modellpack und 5080+RAM wie beim Kurztest;
|
||||
Anbieterdefaults, zwei Slots mit je262144, int8-KV und elastischer Speicher.
|
||||
Kein anderer GPU-Split, keine Produktionsintegration oder neue globale Dienste.
|
||||
|
||||
Die tatsächliche API reserviert zusätzlich acht Kontexttokens. Nach dem ersten
|
||||
400-Fehler mit512 angeforderten Tokens wurde innerhalb desselben absoluten
|
||||
Fensters auf504 korrigiert. Für diesen Lauf gilt je Request:
|
||||
**261632 Eingabe +504 mögliche Ausgabe +8 interne Reserve =262144.**
|
||||
|
||||
| Korrigierter Lauf | Tatsächliche Messung |
|
||||
|---|---:|
|
||||
| Zuerst verarbeitetes Dokument B,261632 Tokens, kein Cache |4405,1 Token/s;59,3935s reine Prefillzeit |
|
||||
| Danach verarbeitetes Dokument A,261632 Tokens, kein Cache |2465,4 Token/s;106,1235s reine Prefillzeit |
|
||||
| Beide Eingaben, gleichzeitig abgeschickt, vollständig beendet |166,3014s gemeinsame Wandzeit;3146,48 Eingabetokens/s insgesamt |
|
||||
| Vollkontext-Ausgabe, eine abgeschlossene Antwort |504 Tokens;17,5 Backend-Token/s;261625 Prompttokens wiederverwendet |
|
||||
| Gleichzeitig schreibendes Paar voller Kontexte |**Keine gültige abgeschlossene Messung** |
|
||||
|
||||
Reine Prefillzeit ist nicht die Wartezeit ab Absenden: Dokument A hatte inklusive
|
||||
Warten166,2454s bis zum ersten Token, Dokument B59,9916s. Die Annahme, gleichzeitig
|
||||
abgeschickte große Eingaben würden gleichzeitig eingelesen, ist nicht belegt.
|
||||
Die17,5 Token/s entstanden, während der andere Request noch einlas; sie sind
|
||||
**kein Solo-Referenzwert und keine gemeinsame Zweier-Ausgaberate**.
|
||||
|
||||
## Warum der Parallel-Ausgabeteil nicht fertig wurde
|
||||
|
||||
Der Test trennte Lesen und Schreiben: erst beide Volltexte mit je einem
|
||||
Ausgabetoken, danach dieselben Prompts mit504 Ausgabetokens. Diese Vorbefüllung
|
||||
bewies keine gleichzeitige dauerhafte Cache-Residenz. Beim Folgeturn nutzte ein
|
||||
Request den Cache und schrieb504 Tokens, der andere musste erneut einlesen.
|
||||
Beim Stopp waren davon152064 Tokens gelesen und null Ausgabetokens erzeugt.
|
||||
Kein Snapshot zeigte beide vollen Slots zugleich im Zustand`decoding`.
|
||||
|
||||
Der korrigierte Client wurde durch den äußeren `subprocess.run`-Timeout nach
|
||||
253,49s beendet. Der Server wurde regulär beendet, der eigene Container entfernt.
|
||||
Die genaue Ursache der fehlenden Cache-Wiederverwendung ist nicht unabhängig
|
||||
aufgeklärt: mögliche Effekte von SDK-Solo/Batch-Umschaltung, Cachehaltung und
|
||||
Speicherpolitik dürfen nicht als bestätigter GPU-Speicherfehler ausgegeben werden.
|
||||
Insbesondere zeigt`ctx_used` in einem`prefill`-Snapshot bereits die angeforderte
|
||||
Promptlänge, nicht zwingend die tatsächlich schon eingelesenen Tokens.
|
||||
|
||||
Der erste Versuch samt400-Antworten wurde nicht überschrieben. Der korrigierte
|
||||
Lauf hat eigene Dateien`full2_*`. Dessen Client speicherte fertige Future-Ergebnisse
|
||||
leider erst nach Ende beider Requests: beim Timeout blieb`requests` im Ausgabeteil
|
||||
leer. Der abgeschlossene504-Token-Request ist deshalb aus der echten
|
||||
`[server] s1 done ... tg=504 17.5t/s`-Zeile belegt, nicht aus erfundenen SSE-Daten.
|
||||
Ein zukünftiger Client muss einzelne fertige Requests sofort sichern und die
|
||||
interne Kontextreserve sowie erneutes Prefill im Zeitbudget berücksichtigen.
|
||||
Keine weitere Inferenz ohne neues Go; dieser Versuch ist beendet, nicht bestanden.
|
||||
|
||||
## Wiederherstellung und Nachweise
|
||||
|
||||
Originalendpunkt regulär über LAN-GUI/API gestartet, ursprüngliches Qwen-Profil
|
||||
`0c25bfe00240414397c41a980ecbe4f0` mit einem eigenen kurzen GUI-Chat-Test wieder
|
||||
geladen. Dieser Restorecheck ist keine Benchmarkreferenz. Qwen bereit und geladen,
|
||||
TTS/STT geladen, alle Schedulerzähler null; zwölf geschützte Hashes sowie
|
||||
Produktionsimage und Containerstart unverändert. Eigener Testcontainer entfernt.
|
||||
Wiederherstellung nachgelesen890,271s nach Start des900s-Fensters.
|
||||
|
||||
[Zusammenfassung](evidence/full-summary.json),
|
||||
[korrigierter Rohstand mit Slotsnapshots](evidence/full2-results.json),
|
||||
[korrigiertes Serverprotokoll](evidence/full2-server.log),
|
||||
[Runner-Timeout](evidence/full2-runner-status.json),
|
||||
[Wiederherstellung](evidence/full-restoration.json),
|
||||
[erster Versuch einschließlich API-Ablehnungen](evidence/full-results.json).
|
||||
|
||||
Alle neuen Helfer, synthetischen Fixtures, Protokolle und Caches liegen weiter
|
||||
unter der eigenen Kandidatenwurzel. Der vorherige8470-Einträge-Manifestaudit
|
||||
bezieht sich auf den Stand nach der Kurzabnahme, nicht auf diesen erweiterten
|
||||
Baum; kein neuer Ganzbaum-/80GB-Modellhashlauf behauptet. Der vorhandene
|
||||
Ownership-/Mount-/Prozess-geschützte Rückbau bleibt unverändert anwendbar.
|
||||
Native frische Debian-Installation und kompletter Restore bleiben ungeprüft.
|
||||
@@ -0,0 +1,111 @@
|
||||
# Direkter Vollkontextvergleich: Basalt bestanden, Strata auf Wunsch früh beendet
|
||||
|
||||
Neuer Auftrag nach den unvollständigen Vorversuchen: denselben Test korrekt mit
|
||||
Basalt und der aktuellen Strata-Dual-Konfiguration fahren; Strata abbrechen,
|
||||
sobald es für dieselbe Aufgabe nachweislich länger braucht.
|
||||
|
||||
## Ergebnis
|
||||
|
||||
**Basalt bewältigt zwei gleichzeitig schreibende, nahezu volle Gespräche auf der
|
||||
5080 plus RAM. Für diesen Großtextablauf ist es schneller als die aktuelle
|
||||
Strata-Konfiguration auf3060+5080 plus RAM.** Kein allgemeiner Qualitätsvergleich
|
||||
oder neuer Beleg zur Geschwindigkeit bei kurzen Anfragen.
|
||||
|
||||
| Gleicher Ablauf | Basalt | Strata |
|
||||
|---|---:|---:|
|
||||
| Erstes Dokument,261500 echte Eingabetokens |64,4719s Prefill;4056,0 Token/s |134,1678s Prefill;1949,1 Token/s |
|
||||
| Zweites Dokument,261500 echte Eingabetokens |106,8055s Prefill;2448,4 Token/s |Beim gewünschten Abbruch noch nicht fertig |
|
||||
| Beide Dokumente einlesen und jeweils mit OK bestätigen |172,1586s gemeinsame Wandzeit |Nach232,2537s Gesamtarbeit noch beim zweiten Dokument |
|
||||
| Danach zwei Antworten mit je504 Tokens bei je261632 Eingabetokens |27,8331s gemeinsame Wandzeit;36,2159 Ausgabetokens/s insgesamt |Wegen frühem Abbruch nicht gemessen |
|
||||
| Backend-Ausgaberaten der beiden langen Antworten |18,9 und19,6 Token/s |Nicht gemessen |
|
||||
| Gesamter Ablauf ohne Modellladen |199,9931s |Mehr als232,2537s nötig; auf Wunsch abgebrochen |
|
||||
|
||||
Strata benötigte bereits mindestens16,13% mehr Gesamtzeit als Basalt für den
|
||||
vollständigen Ablauf, ohne selbst fertig zu sein. Das ist eine Untergrenze,
|
||||
keine geschätzte endgültige Laufzeit. Für Strata wird keine Ausgaberate aus den
|
||||
zwei kurzen Bestätigungstokens oder einem früheren Kurztest abgeleitet.
|
||||
|
||||
## Tatsächliche Vollbelegung und korrigierter Testablauf
|
||||
|
||||
Beide Abläufe verwenden dieselbe deterministisch vorbereitete Gesprächsdatei:
|
||||
zunächst zwei verschiedene Archive mit je261500 Eingabetokens und gewünschter
|
||||
Antwort `OK`, danach echte Fortsetzungen mit je261632 Eingabetokens und maximal
|
||||
504 Ausgabetokens. Zusammen mit der tatsächlich benötigten internen Reserve
|
||||
von8 Tokens sind262144 pro Gespräch ausgeschöpft. Tatsächliche API-Zählungen
|
||||
wurden geprüft, nicht allein die eingestellte Fenstergröße.
|
||||
|
||||
Der echte Tokenizer und die echte Chatvorlage wurden vorher ohne Inferenz
|
||||
geprüft: jede Fortsetzung erweitert den gehaltenen bisherigen Text einschließlich
|
||||
`OK`. Anders als der frühere Versuch werden keine vollständigen Prompts mit
|
||||
Ein-Token-Antwort identisch neu abgespielt. Beide Basalt-Fortsetzungen meldeten
|
||||
261493 wiederverwendete Tokens und erzeugten jeweils504 neue Tokens vollständig.
|
||||
Fünf aufgezeichnete Snapshots zeigen beide Slots gleichzeitig mit vollständig
|
||||
verarbeitetem261632-Token-Prompt im Zustand `decoding`. Die Antwortströme
|
||||
überlappten25,6290s. Das Vollparallel-Ziel ist damit für Basalt nachgewiesen.
|
||||
|
||||
Die vorher festgelegte Strata-Abbruchschwelle war Basalts vollständige Arbeitszeit
|
||||
plus15% und2s, hier231,9921s. Nur die eigenen Testverbindungen wurden geschlossen;
|
||||
kein fremder Request, Worker, Dienst oder Host wurde deshalb beendet. Das
|
||||
nachfolgende `Benchmark stopped before admission` bedeutet, dass nach dem
|
||||
gewünschten Stopp keine neuen Ausgabeanfragen mehr begonnen wurden.
|
||||
|
||||
## Gleiche Modellbasis und Grenzen des Vergleichs
|
||||
|
||||
Strata lädt `Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf` und
|
||||
`Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf`. Das offizielle Basalt-Paket
|
||||
nennt genau diese beiden Dateien als Ausgangsquellen. Ihre Größen und die dort
|
||||
hinterlegten SHA-256-Fingerabdrücke aus ersten/letzten64MiB plus Dateigröße wurden
|
||||
an den tatsächlichen Strata-Dateien nachgerechnet: beide stimmen überein.
|
||||
|
||||
Also dieselbe Ausgangsmodell-/GSQ-RCO-IQ3_XXS-Variante, nicht IQ2 gegen IQ3.
|
||||
Der Fingerabdruck ist kein Ganzdatei- oder vollständiger Tensorvergleich.
|
||||
Basalt verwendet ein anderes Laufzeitpaket mit unter anderem HC8-Kopien und
|
||||
abgestimmten Zusatzbestandteilen. Keine behauptete bitidentische Verarbeitung
|
||||
aller Gewichte oder allgemeine Qualitätsgleichheit. Hardwaretopologie und
|
||||
Anbieter-/Profildefaults unterscheiden sich weiterhin wie dokumentiert.
|
||||
|
||||
Basalts unveränderter Pin/Modellpack und Stratas aktive0.1.55-Dual-Konfiguration
|
||||
wurden benutzt; kein zusätzlicher Split-/Tuninglauf. Modellladezeit und kurzer
|
||||
Restorecheck sind nicht in den Arbeitszeiten enthalten.
|
||||
|
||||
## Erhaltener Validierungsfehler, keine verfälschte Langmessung
|
||||
|
||||
Die erste Strata-Anfrage wurde vor Inferenz nach0,033s vom Deck-Validator
|
||||
abgewiesen, weil `reasoning_budget_tokens=0` dort nicht zulässig ist. Dieser
|
||||
Fehlversuch bleibt in `paired-strata.json` erhalten und gehört nicht zur
|
||||
Leistungsmessung. Die korrigierte Anfrage lässt das unnötige Feld weg und nutzt
|
||||
weiter `reasoning_effort=none`; die echte Deck-Validierung und Budgetanwendung
|
||||
wurden offline geprüft. Fünf Offline-Tests einschließlich sofortiger Sicherung
|
||||
eines fertigen Requests bei Abbruch des anderen bestanden. Mockdaten dieser
|
||||
Tests sind keine Modellmessungen.
|
||||
|
||||
## Schlusszustand und Reproduzierbarkeit
|
||||
|
||||
Original-Strata/Qwen wieder geladen, TTS und STT geladen, Originalprofil bereit,
|
||||
aktive und wartende Anfragen null. Zwölf geschützte Hashes sowie Produktionsimage
|
||||
und Containerstart stimmen mit dem neuen Vorher-Snapshot überein. Eigener
|
||||
Basalt-Testcontainer entfernt; keine dauerhafte Basalt-Aktivierung, kein neuer
|
||||
Dienst, keine Hostpakete und kein Neustart von Deck/Host/Gateway.
|
||||
|
||||
`paired_prepare.py`: CPU-only im eigenen Builder mit echtem Tokenizer.
|
||||
`paired_client.py`, `paired_runner.py`, `paired_host.py`: isolierter Basalt-Test
|
||||
und dessen begrenzter Host-Supervisor. `paired_strata_client.py`: nativer
|
||||
Athena-Host über die bestehende Deck-API. `paired_strata_transport.py`: nur dieses
|
||||
NAS-Hermes-Profil, bestehende `/opt/hermes`-Umgebung und profilbezogene verwaltete
|
||||
API-Identität ausschließlich im Speicher/SSH-stdin. Kein Schlüssel in Artefakten.
|
||||
|
||||
Alle Athena-Artefakte bleiben in der eigenen entfernbaren Kandidatenwurzel.
|
||||
Der ältere8470-Einträge-Ganzbaumaudit bleibt historisch; aktuelle Testdateien und
|
||||
Fixture sind separat im Artefaktindex gehasht. Keine erneute80GB-Modellhashrunde,
|
||||
keine neue native Installation oder vollständige frische Debian-/Restore-Abnahme.
|
||||
Dieser Testauftrag ist abgeschlossen und keine Freigabe für weitere Inferenz
|
||||
oder dauerhafte Produktionsumstellung.
|
||||
|
||||
Nachweise: [Vergleich](evidence/paired-comparison.json),
|
||||
[Basalt einschließlich beider Antwortströme und Slots](evidence/paired-basalt.json),
|
||||
[Strata einschließlich gewünschtem Abbruch](evidence/paired-strata2.json),
|
||||
[erhaltener API-Validierungsfehler](evidence/paired-strata.json),
|
||||
[Schlusszustand](evidence/paired-final-state.json),
|
||||
[Datei-/Fixtureindex](evidence/paired-artifact-index.json),
|
||||
[geprüfte GGUF-Ausgangsquellen](evidence/paired-weight-source-check.json),
|
||||
[Basalt-Serverprotokoll](evidence/paired-server.log).
|
||||
@@ -0,0 +1,233 @@
|
||||
# Basalt: separat entfernbarer Buildkandidat
|
||||
|
||||
## Auftrag und Grenzen
|
||||
|
||||
Michael hat einen parallelen, nach einem Test sauber entfernbaren Basalt-Build
|
||||
beauftragt. Bau und Paketvorbereitung waren ohne Modellstart. Nach seinem
|
||||
**separaten Go** wurde genau ein kurzer echter Modelltest gefahren und der
|
||||
Originalbetrieb wiederhergestellt. Basalt bleibt nicht aktiviert, nicht in Deck
|
||||
registriert; kein Autostart, keine neue API-Identität oder systemd-Unit.
|
||||
|
||||
**Aktuell: Strata/Qwen, TTS und STT geladen; Basalt gestoppt.** Elf Modellrequests
|
||||
bestanden. Solo 71,4 statt dokumentierter 64,8 Backend-Token/s; Parallelpaar
|
||||
13,7656 statt 12,3075 s, also langsamer; frisches 60047-Token-Dokument 12,0572
|
||||
statt 31,7225 s. Historischer Vergleich verschiedener GPU-Aufteilungen, kein
|
||||
kontrolliertes A/B. Keine weiteren Varianten angeschlossen.
|
||||
[Modelltest, Urteil, Wiederherstellung und Grenzen](RESULTS.md).
|
||||
|
||||
**Neuester kleiner64K-Chatvergleich vollständig:** beide Engines acht echte
|
||||
Requests, sechs kurze Antworten. Steady Chat-Reaktion Basalt0,704s/Strata1,268s;
|
||||
fertige Antwort2,206s/2,977s, beobachtetes Schreiben33,27/26,06Token/s.
|
||||
[64K-Chat, tatsächliche Cacheverluste und Rohdaten](CHAT64_RESULTS.md).
|
||||
|
||||
**Vorheriger direkter Vergleich abgeschlossen:** Basalt verarbeitet zwei volle
|
||||
Gespräche gleichzeitig, je261632 Eingabe+504 Ausgabe. Gesamte Arbeit199,993s;
|
||||
Strata bei gleicher Aufgabe nach232,254s wie gewünscht gestoppt, noch beim zweiten
|
||||
Dokument. Originalbetrieb unverändert geladen. [Aktueller Vergleich und Quellenidentität](PAIRED_RESULTS.md).
|
||||
|
||||
**Früherer neuer Vollkontext-Go:** zwei261632-Token-Eingaben vollständig
|
||||
verarbeitet, eine504-Token-Ausgabe mit17,5 Token/s; parallele Ausgabe aus zwei
|
||||
vollen Slots wegen erneutem Prefill und Runner-Zeitlimit **nicht nachgewiesen**.
|
||||
Originalbetrieb wiederhergestellt. [Teilresultate und Testablauffehler](FULL_CONTEXT_RESULTS.md).
|
||||
Der8470-Einträge-Audit gehört zum früheren Kurzteststand, nicht zum erweiterten Baum.
|
||||
|
||||
## Vorherige Build-Abnahme, vor Modelldownload und Test
|
||||
|
||||
**Build und begrenzte Abnahme abgeschlossen, nicht aktiviert.** Nach Hermes-
|
||||
Neustart wurde der tatsächliche Athena-Zustand geprüft und ohne erneuten Download
|
||||
oder Neuaufbau der Binärprogramme bei der Abnahme weitergemacht.
|
||||
|
||||
- Alle vier Programme gebaut; Quellstand und Binärhashes unverändert.
|
||||
- **62/62 ausgewählte CPU-Tests bestanden**, keine Fehler oder ausgewählten Skips.
|
||||
- Python-Fixture-Suite: **645 bestanden, 2 übersprungen**, insgesamt 647 Tests.
|
||||
- **9 lokale Rückbau-/Isolations-/Manifesttests bestanden**, einschließlich
|
||||
tatsächlicher Red/Green-Regressionsnachweise.
|
||||
- Engine- und Server-CLI-Hilfe sowie Bibliotheken im Builder geprüft. Native
|
||||
Engine-Hilfe und Bibliotheken zusätzlich direkt auf dem Debian-Host geprüft.
|
||||
- Eigener Builder beendet/entfernt; 12 geschützte Produktionshashes, Image und
|
||||
Containerstart unverändert, Produktivcontainer gesund. Qwen/TTS/STT per
|
||||
bestehendem authentifiziertem Statuszugang weiterhin geladen bestätigt.
|
||||
- Datei-/Linkinventar **8290 Einträge, 1,48 GiB logische Größe**, unabhängig
|
||||
gegen den tatsächlichen Kandidatenbaum nachgelesen und abgeglichen.
|
||||
- In dieser Bauphase kein Modelldownload, keine Modell-/GPU-Inferenz oder Aktivierung.
|
||||
|
||||
[Maschinenlesbare damalige Build-Abnahme](evidence/final.json). Der Kandidat
|
||||
bleibt getrennt erhalten; ein erneuter Modelltest braucht ein neues Go.
|
||||
|
||||
## Quelle und geprüfte Einschränkung
|
||||
|
||||
- Offizielle Quelle: `https://github.com/jesdga95/basalt.git`.
|
||||
- Fester Commit: `9175e7a3211bda355c02e804c7c107b15b8ea89f`.
|
||||
- CMake-Projektversion dieses festen Standes: **0.1.0**.
|
||||
- Zielarchitektur: **SM120**, inklusive des upstream vorgesehenen SM120a-FP4-Targets.
|
||||
- Keine Änderung der Upstream-Quelldateien.
|
||||
|
||||
**Die 3060 wird nicht unterstützt, auch nicht als zusätzliche Experten-GPU.**
|
||||
`src/program/gpu_select.cpp:136` akzeptiert bekannte Karten ausschließlich mit
|
||||
Compute Capability 12.0; die Auswahl und der zugehörige CPU-Test weisen SM86
|
||||
zurück. Eine spätere Messung wäre daher **Basalt auf 5080 + RAM gegen Strata auf
|
||||
3060 + 5080 + RAM**, nicht derselbe GPU-Aufbau. Keine Leistungszusage aus fremden
|
||||
Blackwell-Benchmarks ableiten. Zwei volle 262144-Kontext-Slots müssen separat
|
||||
konfiguriert und tatsächlich auf Speicherbedarf und Funktion geprüft werden.
|
||||
|
||||
## Einziger beschreibbarer Basalt-Bereich auf Athena
|
||||
|
||||
`/opt/athena-deck-dev/basalt-candidate-9175e7a3211b`
|
||||
|
||||
Darunter liegen sämtliche Basalt-Quellen, Builddateien, Binärprogramme, private
|
||||
Python-Umgebung, HOME, temporäre Dateien, Paket-/CUDA-/HF-Caches, Status, Logs und
|
||||
Nachweise. Spätere Modellpakete, Konvertierungsstände und Testdaten ebenfalls
|
||||
hier ablegen; keine externen Caches oder globalen Modelleinstellungen verwenden.
|
||||
Der Build lädt keine Modellgewichte herunter. Anschließend wurde das komplette
|
||||
offizielle Paket separat vorbereitet: `models/Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt`,
|
||||
79867643037 Bytes, feste Quelle/Revision/SHA-256 in [model-source.json](model-source.json).
|
||||
Die vorhandenen GGUFs wären konvertierbar; sie sind nicht direkt ausführbar und
|
||||
eine einfache Konvertierung ersetzt nicht die qualifizierten Anbieter-Zusätze
|
||||
Expertenprofil, HC8 und MTP-Drafter. Alle 19 Paketsektionen sind lesbar, Ganzdatei-
|
||||
SHA-256 unabhängig geprüft. Kein globaler HF-Cache oder zweite Downloadkopie.
|
||||
|
||||
Zwei vorhandene Ressourcen werden nur geliehen, niemals durch den Rückbau gelöscht:
|
||||
|
||||
1. Privates vorhandenes CUDA-Toolkit, read-only:
|
||||
`/opt/athena-deck-dev/runtime/state/strata-runtime/cuda`.
|
||||
2. Bereits vorhandenes Deck-Basisimage, über seine tatsächliche SHA-256-ID fixiert
|
||||
und in `production-before.json` dokumentiert. Kein neuer Image-Tag, kein Image-
|
||||
Build oder Pull, kein Docker-Volume.
|
||||
|
||||
Nur kurzlebiger eigener Builder:
|
||||
`athena-basalt-build-9175e7a3211b`, Ownership-Label
|
||||
`athena-deck.basalt-owner=athena-deck/basalt/9175e7a3211bda355c02e804c7c107b15b8ea89f`.
|
||||
Automatische Entfernung, keine veröffentlichten Ports, keine GPU-Geräte, kein
|
||||
Docker-Socket, keine Modell-/Produktionszustands-/Zugangsmounts. Der
|
||||
Kandidatenbereich ist als schreibbarer Bind-Mount eingebunden, dessen eigenes `tmp` zusätzlich
|
||||
als `/tmp`; dazu ein read-only Toolkit-Mount. Beide schreibbaren Quellen liegen
|
||||
im selben entfernbaren Kandidatenbereich, nicht im Host-`/tmp`.
|
||||
Root-Dateisystem read-only. Nach Dependency-Download läuft der eigentliche
|
||||
Build mit Netzwerk `none`.
|
||||
|
||||
Limits: UID/GID 65534, eine CPU Quota, CPU Shares 2, nice 19, ein Compilejob.
|
||||
Kompilierung: 3 GiB RAM ohne zusätzlichen Swap, 256 PIDs, Start ab 6 GiB
|
||||
verfügbarem RAM. Reine Abnahme: 2 GiB RAM ohne zusätzlichen Swap, 512 PIDs,
|
||||
Start ab 4 GiB verfügbarem RAM. Schutzabbruch nur des eigenen Builders unter 1,5 GiB Host-
|
||||
Spielraum oder nach 45 Minuten pro Phase. Keine Aussage, dass ein paralleler
|
||||
Build keinerlei CPU-/I/O-Einfluss hat; keine Produktionsanfragen werden dafür
|
||||
abgebrochen oder abgewartet/entladen.
|
||||
|
||||
## Ausführungsumgebungen und Reproduktion
|
||||
|
||||
- `candidate.py`: Athena-Host; Vorbereitung, begrenzter Builder, Schutzprüfung,
|
||||
Zustandsvergleich und Rückbau. Im Kandidatenverzeichnis ausführbar abgelegt.
|
||||
- `build.py`: ausschließlich im eigenen unprivilegierten Builder; öffentlicher
|
||||
fester Git-Stand, private venv, CMake/Ninja und CPU-/Fixture-Tests.
|
||||
- `prepare_model.py`: Athena-Host, vorhandene aria2c 1.37.0/ionice, niedrige CPU-/
|
||||
I/O-Priorität, vier HTTP-Verbindungen, 768 MiB Adressraumlimit und 20 GiB
|
||||
freier Speicher als Untergrenze. Resumierbare eigene `.part`/`.aria2`-Dateien,
|
||||
anschließende SHA-256-/Headerprüfung, keine Inferenz. Native unprivilegierte
|
||||
Schreibzugriffe über einen geerbten FD ausschließlich auf den eigenen
|
||||
Kandidaten: der geschützte Host-Elternpfad bleibt unverändert Modus 0700.
|
||||
- `test_client.py` und `run_short_test.py`: im isolierten GPU-Testcontainer;
|
||||
explizites Go nötig, nur Loopback, elf synthetische echte Modellrequests und
|
||||
harter äußerer Deadline-/Shutdownpfad. Sieben Offline-Protokoll-/Go-/Konfigtests
|
||||
in `test_client_offline.py` bestanden, kein Ersatz für Modelltests.
|
||||
- `host_short_test.py`: Athena-Host; verlangt separates Go, frischen tatsächlich
|
||||
nachgelesenen GUI-Drain, entfernten Originalworker und freie GPUs. Stoppt nur
|
||||
den eigenen verifizierten Testcontainer bei Deadline-/RAMfehlern. Normaler
|
||||
Produktions-Drain und Wiederherstellung bleiben beim authentifizierten Operator.
|
||||
- `test_candidate.py`: NAS, neun ausschließlich lokale Tests mit synthetischen
|
||||
Wegwerfdateien; keine Athena-Verbindung. Sieben bestanden vor dem Build;
|
||||
alle neun einschließlich neuer Container-/Temporärpfad-/Manifestregressionen
|
||||
bestanden nach der Wiederaufnahme, mit tatsächlich beobachtetem Red/Green-Verlauf.
|
||||
- Keine Skripte oder Pakete in der Hermes-Umgebung installiert.
|
||||
|
||||
Verifizierte Buildumgebung: GCC/G++ 13.3.0 (Ubuntu 24.04), Python 3.12.3,
|
||||
CUDA 13.0.48; CMake 3.31.6 und Ninja 1.11.1.4 in der privaten venv. Die festen
|
||||
Upstream-Requirements und tatsächlichen weiteren Paketversionen stehen in
|
||||
`python-lock.txt`; `pip check` bestand. Vollständiges Compile-/Testlog:
|
||||
`build.log`. Nur CPU-markierte CTests, AVX-512-exklusive Tests auf dem AVX2-Host
|
||||
ausgeschlossen. Der numerische Quantizer-Test mit eingebautem 200000-Iterationen-
|
||||
Mikrobenchmark ist zusätzlich explizit ausgeschlossen und nicht als bestanden
|
||||
gezählt. Keine GPU-Paritätstests, Modellbenchmarks oder Inferenz.
|
||||
|
||||
### Tatsächliche Wiederaufnahme nach Hermes-Neustart
|
||||
|
||||
Alle 609 Compiler-/Linkschritte waren bereits abgeschlossen, vier Binärprogramme
|
||||
vorhanden, kein Builder mehr aktiv. Die erste Abnahme enthielt 54 protokollierte
|
||||
Tests und sechs Fehler, noch kein endgültiges Testergebnis. Die sechs Fehler
|
||||
stammten vom fest auf `/tmp` zurückfallenden Upstream-Helfer
|
||||
`src/platform/file.cpp:291`, der `TMPDIR` unter Linux ignoriert. Deshalb wurde
|
||||
das bereits eigene Kandidaten-`tmp` zusätzlich ins Container-`/tmp` eingebunden.
|
||||
Keine Änderung am Upstream-Code, an Host-`/tmp` oder an Produktionspfaden.
|
||||
|
||||
Der anschließende vollständige Lauf bestand 61/62 Tests. Der verbliebene Fehler
|
||||
`direct_file_async_test` kam vom 256-PID-Limit: Linux-`DirectFile` erzeugt bereits
|
||||
256 I/O-Threads pro Standardöffnung (`src/platform/direct_file.cpp:394`), neben
|
||||
den Steuerprozessen. Nur die Abnahme erhielt daher 512 PIDs; CPU-/GPU-/Netz-
|
||||
Isolation und RAMbegrenzung bleiben bestehen. Danach **62/62 CPU-Tests, null
|
||||
Fehler, null übersprungene ausgewählte Tests**, in 91 Sekunden laut JUnit.
|
||||
|
||||
Originale Status-/Hash- und Fehlernachweise bleiben im Kandidaten unter
|
||||
`resume-before.json`, `ctest-cpu-interrupted.txt`, `ctest-cpu-256pids.txt/.xml`
|
||||
sowie den archivierten Controller-/Buildskripten erhalten. Die Binärhashes vor
|
||||
Wiederaufnahme sind erfasst und müssen bei der Schlussabnahme übereinstimmen.
|
||||
Der nach einem Vordergrund-Timeout noch laufende Python-Fixture-Job wurde per
|
||||
Ownership-Prüfung wiedergefunden und übernommen, nicht doppelt gestartet.
|
||||
Sein Container endete tatsächlich mit Exitcode 0; alle nachfolgenden CLI-/
|
||||
Hashprüfungen waren abgeschlossen. Die Binärhashes stimmen nachweislich mit dem
|
||||
Stand vor der Wiederaufnahme überein. Die Unterbrechungsursache des ersten
|
||||
CPU-Laufs ist aus den erhaltenen Nachweisen nicht sicher feststellbar; der von
|
||||
Michael gemeldete Hermes-Neustart ist nicht automatisch ein Enginefehler.
|
||||
|
||||
### Native Debian-Perspektive, keine versteckte Containerpflicht
|
||||
|
||||
Das Artefakt ist ein natives C++/CUDA-Programm. Ein neuer nativer Aufbau braucht
|
||||
explizit x86-64/AVX2, eine unterstützte Blackwell-SM120-GPU samt CUDA-13-kompatiblem
|
||||
Treiber, GCC/Clang mit C++20, CUDA-Toolkit >=13.0, Git, CA-Zertifikate, Python
|
||||
>=3.10 mit venv und CMake >=3.24; hier die oben fixierten tatsächlich genutzten
|
||||
Versionen. Quellen und Paketumgebung getrennt unter einer eigenen konfigurierten
|
||||
Zustandswurzel provisionieren, ohne System-Python oder Treiber zu ersetzen.
|
||||
`build.py` zeigt die expliziten unveränderten CMake-/Ninja-Kommandos und Pins;
|
||||
das geborgte Toolkit ist auf einem frischen Host separat nach dem vorhandenen
|
||||
[gepinnten nativen CUDA-Rezept](../../../deploy/STRATA_NATIVE.md) bereitzustellen.
|
||||
|
||||
Die heutige Python-Umgebung wurde für den bestehenden Ubuntu-Builder erzeugt;
|
||||
sie ist **keine geprüfte, auf Debian portable Serverinstallation**. Auf einem
|
||||
nativen Debian muss die venv mit dem dort explizit provisionierten Python neu
|
||||
erstellt werden. Keine native Deck-Integration, kein systemd-Dienst, kein
|
||||
vollständiger frischer Debian-/verschlüsselter Restore-Nachweis. Dieser Kandidat
|
||||
ist optional und nicht Teil des produktiven Restore-Umfangs. Das öffentliche
|
||||
Modellpaket liegt mit fester Quelle, Revision und Hash ausschließlich im
|
||||
Kandidatenbereich; Wiederbeschaffung unter neuer expliziter Zielwurzel ist
|
||||
dokumentierbar, aber kein geprüfter kompletter nativer Restore. Keine Gewichte
|
||||
oder Geheimnisse in Git. Die tatsächliche Kurzprüfung ist keine Daueraktivierung.
|
||||
|
||||
## Rückbau
|
||||
|
||||
Auf Athena zunächst ausschließlich den Plan lesen:
|
||||
|
||||
```sh
|
||||
python3 /opt/athena-deck-dev/basalt-candidate-9175e7a3211b/candidate.py cleanup
|
||||
```
|
||||
|
||||
Nach beendetem und separat freigegebenem Modelltest tatsächlich entfernen:
|
||||
|
||||
```sh
|
||||
python3 /opt/athena-deck-dev/basalt-candidate-9175e7a3211b/candidate.py cleanup --apply
|
||||
```
|
||||
|
||||
Der Rückbau akzeptiert ausschließlich den festen Kandidatenpfad, dessen
|
||||
Ownership-Marker, Geräte-/Inodekennung und unverknüpftes Wurzelverzeichnis. Er
|
||||
verweigert existierende Kandidatencontainer, Prozesse unterhalb des Kandidaten
|
||||
sowie eingebundene Dateisysteme. Descriptor-basiertes `rmtree` folgt internen
|
||||
Symlinks nicht in externe Ziele. Keine pauschalen Docker-Prunes, kein Entfernen
|
||||
geteilter Images/Toolkits, keine Dienststopps, keine Änderungen an Strata oder
|
||||
Hostpaketen. Container-Cleanup im Build-Controller gilt auch bei getrenntem
|
||||
SSH-/Docker-Client; dessen Ende allein beweist keine Containerbeendigung.
|
||||
|
||||
Die endgültige Verifikation hat denselben Rückbauhelfer an einem tatsächlichen
|
||||
Wegwerfverzeichnis auf Athena ausgeführt, das Überleben eines externen Symlink-
|
||||
Ziels und die Ablehnung einer verknüpften Wurzel geprüft und den echten Kandidaten
|
||||
als Dry-Run validiert. Der echte Kandidat bleibt für den späteren Test erhalten.
|
||||
Das finale `manifest.json` erfasst reguläre Dateien mit Größe/SHA-256 und interne
|
||||
Symlinkeinträge ohne deren Ziele zu lesen; ausgenommen ist die Manifestdatei
|
||||
selbst. Git-Dokumentation und normale SSH-/Docker-Systemprotokolle sind keine
|
||||
zu löschende Basalt-Installation und werden nicht als Spurenbeseitigung entfernt.
|
||||
@@ -0,0 +1,104 @@
|
||||
# Basalt: ein kurzer echter Modelltest, Originalbetrieb wiederhergestellt
|
||||
|
||||
Diese Datei beschreibt die erste Kurzabnahme.
|
||||
|
||||
**Neuester Stand:** [direkter Vollkontextvergleich](PAIRED_RESULTS.md): Basalt
|
||||
full/full bestanden, Strata bei derselben Aufgabe wie gewünscht früh gestoppt.
|
||||
|
||||
Historisch: Der erste separat freigegebene
|
||||
[Vollkontextversuch](FULL_CONTEXT_RESULTS.md) blieb im parallelen Ausgabeteil
|
||||
unvollständig; er bestätigt keine zwei gleichzeitig voll schreibenden Slots.
|
||||
|
||||
## Urteil und aktueller Betrieb
|
||||
|
||||
**Gemischtes Ergebnis: lange Prompts deutlich schneller, Solo-Decode etwas
|
||||
schneller, zwei gleichzeitige Antworten langsamer. Strata bleibt aktiv.**
|
||||
Kein automatischer Laufzeitwechsel, kein dauerhaft gestartetes Basalt und keine
|
||||
weitere Variante. Der getrennte Kandidat samt Modellpaket bleibt entfernbar.
|
||||
|
||||
## Tatsächlicher Lauf
|
||||
|
||||
Nach Michaels separatem Go: reguläre authentifizierte LAN-GUI, aktive Requests,
|
||||
Scheduler-Aktivität, wartende Requests und TTS-Warteschlange alle explizit null,
|
||||
kein Wechsel im Gang. Normaler Endpunkt-Drain; nachgelesen `stopped`, LLM entladen,
|
||||
TTS/STT weiter geladen. Keine Admin-Umgehung, kein Deck-/Host-/Gateway-Neustart.
|
||||
|
||||
- Fester Basalt-Commit `9175e7a3211bda355c02e804c7c107b15b8ea89f`, Version 0.1.0.
|
||||
- Offizielles vollständiges GSQ-RCO IQ3_XXS-Paket, Revision
|
||||
`c0e57437ea564aa85263ab0bc0ee83568dd53213`, SHA-256
|
||||
`d02bb1b188bbc9ed6bc88ce5e89c7c2d64247290c7bae70fbb9d9d17fe65ed71`; 79867643037 Bytes, 19 Sektionen,
|
||||
Header/Metadaten mit dem festen Reader geprüft. Bestehende GGUFs sind
|
||||
grundsätzlich konvertierbar, aber nicht direkt ausführbar; das gewählte
|
||||
Anbieterpaket enthält das abgestimmte Profil, HC8 und MTP.
|
||||
- Nur RTX 5080, über UUID an die isolierte Umgebung gebunden. Kein 3060-Peer.
|
||||
- Zwei tatsächliche Slots à 262144 Tokens per `/props` und `/slots` geprüft,
|
||||
int8-KV, Expertcache/Prefill `auto`, residente Experten, Bilder aus.
|
||||
- Anbieterdefaults; beobachtet: AVX2, CPU-Pool 3, Resident-Budget 41,7 GB,
|
||||
elastischer KV-Speicher `0.9/7.8GiB`, MTP auch bei parallelen Anfragen aktiv.
|
||||
- CPU-Maske `0,1,2,3,6,7,8,9`; CPU-Quote 12 wie Produktionscontainer.
|
||||
Nur der eigene Testcontainer: 52 GiB RAM, kein zusätzlicher Swap,
|
||||
512 PIDs, kein Netzwerk/Host-Port, Client und Server auf Container-Loopback.
|
||||
- Modellladen: **33,08 s**. Client: **43,42 s**.
|
||||
- **11/11 echte Requests bestanden**: Solo, Parallelpaar, zwei getrennte
|
||||
Dokumente, zwei Cache-Folgeturns, 60047-Token-Dokument, JSON, Mock-Tool-Aufruf
|
||||
und festes synthetisches Tool-Ergebnis. Keine reale Tool-/Infrastrukturaktion.
|
||||
- Cache-Wiederverwendung tatsächlich gemeldet: 7427 und
|
||||
7413 Tokens. Beide Dokumentkennungen getrennt gefunden.
|
||||
|
||||
## Vergleich mit dokumentiertem aktuellem Strata 0.1.55
|
||||
|
||||
| Lastfall / Metrik | Strata, dokumentiert | Basalt, dieser Lauf | Einordnung |
|
||||
|---|---:|---:|---|
|
||||
| Solo, 512 Ausgabetokens, Backend-Decode | 64,8 Token/s | 71,4 Token/s | +10,2 % |
|
||||
| Zwei parallele Antworten à 512 Tokens, gemeinsame Gesamtzeit | 12,3075 s | 13,7656 s | Basalt benötigt 11,8 % mehr Zeit |
|
||||
| Derselbe parallele Durchsatz, Ende-zu-Ende | 83,20 Token/s | 74,39 Token/s | Strata vorne |
|
||||
| Frisches Dokument, 60047 Eingabetokens, Prefill | 1923,3 Token/s | 5140,4 Token/s | Basalt vorne |
|
||||
| Dasselbe lange Dokument, vollständige Antwortzeit | 31,7225 s | 12,0572 s | 2,63× so schnell / 62,0 % weniger Zeit |
|
||||
|
||||
Referenz: [dokumentierte Strata-Kurzabnahme](../strata-029-staged-2026-11-01/README.md).
|
||||
Keine neue Referenzinferenz oder Matrix. Die kleine Original-Qwen-Anfrage
|
||||
nachher dient ausschließlich dem Wiederladen/Restorenachweis, nicht der Rate.
|
||||
Die Strata-Solo-Gesamtzeit 67,749 s enthält Modellstart/Laden und wird **nicht**
|
||||
mit Basalts bereits geladenem Solo-Request verglichen; oben stehen nur die
|
||||
Backend-Decode-Raten. Paralleldurchsatz stammt aus gemeinsamer Wandzeit,
|
||||
nicht aus summierten oder fragmentierten Slot-/Backend-Zählern.
|
||||
|
||||
**Grenzen:** historischer Einzelvergleich, kein kontrolliertes interleaved A/B.
|
||||
Strata nutzt 3060 + 5080, Basalt 5080 + RAM; vollständiges Anbieterpaket,
|
||||
CPU-Pool, Speicherbudgets und MTP-Defaults unterscheiden sich. Zwei 262K-Slots
|
||||
sind konfiguriert und bei Kurzlast benutzt, nicht gleichzeitig bis zur Grenze gefüllt.
|
||||
Keine allgemeine Qualitätsgleichheit, Blindbewertung oder Langzeitstabilität;
|
||||
die zusätzlichen Code-/Fenced-Tool-Fälle der 13-Request-Strata-Abnahme sind
|
||||
nicht Teil dieses kürzeren Basalt-Laufs. Kein Bild-/Audio-/TTS-Modelltest.
|
||||
|
||||
## Wiederherstellung und Rückbau
|
||||
|
||||
Testserver ordentlich beendet (Exitcode 0), eigener Container entfernt,
|
||||
keine GPU-Computeprozesse mehr vor Originalstart. Ursprünglichen Endpunkt
|
||||
über die normale GUI gestartet und Qwen mit einer kleinen synthetischen
|
||||
Restoration-Anfrage geladen/geprüft. Danach authentifizierter GUI-Readback:
|
||||
`running`, Qwen/TTS/STT geladen, aktive/wartende Arbeit null, kein Wechsel.
|
||||
Alle **12 geschützten Datei-Hashes**, Produktionsimage und Containerstart
|
||||
unverändert; Originalprofil `flash-next-strata-iq3-dual`, Backend gesund.
|
||||
|
||||
Gesamtfenster bis zur Wiederherstellungsprüfung:
|
||||
**382,507 s**, rund
|
||||
**6 min 23 s**,
|
||||
innerhalb der 900-Sekunden-Grenze. Erst danach Offline-Auswertung/Dokumentation.
|
||||
Michaels Go ist damit verbraucht, keine dauerhafte Modellumschaltfreigabe.
|
||||
|
||||
Alle neuen Gewichte, Caches, Testskripte und Resultate bleiben ausschließlich
|
||||
unter `/opt/athena-deck-dev/basalt-candidate-9175e7a3211b`.
|
||||
Nach dem Test neu gehashtes Manifest: 8470 Datei-/Linkeinträge, 76,09 GiB
|
||||
logische Größe einschließlich Modellpaket und CUDA-Caches; unabhängig gegen
|
||||
den tatsächlichen Baum abgeglichen. Ganzdatei-Modellhash stimmt weiter mit
|
||||
dem Quellenpin überein. Kandidat bewusst erhalten, nicht automatisch gelöscht.
|
||||
Der guarded Cleanup-Helfer entfernt diesen Kandidaten, niemals das nur geliehene
|
||||
CUDA-Toolkit oder das bestehende App-Image. Keine Integration in Produktions-
|
||||
profile oder systemd, keine Hostpakete installiert. Vollständiger nativer
|
||||
Debian-/verschlüsselter Restore bleibt eine getrennte offene Abnahme.
|
||||
|
||||
Nachweise: [Rohdaten, Runtime- und Restorenachweise](evidence/short-test.json),
|
||||
[programmgesteuerter Vergleich](evidence/comparison.json),
|
||||
[aktueller Manifest-/Rückbauaudit](evidence/post-test-audit.json),
|
||||
[Build-Abnahme vor Modelldownload](evidence/final.json).
|
||||
@@ -0,0 +1,126 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside the owned builder only: bootstrap or offline CPU-only build checks."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
import venv
|
||||
|
||||
COMMIT = '9175e7a3211bda355c02e804c7c107b15b8ea89f'
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
SOURCE = ROOT / 'source'
|
||||
STARTED = time.time()
|
||||
|
||||
|
||||
def status(phase, **values):
|
||||
data = dict(commit=COMMIT, phase=phase, updated=time.time(), activated=False,
|
||||
inference_performed=False, **values)
|
||||
target = ROOT / 'status.json'
|
||||
temporary = target.with_suffix('.tmp')
|
||||
temporary.write_text(json.dumps(data, indent=2) + '\n')
|
||||
temporary.replace(target)
|
||||
print(phase, flush=True)
|
||||
|
||||
|
||||
def run(command, *, cwd=None, capture=None, input=None):
|
||||
with (ROOT / 'build.log').open('a') as log:
|
||||
log.write('\n$ ' + ' '.join(map(str, command)) + '\n')
|
||||
log.flush()
|
||||
if capture:
|
||||
with (ROOT / capture).open('w') as output:
|
||||
subprocess.run(list(map(str, command)), cwd=cwd, check=True, input=input,
|
||||
text=True, stdout=output, stderr=output)
|
||||
else:
|
||||
subprocess.run(list(map(str, command)), cwd=cwd, check=True, input=input,
|
||||
text=True, stdout=log, stderr=subprocess.STDOUT)
|
||||
|
||||
|
||||
def bootstrap():
|
||||
status('fetching pinned source')
|
||||
run(['git', 'init', '-q', SOURCE])
|
||||
run(['git', '-C', SOURCE, 'fetch', '--depth', '1',
|
||||
'https://github.com/jesdga95/basalt.git', COMMIT])
|
||||
run(['git', '-C', SOURCE, 'sparse-checkout', 'init', '--no-cone'])
|
||||
run(['git', '-C', SOURCE, 'sparse-checkout', 'set', '--no-cone', '--stdin'],
|
||||
input='/*\n!/**/vpn/\n!/vpn/\n!/**/vpn.auth\n!/vpn.auth\n')
|
||||
run(['git', '-C', SOURCE, 'checkout', '-q', '--detach', 'FETCH_HEAD'])
|
||||
assert subprocess.check_output(['git', '-C', SOURCE, 'rev-parse', 'HEAD'], text=True).strip() == COMMIT
|
||||
status('private Python environment')
|
||||
venv.create(ROOT / 'venv', with_pip=True, symlinks=False)
|
||||
python = ROOT / 'venv/bin/python'
|
||||
run([python, '-m', 'pip', 'install', '--disable-pip-version-check', '--no-input',
|
||||
'--index-url', 'https://pypi.org/simple', 'cmake==3.31.6', 'ninja==1.11.1.4',
|
||||
'-r', SOURCE / 'requirements-test.txt'])
|
||||
run([python, '-m', 'pip', 'freeze', '--all'], capture='python-lock.txt')
|
||||
run([python, '-m', 'pip', 'check'], capture='pip-check.txt')
|
||||
run([CUDA / 'bin/nvcc', '--version'], capture='nvcc-version.txt')
|
||||
run(['g++', '--version'], capture='compiler-version.txt')
|
||||
run([python, '--version'], capture='python-version.txt')
|
||||
status('bootstrap complete', seconds=time.time() - STARTED)
|
||||
|
||||
|
||||
def environment():
|
||||
tools = ROOT / 'venv/bin'
|
||||
os.environ['PATH'] = str(tools) + ':' + str(CUDA / 'bin') + ':' + os.environ['PATH']
|
||||
os.environ['LD_LIBRARY_PATH'] = str(CUDA / 'lib64') + ':' + str(CUDA / 'lib')
|
||||
return tools
|
||||
|
||||
|
||||
def build():
|
||||
tools = environment()
|
||||
status('configure CUDA 13 / SM120; GPU access disabled')
|
||||
run([tools / 'cmake', '-S', SOURCE, '-B', ROOT / 'build', '-G', 'Ninja',
|
||||
'-DCMAKE_BUILD_TYPE=Release', '-DBUILD_TESTING=ON',
|
||||
'-DCMAKE_CUDA_COMPILER=' + str(CUDA / 'bin/nvcc'),
|
||||
'-DCUDAToolkit_ROOT=' + str(CUDA), '-DCMAKE_CUDA_ARCHITECTURES=120',
|
||||
'-DCMAKE_MAKE_PROGRAM=' + str(tools / 'ninja')])
|
||||
status('compile; one job, low CPU priority')
|
||||
run([tools / 'cmake', '--build', ROOT / 'build', '--parallel', '1'])
|
||||
check()
|
||||
|
||||
|
||||
def check():
|
||||
tools = environment()
|
||||
assert all((SOURCE / 'bin' / name).is_file() for name in
|
||||
('basalt', 'basalt-bench', 'basalt-probe', 'basalt-vision'))
|
||||
status('CPU-labelled CTest only; no GPU tests')
|
||||
# The quantizer case also contains a dedicated 200000-iteration microbenchmark.
|
||||
# It is outside this build-only acceptance, not a silently passed test.
|
||||
selected = [tools / 'ctest', '--test-dir', ROOT / 'build', '-L', '^cpu$', '-LE', 'avx512',
|
||||
'-E', '^native_expert_parity_q8k_quant$']
|
||||
run(selected + ['--show-only=json-v1'], capture='ctest-selection.json')
|
||||
run(selected + ['--output-on-failure', '--timeout', '90',
|
||||
'--output-junit', ROOT / 'ctest-cpu.xml'], capture='ctest-cpu.txt')
|
||||
status('Python server fixture tests; no model, no network')
|
||||
run([tools / 'python', '-m', 'unittest', 'discover', '-s', 'serve/tests', '-t', '.'],
|
||||
cwd=SOURCE, capture='python-tests.txt')
|
||||
status('CLI help and linked-library verification; no model loading')
|
||||
run([SOURCE / 'bin/basalt', '--help'], capture='engine-help.txt')
|
||||
run([SOURCE / 'bin/basalt', 'serve', '--help'], capture='server-help.txt')
|
||||
run(['ldd', SOURCE / 'bin/basalt'], capture='ldd.txt')
|
||||
assert 'not found' not in (ROOT / 'ldd.txt').read_text()
|
||||
assert not subprocess.check_output(['git', '-C', SOURCE, 'status', '--porcelain',
|
||||
'--untracked-files=no'], text=True).strip()
|
||||
binaries = {}
|
||||
for name in ('basalt', 'basalt-bench', 'basalt-probe', 'basalt-vision'):
|
||||
path = SOURCE / 'bin' / name
|
||||
with path.open('rb') as data:
|
||||
binaries[name] = dict(bytes=path.stat().st_size,
|
||||
sha256=hashlib.file_digest(data, 'sha256').hexdigest())
|
||||
status('built and CPU-checked; awaiting separate model-test Go',
|
||||
seconds=time.time() - STARTED, binaries=binaries, gpu_architectures=[120])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('phase', choices=['bootstrap', 'build', 'check'])
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
globals()[args.phase]()
|
||||
except BaseException as error:
|
||||
status('failed', error=type(error).__name__ + ': ' + str(error))
|
||||
raise
|
||||
@@ -0,0 +1,283 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: isolated Basalt build, verification and ownership-safe removal."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import stat
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
COMMIT = '9175e7a3211bda355c02e804c7c107b15b8ea89f'
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
NAME = 'athena-basalt-build-9175e7a3211b'
|
||||
OWNER = 'athena-deck/basalt/' + COMMIT
|
||||
MARKER = '.athena-basalt-owner.json'
|
||||
|
||||
|
||||
def dump(path, data):
|
||||
path.write_text(json.dumps(data, indent=2) + '\n')
|
||||
|
||||
|
||||
def marker(root):
|
||||
info = root.lstat()
|
||||
return dict(owner=OWNER, root=str(root), device=info.st_dev, inode=info.st_ino)
|
||||
|
||||
|
||||
def validate(root, expected):
|
||||
if root != expected or root.is_symlink() or root.resolve() != expected:
|
||||
raise RuntimeError('Refusing unexpected or symlinked candidate root')
|
||||
fd = os.open(root / MARKER, os.O_RDONLY | os.O_NOFOLLOW)
|
||||
with os.fdopen(fd) as data:
|
||||
if json.load(data) != marker(root):
|
||||
raise RuntimeError('Candidate ownership marker does not match')
|
||||
prefix = str(root) + '/'
|
||||
for line in Path('/proc/self/mountinfo').read_text().splitlines():
|
||||
mount = line.split()[4]
|
||||
if mount == str(root) or mount.startswith(prefix):
|
||||
raise RuntimeError('Refusing removal while a mount is inside candidate')
|
||||
|
||||
|
||||
def remove_tree(root, expected):
|
||||
validate(root, expected)
|
||||
for item in Path('/proc').iterdir():
|
||||
if not item.name.isdigit() or int(item.name) == os.getpid():
|
||||
continue
|
||||
for kind in ('cwd', 'exe'):
|
||||
try:
|
||||
target = str((item / kind).resolve(strict=True))
|
||||
except (FileNotFoundError, PermissionError, ProcessLookupError):
|
||||
continue
|
||||
if target == str(root) or target.startswith(str(root) + '/'):
|
||||
raise RuntimeError('Refusing removal while a candidate process exists')
|
||||
if not shutil.rmtree.avoids_symlink_attacks:
|
||||
raise RuntimeError('Safe descriptor-based rmtree is unavailable')
|
||||
shutil.rmtree(root)
|
||||
assert not root.exists()
|
||||
|
||||
|
||||
def available():
|
||||
return int(next(line.split()[1] for line in Path('/proc/meminfo').read_text().splitlines()
|
||||
if line.startswith('MemAvailable:'))) / 1024
|
||||
|
||||
|
||||
def snapshot():
|
||||
base = Path('/opt/athena-deck-dev/runtime/state')
|
||||
paths = [base / name for name in ('profiles.json', 'endpoint.json', 'audio-policy.json',
|
||||
'cpu-partition.json', 'reasoning-budget.json')]
|
||||
paths += [base / 'strata-runtime/source/engine' / name for name in
|
||||
('strata', 'strata-dsv41', 'strata-vision', 'BUILD.json')]
|
||||
paths += [base / 'strata-runtime/source/serve/server.py', base / 'strata-runtime/ready.json',
|
||||
Path('/opt/athena-deck-dev/source/strata_sources.json')]
|
||||
hashes = {}
|
||||
for path in paths:
|
||||
with path.open('rb') as data:
|
||||
hashes[str(path)] = hashlib.file_digest(data, 'sha256').hexdigest()
|
||||
info = json.loads(subprocess.check_output(['docker', 'inspect', 'athena-deck-dev'], text=True))[0]
|
||||
return dict(hashes=hashes, image=info['Image'], started=info['State']['StartedAt'],
|
||||
running=info['State']['Running'], health=info['State']['Health']['Status'])
|
||||
|
||||
|
||||
def prepare():
|
||||
assert ROOT.is_dir() and not ROOT.is_symlink()
|
||||
assert {p.name for p in ROOT.iterdir()} == {'build.py', 'candidate.py'}
|
||||
assert available() >= 6144 and shutil.disk_usage(ROOT).free >= 8 * 1024 ** 3
|
||||
assert (CUDA / 'bin/nvcc').is_file()
|
||||
before = snapshot()
|
||||
assert before['running'] and before['health'] == 'healthy'
|
||||
dump(ROOT / MARKER, marker(ROOT))
|
||||
dump(ROOT / 'production-before.json', before)
|
||||
for name in ('home', 'tmp', 'cache', 'cache/pip', 'cache/hf', 'cache/cuda'):
|
||||
(ROOT / name).mkdir(parents=True, exist_ok=True)
|
||||
for current, dirs, files in os.walk(ROOT):
|
||||
os.chown(current, 65534, 65534)
|
||||
for name in files:
|
||||
os.chown(Path(current) / name, 65534, 65534)
|
||||
print(json.dumps(dict(prepared=True, root=str(ROOT), commit=COMMIT,
|
||||
activated=False, inference_performed=False)), flush=True)
|
||||
|
||||
|
||||
def owned_container(image):
|
||||
result = subprocess.run(['docker', 'inspect', NAME], capture_output=True, text=True)
|
||||
if result.returncode:
|
||||
return None
|
||||
info = json.loads(result.stdout)[0]
|
||||
assert info['Config']['Labels'].get('athena-deck.basalt-owner') == OWNER
|
||||
assert info['Image'] == image
|
||||
assert any(m['Source'] == str(ROOT) and m['RW'] for m in info['Mounts'])
|
||||
return info
|
||||
|
||||
|
||||
def run_phase(phase):
|
||||
validate(ROOT, ROOT)
|
||||
memory_gib = 2 if phase == 'check' else 3
|
||||
pids_limit = 512 if phase == 'check' else 256
|
||||
assert available() >= memory_gib * 2048, 'Insufficient headroom; production untouched'
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
assert snapshot() == before, 'Production changed; inspect instead of overwriting it'
|
||||
if owned_container(before['image']):
|
||||
raise RuntimeError('An owned container already exists; do not duplicate a build')
|
||||
command = ['docker', 'run', '--rm', '--pull=never', '--name', NAME,
|
||||
'--label', 'athena-deck.basalt-owner=' + OWNER, '--runtime', 'runc',
|
||||
'--network', 'bridge' if phase == 'bootstrap' else 'none', '--read-only',
|
||||
'--cpus', '1', '--cpu-shares', '2', '--memory', f'{memory_gib}g',
|
||||
'--memory-swap', f'{memory_gib}g',
|
||||
'--pids-limit', str(pids_limit), '--cap-drop', 'ALL', '--security-opt', 'no-new-privileges',
|
||||
'--user', '65534:65534', '--entrypoint', 'nice',
|
||||
'--mount', f'type=bind,src={ROOT},dst={ROOT}',
|
||||
'--mount', f'type=bind,src={ROOT / "tmp"},dst=/tmp',
|
||||
'--mount', f'type=bind,src={CUDA},dst={CUDA},readonly']
|
||||
env = dict(HOME=str(ROOT / 'home'), TMPDIR=str(ROOT / 'tmp'),
|
||||
XDG_CACHE_HOME=str(ROOT / 'cache'), HF_HOME=str(ROOT / 'cache/hf'),
|
||||
TORCH_HOME=str(ROOT / 'cache/torch'), CUDA_CACHE_PATH=str(ROOT / 'cache/cuda'),
|
||||
PIP_CACHE_DIR=str(ROOT / 'cache/pip'), PIP_CONFIG_FILE='/dev/null',
|
||||
PYTHONDONTWRITEBYTECODE='1', PYTHONNOUSERSITE='1', NVIDIA_VISIBLE_DEVICES='void',
|
||||
CUDA_VISIBLE_DEVICES='', OMP_NUM_THREADS='1', OPENBLAS_NUM_THREADS='1',
|
||||
GIT_CONFIG_NOSYSTEM='1', GIT_CONFIG_GLOBAL='/dev/null', GIT_TERMINAL_PROMPT='0')
|
||||
for key, value in env.items():
|
||||
command += ['-e', key + '=' + value]
|
||||
command += [before['image'], '-n', '19', 'python3', str(ROOT / 'build.py'), phase]
|
||||
process = subprocess.Popen(command)
|
||||
started = time.monotonic()
|
||||
checked = False
|
||||
try:
|
||||
while process.poll() is None:
|
||||
time.sleep(3)
|
||||
if process.poll() is not None:
|
||||
break
|
||||
if not checked:
|
||||
info = owned_container(before['image'])
|
||||
assert info and not info['HostConfig'].get('DeviceRequests')
|
||||
assert {(m['Source'], m['Destination'], m['RW']) for m in info['Mounts']} == {
|
||||
(str(ROOT), str(ROOT), True), (str(ROOT / 'tmp'), '/tmp', True),
|
||||
(str(CUDA), str(CUDA), False)}
|
||||
assert info['HostConfig']['Memory'] == memory_gib * 1024 ** 3
|
||||
assert info['HostConfig']['MemorySwap'] == memory_gib * 1024 ** 3
|
||||
assert info['HostConfig']['NanoCpus'] == 1_000_000_000
|
||||
assert info['HostConfig']['PidsLimit'] == pids_limit
|
||||
assert info['HostConfig']['ReadonlyRootfs']
|
||||
assert not any((info['NetworkSettings'].get('Ports') or {}).values())
|
||||
dump(ROOT / ('isolation-' + phase + '.json'), dict(
|
||||
verified=True, cpu_quota=1, memory_gib=memory_gib, additional_swap=0,
|
||||
pids_limit=pids_limit,
|
||||
gpu_devices=False, writable_mounts=[
|
||||
{'source': str(ROOT), 'target': str(ROOT)},
|
||||
{'source': str(ROOT / 'tmp'), 'target': '/tmp'}],
|
||||
borrowed_readonly=[str(CUDA)], network='bridge' if phase == 'bootstrap' else 'none',
|
||||
published_ports=[], shared_image=before['image']))
|
||||
print(f'Isolation checked: 1 CPU, {memory_gib} GiB RAM, no GPUs/models/ports; only candidate writable.', flush=True)
|
||||
checked = True
|
||||
if available() < 1536 or time.monotonic() - started > 2700:
|
||||
raise RuntimeError('Host headroom/time guard: stopping only owned builder')
|
||||
if process.returncode:
|
||||
raise RuntimeError('Builder client exited ' + str(process.returncode))
|
||||
finally:
|
||||
info = owned_container(before['image'])
|
||||
if info:
|
||||
if info['State']['Running']:
|
||||
subprocess.run(['docker', 'stop', '--timeout', '10', NAME], check=True)
|
||||
elif owned_container(before['image']):
|
||||
subprocess.run(['docker', 'rm', NAME], check=True)
|
||||
if process.poll() is None:
|
||||
process.wait(timeout=30)
|
||||
dump(ROOT / ('controller-' + phase + '.json'), dict(
|
||||
phase=phase, client_exit_code=process.poll(),
|
||||
seconds=time.monotonic() - started,
|
||||
owned_container_remaining=owned_container(before['image']) is not None))
|
||||
assert owned_container(before['image']) is None
|
||||
print(json.dumps(dict(phase=phase, completed=True, seconds=time.monotonic() - started)), flush=True)
|
||||
|
||||
|
||||
def rehearsal():
|
||||
fixture = ROOT / 'cleanup-rehearsal'
|
||||
sentinel = ROOT / 'cleanup-sentinel'
|
||||
assert not fixture.exists() and not sentinel.exists()
|
||||
sentinel.write_text('outside fixture, must survive')
|
||||
fixture.mkdir()
|
||||
dump(fixture / MARKER, marker(fixture))
|
||||
(fixture / 'nested').mkdir()
|
||||
(fixture / 'nested/file').write_text('synthetic disposable file')
|
||||
(fixture / 'outside-link').symlink_to(sentinel)
|
||||
remove_tree(fixture, fixture)
|
||||
assert sentinel.read_text() == 'outside fixture, must survive'
|
||||
sentinel.unlink()
|
||||
fixture.symlink_to(ROOT, target_is_directory=True)
|
||||
try:
|
||||
try:
|
||||
validate(fixture, fixture)
|
||||
except RuntimeError:
|
||||
pass
|
||||
else:
|
||||
raise AssertionError('Symlinked candidate root was accepted')
|
||||
finally:
|
||||
fixture.unlink()
|
||||
dump(ROOT / 'cleanup-selftest.json', dict(deleted_owned_fixture=True,
|
||||
external_symlink_target_preserved=True, symlink_root_rejected=True))
|
||||
|
||||
|
||||
def verify():
|
||||
validate(ROOT, ROOT)
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
assert not owned_container(before['image'])
|
||||
after = snapshot()
|
||||
assert after == before, 'Production changed; do not overwrite concurrent changes'
|
||||
built = json.loads((ROOT / 'status.json').read_text())
|
||||
assert built['phase'] == 'built and CPU-checked; awaiting separate model-test Go'
|
||||
assert built['commit'] == COMMIT and built['inference_performed'] is False
|
||||
rehearsal()
|
||||
dump(ROOT / 'verification.json', dict(production_unchanged=True, builder_removed=True,
|
||||
root=str(ROOT), cleanup_selftest=True, activated=False, inference_performed=False))
|
||||
entries = []
|
||||
for current, dirs, files in os.walk(ROOT, followlinks=False):
|
||||
dirs[:] = [d for d in dirs if d != 'vpn']
|
||||
for name in list(dirs):
|
||||
if (Path(current) / name).is_symlink():
|
||||
files.append(name)
|
||||
dirs.remove(name)
|
||||
for name in files:
|
||||
if name == 'vpn.auth' or Path(current) / name == ROOT / 'manifest.json':
|
||||
continue
|
||||
path = Path(current) / name
|
||||
info = path.lstat()
|
||||
item = dict(path=str(path.relative_to(ROOT)), bytes=info.st_size)
|
||||
if stat.S_ISREG(info.st_mode):
|
||||
with path.open('rb') as data:
|
||||
item['sha256'] = hashlib.file_digest(data, 'sha256').hexdigest()
|
||||
else:
|
||||
item['symlink'] = stat.S_ISLNK(info.st_mode)
|
||||
entries.append(item)
|
||||
dump(ROOT / 'manifest.json', dict(owner=OWNER, root=str(ROOT), files=entries,
|
||||
self_excluded='manifest.json', borrowed_not_owned=[str(CUDA), before['image']],
|
||||
created_images=[], created_volumes=[], installed_host_packages=[]))
|
||||
print(json.dumps(dict(verified=True, files=len(entries), bytes=sum(i['bytes'] for i in entries),
|
||||
production_unchanged=True, cleanup_rehearsal=True)), flush=True)
|
||||
|
||||
|
||||
def cleanup(apply):
|
||||
validate(ROOT, ROOT)
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
if owned_container(before['image']):
|
||||
raise RuntimeError('Refusing cleanup while any candidate container exists')
|
||||
if not apply:
|
||||
print(json.dumps(dict(dry_run=True, delete_only=str(ROOT),
|
||||
preserve=[str(CUDA), before['image']], services_to_stop=[])))
|
||||
return
|
||||
remove_tree(ROOT, ROOT)
|
||||
print(json.dumps(dict(removed=str(ROOT), exists=ROOT.exists(),
|
||||
shared_resources_removed=False)), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('action', choices=['prepare', 'bootstrap', 'build', 'check', 'verify', 'cleanup'])
|
||||
parser.add_argument('--apply', action='store_true', help='Actually remove only the owned candidate')
|
||||
args = parser.parse_args()
|
||||
if args.action in ('bootstrap', 'build', 'check'):
|
||||
run_phase(args.action)
|
||||
elif args.action == 'cleanup':
|
||||
cleanup(args.apply)
|
||||
else:
|
||||
globals()[args.action]()
|
||||
@@ -0,0 +1,248 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Same synthetic near-limit conversation workload for Basalt and current Strata.
|
||||
|
||||
Basalt: inside own isolated GPU container. Strata: native Athena host, existing
|
||||
managed API credential received on stdin only. Stops only its own HTTP sockets.
|
||||
No service/model/profile mutation. Separate fresh Go and deadline required.
|
||||
"""
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import http.client
|
||||
import json
|
||||
from pathlib import Path
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from typing import Any
|
||||
from urllib.parse import quote
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
FINAL = 64132
|
||||
OUTPUT = 96
|
||||
|
||||
|
||||
def overlaps(rows):
|
||||
if len(rows) != 2 or any(r.get('first_content_at') is None or r.get('finished_at') is None for r in rows):
|
||||
return 0.0
|
||||
return max(0.0, min(r['finished_at'] for r in rows) - max(r['first_content_at'] for r in rows))
|
||||
|
||||
|
||||
def slower_budget(reference):
|
||||
assert reference > 0
|
||||
return reference * 1.15 + 2.0
|
||||
|
||||
|
||||
def make_body(model, messages, maximum):
|
||||
# Deck rejects a numeric zero budget before applying the none effort.
|
||||
return dict(model=model, messages=messages, max_tokens=maximum, temperature=0,
|
||||
seed=42, reasoning_effort='none', stream=True,
|
||||
stream_options={'include_usage': True})
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--engine', required=True, choices=['basalt', 'strata'])
|
||||
parser.add_argument('--deadline', required=True, type=float)
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Fresh explicit Michael benchmark/model-switch Go required')
|
||||
assert time.time() < args.deadline <= time.time() + 2100
|
||||
basalt = args.engine == 'basalt'
|
||||
key = '' if basalt else json.load(sys.stdin)['key']
|
||||
assert basalt or (isinstance(key, str) and key)
|
||||
port = 18320 if basalt else 8120
|
||||
model = 'athena-basalt-iq3xxs-test' if basalt else 'flash-next-strata-iq3-dual'
|
||||
path = ROOT / ('chat64-' + args.engine + '.json')
|
||||
assert not path.exists(), 'Do not silently repeat a benchmark'
|
||||
docs = json.loads((ROOT / 'chat64-fixtures.json').read_text())
|
||||
assert len(docs) == 2 and all(d['initial_tokens'] == 64000 and d['final_tokens'] == FINAL for d in docs)
|
||||
early = None
|
||||
# Both small-chat arms finish; do not stop before the output comparison.
|
||||
started = time.monotonic()
|
||||
stop = threading.Event()
|
||||
lock = threading.RLock()
|
||||
sockets: set[Any] = set()
|
||||
result: dict[str, Any] = dict(engine=args.engine, started_at=time.time(), deadline=args.deadline,
|
||||
context_per_slot=262144, initial_tokens=64000, final_tokens=FINAL, output_tokens=OUTPUT,
|
||||
requests=[], snapshots=[], groups=[], work_complete=False, passed=False, early_stop_budget=early)
|
||||
|
||||
def save():
|
||||
with lock:
|
||||
result['elapsed_seconds'] = time.monotonic() - started
|
||||
temporary = path.with_suffix('.pending')
|
||||
temporary.write_text(json.dumps(result, ensure_ascii=False, indent=2) + '\n')
|
||||
temporary.replace(path)
|
||||
|
||||
def headers():
|
||||
return {'Content-Type': 'application/json', **({'Authorization': 'Bearer ' + key} if key else {})}
|
||||
|
||||
def get(route):
|
||||
conn = http.client.HTTPConnection('127.0.0.1', port, timeout=3)
|
||||
try:
|
||||
conn.request('GET', route, headers=headers())
|
||||
response = conn.getresponse()
|
||||
assert response.status == 200, ('Telemetry HTTP', response.status)
|
||||
return json.loads(response.read())
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def cancel(reason):
|
||||
with lock:
|
||||
if result['work_complete'] or stop.is_set():
|
||||
return
|
||||
result['stop_reason'] = reason
|
||||
if reason == 'strata_proven_slower_total_work_lower_bound':
|
||||
result['strata_elapsed_lower_bound_seconds'] = time.monotonic() - started
|
||||
stop.set()
|
||||
owned = list(sockets)
|
||||
save()
|
||||
for sock in owned:
|
||||
try:
|
||||
sock.shutdown(socket.SHUT_RDWR)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def watch():
|
||||
last_save = 0.0
|
||||
while not stop.wait(0.5):
|
||||
elapsed = time.monotonic() - started
|
||||
if time.time() >= args.deadline:
|
||||
cancel('hard_benchmark_deadline')
|
||||
break
|
||||
if early is not None and elapsed > early:
|
||||
cancel('strata_proven_slower_total_work_lower_bound')
|
||||
break
|
||||
if elapsed - last_save >= 5:
|
||||
last_save = elapsed
|
||||
try:
|
||||
sample = get('/slots' if basalt else '/v1/telemetry/speed')
|
||||
with lock:
|
||||
result['snapshots'].append(dict(at=time.time(), data=sample))
|
||||
except (OSError, ValueError, AssertionError, http.client.HTTPException):
|
||||
pass
|
||||
save()
|
||||
|
||||
def request(document, phase, maximum, barrier=None):
|
||||
if barrier:
|
||||
barrier.wait(timeout=10)
|
||||
if stop.is_set():
|
||||
raise RuntimeError('Benchmark stopped before admission')
|
||||
messages = document['initial' if phase == 'preload' else 'final']
|
||||
expected = document['initial_tokens'] if phase == 'preload' else (FINAL if phase == 'chat-1' else None)
|
||||
row: dict[str, Any] = dict(tag=document['tag'], phase=phase, maximum=maximum,
|
||||
started_at=time.monotonic() - started, first_content_at=None, finished_at=None,
|
||||
content='', usage={}, timings={}, stream_complete=False)
|
||||
with lock:
|
||||
result['requests'].append(row)
|
||||
save()
|
||||
conn = http.client.HTTPConnection('127.0.0.1', port,
|
||||
timeout=max(1, min(900, args.deadline - time.time())))
|
||||
raw_socket = None
|
||||
body = make_body(model, messages, maximum)
|
||||
try:
|
||||
conn.request('POST', '/v1/chat/completions', body=json.dumps(body).encode(), headers=headers())
|
||||
raw_socket = conn.sock
|
||||
with lock:
|
||||
sockets.add(raw_socket)
|
||||
if stop.is_set():
|
||||
cancel('benchmark_stopped')
|
||||
raise RuntimeError('Benchmark stopped')
|
||||
response = conn.getresponse()
|
||||
if response.status != 200:
|
||||
raise RuntimeError('HTTP ' + str(response.status) + ': ' + response.read().decode()[:2000])
|
||||
while not stop.is_set():
|
||||
line = response.readline()
|
||||
if not line:
|
||||
break
|
||||
if not line.startswith(b'data:'):
|
||||
continue
|
||||
raw = line[5:].strip()
|
||||
if raw == b'[DONE]':
|
||||
with lock:
|
||||
row['stream_complete'] = True
|
||||
break
|
||||
item = json.loads(raw)
|
||||
if 'error' in item:
|
||||
raise RuntimeError(str(item['error']))
|
||||
with lock:
|
||||
row['usage'] = item.get('usage') or row['usage']
|
||||
row['timings'] = item.get('timings') or item.get('backend_timings') or row['timings']
|
||||
for choice in item.get('choices', []):
|
||||
text = choice.get('delta', {}).get('content') or ''
|
||||
if text and row['first_content_at'] is None:
|
||||
row['first_content_at'] = time.monotonic() - started
|
||||
save()
|
||||
row['content'] += text
|
||||
if choice.get('finish_reason'):
|
||||
row['finish_reason'] = choice['finish_reason']
|
||||
if not stop.is_set():
|
||||
assert row['stream_complete'], 'Incomplete real response'
|
||||
actual = row['usage'].get('prompt_tokens', 0)
|
||||
assert (actual == expected if expected is not None else 64000 <= actual < 65536), ('Actual token count', row['usage'])
|
||||
if phase == 'preload':
|
||||
assert row['content'].strip() == 'OK', ('Unexpected preload reply', row['content'])
|
||||
else:
|
||||
assert 0 < row['usage'].get('completion_tokens', 0) <= OUTPUT, ('Invalid short output', row['usage'])
|
||||
return row
|
||||
except Exception as exc:
|
||||
with lock:
|
||||
row['error'] = type(exc).__name__ + ': ' + str(exc)
|
||||
if not stop.is_set():
|
||||
cancel('request_failed')
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
with lock:
|
||||
sockets.discard(raw_socket)
|
||||
row['finished_at'] = time.monotonic() - started
|
||||
save() # Preserve this response even when the other never finishes.
|
||||
|
||||
worker = threading.Thread(target=watch, daemon=True)
|
||||
try:
|
||||
route = '/props' if basalt else '/props?model=' + quote(model)
|
||||
props = get(route)
|
||||
assert props['total_slots'] == 2 and props['default_generation_settings']['n_ctx'] == 262144
|
||||
result['verified_properties'] = {k: props[k] for k in ('total_slots', 'default_generation_settings')}
|
||||
save()
|
||||
worker.start()
|
||||
for doc in docs:
|
||||
request(doc, 'preload', 16)
|
||||
result['preload_seconds'] = time.monotonic() - started
|
||||
save()
|
||||
questions = [
|
||||
'Erkläre kurz den Unterschied zwischen einem Backup und einer Synchronisierung. Höchstens drei Sätze.',
|
||||
'Was sollte ich beim Wiederherstellen einer Sicherung zuerst prüfen? Höchstens drei Sätze.']
|
||||
for round_index in range(3):
|
||||
barrier = threading.Barrier(2)
|
||||
parallel_start = time.monotonic()
|
||||
phase = 'chat-' + str(round_index + 1)
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
|
||||
jobs = [pool.submit(request, doc, phase, OUTPUT, barrier) for doc in docs]
|
||||
rows = [job.result() for job in jobs]
|
||||
wall = time.monotonic() - parallel_start
|
||||
result['groups'].append(dict(phase=phase, wall_seconds=wall,
|
||||
overlap_seconds=overlaps(rows), output_tokens=sum(r['usage']['completion_tokens'] for r in rows)))
|
||||
for doc, row in zip(docs, rows):
|
||||
if round_index == 0:
|
||||
assert 'C64_' + doc['tag'] in row['content'], 'Wrong conversation marker'
|
||||
if round_index < 2:
|
||||
doc['final'] += [dict(role='assistant', content=row['content'], reasoning_content=''),
|
||||
dict(role='user', content=questions[round_index])]
|
||||
save()
|
||||
result['work_seconds'] = time.monotonic() - started
|
||||
result['work_complete'] = True
|
||||
result['passed'] = len(result['requests']) == 8 and all(r['stream_complete'] for r in result['requests'])
|
||||
except Exception as exc:
|
||||
result['error'] = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
stop.set()
|
||||
if worker.is_alive():
|
||||
worker.join(timeout=5)
|
||||
save()
|
||||
print(json.dumps({k: v for k, v in result.items() if k not in ('requests', 'snapshots')}, ensure_ascii=False), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: one explicitly authorized test after normal authenticated drain.
|
||||
|
||||
Never stops/starts Deck or production models. The operator must restore normal
|
||||
production immediately after this worker returns, including on failure.
|
||||
"""
|
||||
import argparse
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
GPU = 'GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe'
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
if not parser.parse_args().go:
|
||||
parser.error('Explicit Michael model-switch/test Go required')
|
||||
spec = importlib.util.spec_from_file_location('candidate', ROOT / 'candidate.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
owner = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(owner)
|
||||
owner.validate(ROOT, ROOT)
|
||||
window = json.loads((ROOT / 'chat64-window.json').read_text())
|
||||
drained = json.loads((ROOT / 'chat64-drained.json').read_text())
|
||||
assert time.time() - drained['checked_at'] < 45
|
||||
assert drained['state'] == 'stopped' and drained['active_requests'] == 0
|
||||
assert all(type(drained['scheduler'][key]) is int and drained['scheduler'][key] == 0
|
||||
for key in ('active_requests', 'waiting_requests', 'tts_waiting_requests'))
|
||||
assert not drained['scheduler']['switching']
|
||||
assert not Path('/opt/athena-deck-dev/runtime/state/strata-worker/worker.json').exists()
|
||||
assert not subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
|
||||
'--format=csv,noheader,nounits'], text=True).strip()
|
||||
before = json.loads((ROOT / 'chat64-before.json').read_text())
|
||||
current = owner.snapshot()
|
||||
assert before['image'] == current['image'] and before['started'] == current['started']
|
||||
assert not owner.owned_container(before['image'])
|
||||
assert time.time() + 60 < window['test_deadline']
|
||||
production = json.loads(subprocess.check_output(['docker', 'inspect', 'athena-deck-dev'], text=True))[0]
|
||||
command = ['docker', 'run', '--rm', '--pull=never', '--name', owner.NAME,
|
||||
'--label', 'athena-deck.basalt-owner=' + owner.OWNER,
|
||||
'--runtime', production['HostConfig']['Runtime'], '--gpus', 'device=' + GPU,
|
||||
'--network', 'none', '--read-only', '--user', '65534:65534', '--cap-drop', 'ALL',
|
||||
'--security-opt', 'no-new-privileges', '--cpus', '12', '--cpuset-cpus', '0,1,2,3,6,7,8,9',
|
||||
'--memory', '52g', '--memory-swap', '52g', '--pids-limit', '512',
|
||||
'--ulimit', 'memlock=-1:-1', '--mount', f'type=bind,src={ROOT},dst={ROOT}',
|
||||
'--mount', f'type=bind,src={ROOT / "tmp"},dst=/tmp',
|
||||
'--mount', f'type=bind,src={CUDA},dst={CUDA},readonly',
|
||||
'-e', 'CUDA_VISIBLE_DEVICES=' + GPU, '-e', 'NVIDIA_VISIBLE_DEVICES=' + GPU,
|
||||
'-e', 'NVIDIA_DRIVER_CAPABILITIES=compute,utility', '-e', 'HOME=' + str(ROOT / 'home'),
|
||||
'-e', 'TMPDIR=' + str(ROOT / 'tmp'), '-e', 'CUDA_CACHE_PATH=' + str(ROOT / 'cache/cuda'),
|
||||
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'OPENBLAS_NUM_THREADS=1', '-e', 'OMP_NUM_THREADS=1',
|
||||
'--entrypoint', str(ROOT / 'venv/bin/python'), before['image'], '-B',
|
||||
str(ROOT / 'chat64_runner.py'), '--go', '--deadline', str(window['test_deadline'])]
|
||||
error = None
|
||||
with (ROOT / 'chat64-host.log').open('w') as log:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
try:
|
||||
while process.poll() is None:
|
||||
if time.time() >= window['test_deadline']:
|
||||
raise TimeoutError('Test budget reached; stop only owned test and restore original')
|
||||
if owner.available() < 1536:
|
||||
raise RuntimeError('Host RAM headroom guard; restore original')
|
||||
time.sleep(2)
|
||||
except BaseException as exc:
|
||||
error = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
instance = owner.owned_container(before['image'])
|
||||
if instance:
|
||||
action = ['docker', 'stop', '--timeout', '10'] if instance['State']['Running'] else ['docker', 'rm']
|
||||
subprocess.run(action + [instance['Id']], check=True, stdout=log, stderr=log)
|
||||
if process.poll() is None:
|
||||
process.wait(timeout=30)
|
||||
remaining = owner.owned_container(before['image'])
|
||||
assert remaining is None
|
||||
result = dict(client_exit_code=process.returncode, error=error, test_finished=time.time(),
|
||||
owned_container_removed=True, production_restore_required=True)
|
||||
path = ROOT / 'chat64-host-exit.json'
|
||||
path.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == result
|
||||
print(json.dumps(result), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Owned CPU-only container: create identical real-tokenized conversation fixtures.
|
||||
|
||||
No engine/model inference. Preserve assistant history so held slot prefixes
|
||||
are genuine prefixes, instead of replaying a whole prompt with a one-token cap.
|
||||
"""
|
||||
import importlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
INITIAL = 64000
|
||||
FINAL = 64132
|
||||
OUTPUT = 96
|
||||
SLACK = 8
|
||||
|
||||
|
||||
def main():
|
||||
sys.path[:0] = [str(ROOT / 'source'), str(ROOT / 'source/tools')]
|
||||
ST = importlib.import_module('tokenizer')
|
||||
ModelFile = importlib.import_module('model_file').ModelFile
|
||||
extract = importlib.import_module('serve.engine.modelfile').extract_tokenizer
|
||||
Template = importlib.import_module('serve.frontend').ChatTemplate
|
||||
Service = importlib.import_module('serve.service').Service
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
directory = extract(ModelFile(ROOT / 'models' / source['filename']))
|
||||
vocab = json.loads((directory / 'vocab.json').read_text())
|
||||
tokens = [None] * len(vocab)
|
||||
for text, index in vocab.items():
|
||||
tokens[index] = text
|
||||
tok = ST.Tokenizer(tokens, (directory / 'merges.txt').read_text().split('\n'),
|
||||
json.loads((directory / 'token_type.json').read_text()))
|
||||
template = directory / 'chat_template.jinja'
|
||||
assert template.is_file()
|
||||
svc = Service(SimpleNamespace(max_context=262144), tok, Template(template))
|
||||
|
||||
def encode(messages):
|
||||
return svc.encode_prompt(messages, None, {'enable_thinking': False})
|
||||
|
||||
def pad(make, target, estimate=0):
|
||||
ids = []
|
||||
for n in range(max(0, estimate - 3), estimate + 5):
|
||||
messages = make(n)
|
||||
ids = encode(messages)
|
||||
if len(ids) == target:
|
||||
return messages, ids
|
||||
raise AssertionError(('No exact token padding', target, len(ids)))
|
||||
|
||||
docs = []
|
||||
for tag in ('A', 'B'):
|
||||
rows = [f'Archiv CHAT64_{tag} Zeile {n:05d}: Standort '
|
||||
f'{"West" if tag == "A" else "Ost"}, Bauteil {(n * 71 + 19) % 10007:05d}, '
|
||||
'Freigabe dokumentiert.\n' for n in range(15000)]
|
||||
|
||||
def initial(count, padding=0):
|
||||
return [{'role': 'system', 'content': f'Unabhängiges Gespräch CHAT64_{tag}. Kennung C64_{tag}. Lies nur dein Archiv.'},
|
||||
{'role': 'user', 'content': ''.join(rows[:count]) + ' x' * padding +
|
||||
'\nBestätige den Empfang. Antworte ausschließlich mit OK, ohne Satzzeichen.'}]
|
||||
|
||||
low, high = 0, len(rows)
|
||||
while low < high:
|
||||
middle = (low + high + 1) // 2
|
||||
if len(encode(initial(middle))) <= INITIAL:
|
||||
low = middle
|
||||
else:
|
||||
high = middle - 1
|
||||
count = low
|
||||
base, before = pad(lambda n: initial(count, n), INITIAL,
|
||||
INITIAL - len(encode(initial(count))))
|
||||
history = base + [{'role': 'assistant', 'content': 'OK', 'reasoning_content': ''}]
|
||||
|
||||
def follow(padding):
|
||||
return history + [{'role': 'user', 'content': ' x' * padding +
|
||||
'\nAntworte mit höchstens '
|
||||
'drei kurzen Sätzen: Nenne deine Archivkennung und einen Tipp zur Datensicherung.'}]
|
||||
|
||||
final, after = pad(follow, FINAL, FINAL - len(encode(follow(0))))
|
||||
held = before + tok.encode('OK')
|
||||
common = 0
|
||||
for a, b in zip(held, after):
|
||||
if a != b:
|
||||
break
|
||||
common += 1
|
||||
# Exact assertion: next request extends the whole held prompt+answer.
|
||||
assert common == len(held), (tag, common, len(held))
|
||||
assert FINAL + OUTPUT + SLACK < 65536
|
||||
docs.append(dict(tag=tag, initial=base, final=final, initial_tokens=len(before),
|
||||
final_tokens=len(after), held_prefix_tokens=common,
|
||||
expected_initial_answer='OK', output_tokens=OUTPUT))
|
||||
target = ROOT / 'chat64-fixtures.json'
|
||||
assert not target.exists(), 'Preserve previously prepared fixture'
|
||||
target.write_text(json.dumps(docs, ensure_ascii=False) + '\n')
|
||||
assert json.loads(target.read_text()) == docs
|
||||
report = dict(inference=False, prepared=True, source='actual pinned tokenizer and chat template',
|
||||
initial_tokens=INITIAL, final_tokens=FINAL, output_tokens=OUTPUT, slack=SLACK,
|
||||
held_prefix_tokens=[d['held_prefix_tokens'] for d in docs])
|
||||
(ROOT / 'chat64-fixtures-proof.json').write_text(json.dumps(report, indent=2) + '\n')
|
||||
print(json.dumps(report), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside a future isolated GPU test container, only after separate Michael Go.
|
||||
|
||||
No production API, model stop/start or profile mutation is implemented here.
|
||||
The operator must drain/stop the original model beforehand and restore it after
|
||||
this process exits. The absolute deadline leaves the outer restoration reserve.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float, help='Absolute epoch deadline before restoration reserve')
|
||||
args = parser.parse_args()
|
||||
if not args.go or args.deadline is None:
|
||||
parser.error('Explicit Michael model-switch/test Go and absolute deadline required')
|
||||
assert time.time() < args.deadline <= time.time() + 1200
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
proof = json.loads((ROOT / 'model-verification.json').read_text())
|
||||
assert json.loads((ROOT / 'model-download.json').read_text())['state'] == 'verified'
|
||||
assert proof['sha256'] == source['sha256'] and proof['header_readable_by_pinned_build']
|
||||
assert (ROOT / 'models' / source['filename']).stat().st_size == source['size']
|
||||
assert not (ROOT / 'chat64-basalt.json').exists(), 'Never silently repeat a test'
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=args.deadline,
|
||||
production_modified_by_runner=False, passed=False)
|
||||
record = ROOT / 'chat64-runner-status.json'
|
||||
|
||||
def save(phase):
|
||||
result['phase'] = phase
|
||||
result['updated'] = time.time()
|
||||
record.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(record.read_text()) == result
|
||||
|
||||
save('loading one candidate; no production routes')
|
||||
python = ROOT / 'venv/bin/python'
|
||||
command = [ROOT / 'source/bin/basalt', 'serve', '--python', python,
|
||||
'--config', ROOT / 'test-config.json']
|
||||
with (ROOT / 'chat64-server.log').open('w') as output:
|
||||
server = subprocess.Popen(list(map(str, command)), cwd=ROOT / 'source',
|
||||
stdout=output, stderr=subprocess.STDOUT, start_new_session=True)
|
||||
try:
|
||||
load_deadline = min(args.deadline - 20, time.time() + 240)
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError('Owned Basalt server exited during load; inspect own server log')
|
||||
if time.time() >= load_deadline:
|
||||
raise TimeoutError('Load budget expired; restore original runtime')
|
||||
try:
|
||||
with urllib.request.urlopen('http://127.0.0.1:18320/props', timeout=2) as response:
|
||||
props = json.load(response)
|
||||
if not props['is_sleeping']:
|
||||
assert props['model_alias'] == 'athena-basalt-iq3xxs-test'
|
||||
assert props['total_slots'] == 2
|
||||
assert props['default_generation_settings']['n_ctx'] == 262144
|
||||
break
|
||||
except (OSError, urllib.error.URLError, KeyError):
|
||||
pass
|
||||
time.sleep(0.5)
|
||||
result['load_seconds'] = time.time() - result['started']
|
||||
save('short synthetic client; no tools executed')
|
||||
remaining = min(900, args.deadline - time.time() - 20)
|
||||
if remaining <= 0:
|
||||
raise TimeoutError('No test budget remains; restore original runtime')
|
||||
with (ROOT / 'chat64-client.log').open('w') as output:
|
||||
completed = subprocess.run([str(python), str(ROOT / 'chat64_client.py'), '--go', '--engine', 'basalt', '--deadline', str(args.deadline)],
|
||||
cwd=ROOT, stdout=output, stderr=subprocess.STDOUT, timeout=remaining)
|
||||
assert completed.returncode == 0
|
||||
result['capacity_test'] = json.loads((ROOT / 'chat64-basalt.json').read_text())['passed']
|
||||
result['passed'] = True
|
||||
except BaseException as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
if server.poll() is None:
|
||||
os.killpg(server.pid, signal.SIGTERM)
|
||||
try:
|
||||
server.wait(timeout=15)
|
||||
except subprocess.TimeoutExpired:
|
||||
os.killpg(server.pid, signal.SIGKILL)
|
||||
server.wait(timeout=5)
|
||||
result['server_exit_code'] = server.poll()
|
||||
save('candidate stopped; outer operator must restore original Strata/Qwen')
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS Hermes profile transport, run with existing /opt/hermes Python environment.
|
||||
|
||||
Resolves only this profile's managed Athena API identity in memory. Never logs
|
||||
or stores a credential. Does not stop/start services or change Hermes settings.
|
||||
"""
|
||||
import argparse
|
||||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import urllib.request
|
||||
|
||||
PROFILE = Path('/opt/data/profiles/athena-deck')
|
||||
ROOT = '/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/'
|
||||
|
||||
|
||||
def key():
|
||||
from hermes_constants import set_hermes_home_override, reset_hermes_home_override
|
||||
from agent.secret_scope import build_profile_secret_scope, set_secret_scope, reset_secret_scope
|
||||
from hermes_cli.runtime_provider import resolve_runtime_provider
|
||||
logging.disable(logging.CRITICAL)
|
||||
home = set_hermes_home_override(PROFILE)
|
||||
scope = set_secret_scope(build_profile_secret_scope(PROFILE), profile_home=str(PROFILE))
|
||||
try:
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
route = resolve_runtime_provider(requested='Athena')
|
||||
assert route['base_url'].rstrip('/') == 'http://192.168.1.212:8120/v1'
|
||||
value = route['api_key']
|
||||
assert isinstance(value, str) and value
|
||||
return value
|
||||
finally:
|
||||
reset_secret_scope(scope)
|
||||
reset_hermes_home_override(home)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('mode', choices=['probe', 'strata'])
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float)
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Explicit current Michael comparison Go required')
|
||||
credential = key()
|
||||
if args.mode == 'probe':
|
||||
request = urllib.request.Request('http://192.168.1.212:8120/props?model=flash-next-strata-iq3-dual',
|
||||
headers={'Authorization': 'Bearer ' + credential})
|
||||
with urllib.request.urlopen(request, timeout=10) as response:
|
||||
data = json.load(response)
|
||||
assert data['total_slots'] == 2 and data['default_generation_settings']['n_ctx'] == 262144
|
||||
print(json.dumps(dict(managed_route_verified=True, slots=data['total_slots'],
|
||||
context_per_slot=data['default_generation_settings']['n_ctx'])))
|
||||
return
|
||||
if args.deadline is None:
|
||||
parser.error('Absolute benchmark deadline required')
|
||||
command = ['python3', '-B', ROOT + 'chat64_client.py', '--engine', 'strata', '--go',
|
||||
'--deadline', str(args.deadline)]
|
||||
process = subprocess.run(['athena-ssh', shlex.join(command)],
|
||||
input=json.dumps({'key': credential}), text=True, check=False)
|
||||
raise SystemExit(process.returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,567 @@
|
||||
{
|
||||
"engine": "basalt",
|
||||
"started_at": 1793557462.294389,
|
||||
"deadline": 1793557776.9458838,
|
||||
"context_per_slot": 262144,
|
||||
"initial_tokens": 64000,
|
||||
"final_tokens": 64132,
|
||||
"output_tokens": 96,
|
||||
"requests": [
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 0.001532124006189406,
|
||||
"first_content_at": 12.715202102030162,
|
||||
"finished_at": 12.85296395001933,
|
||||
"content": "OK",
|
||||
"usage": {
|
||||
"prompt_tokens": 64000,
|
||||
"completion_tokens": 2,
|
||||
"total_tokens": 64002,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 64000,
|
||||
"prompt_ms": 12561.3,
|
||||
"prompt_per_token_ms": 0.196,
|
||||
"prompt_per_second": 5095.0,
|
||||
"predicted_n": 2,
|
||||
"predicted_ms": 253.6,
|
||||
"predicted_per_token_ms": 126.8,
|
||||
"predicted_per_second": 7.9,
|
||||
"draft_n": 6,
|
||||
"draft_n_accepted": 4
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 12.853533458022866,
|
||||
"first_content_at": 25.53226997400634,
|
||||
"finished_at": 25.668286777974572,
|
||||
"content": "OK",
|
||||
"usage": {
|
||||
"prompt_tokens": 64000,
|
||||
"completion_tokens": 2,
|
||||
"total_tokens": 64002,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 64000,
|
||||
"prompt_ms": 12529.2,
|
||||
"prompt_per_token_ms": 0.196,
|
||||
"prompt_per_second": 5108.1,
|
||||
"predicted_n": 2,
|
||||
"predicted_ms": 247.7,
|
||||
"predicted_per_token_ms": 123.85,
|
||||
"predicted_per_second": 8.1,
|
||||
"draft_n": 6,
|
||||
"draft_n_accepted": 4
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-1",
|
||||
"maximum": 96,
|
||||
"started_at": 25.670966654026415,
|
||||
"first_content_at": 26.348662709991913,
|
||||
"finished_at": 28.32051724998746,
|
||||
"content": "Meine Archivkennung ist C64_B. Sichern Sie Ihre Daten regelmäßig auf redundanten Medien. Testen Sie die Wiederherstellung Ihrer Backups.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64132,
|
||||
"completion_tokens": 34,
|
||||
"total_tokens": 64166,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 63993
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 63993,
|
||||
"prompt_n": 139,
|
||||
"prompt_ms": 456.0,
|
||||
"prompt_per_token_ms": 3.281,
|
||||
"prompt_per_second": 304.8,
|
||||
"predicted_n": 34,
|
||||
"predicted_ms": 1949.1,
|
||||
"predicted_per_token_ms": 59.064,
|
||||
"predicted_per_second": 16.9,
|
||||
"draft_n": 24,
|
||||
"draft_n_accepted": 14
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-1",
|
||||
"maximum": 96,
|
||||
"started_at": 25.671330476994626,
|
||||
"first_content_at": 27.130294386006426,
|
||||
"finished_at": 28.407049151021056,
|
||||
"content": "Meine Archivkennung ist C64_A. Sichern Sie Ihre Daten regelmäßig auf redundanten Medien. Testen Sie die Wiederherstellung Ihrer Backups.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64132,
|
||||
"completion_tokens": 34,
|
||||
"total_tokens": 64166,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 63993
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 63993,
|
||||
"prompt_n": 139,
|
||||
"prompt_ms": 624.5,
|
||||
"prompt_per_token_ms": 4.493,
|
||||
"prompt_per_second": 222.6,
|
||||
"predicted_n": 34,
|
||||
"predicted_ms": 1270.5,
|
||||
"predicted_per_token_ms": 37.368,
|
||||
"predicted_per_second": 26.8,
|
||||
"draft_n": 28,
|
||||
"draft_n_accepted": 16
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-2",
|
||||
"maximum": 96,
|
||||
"started_at": 28.408301139017567,
|
||||
"first_content_at": 29.293875418021344,
|
||||
"finished_at": 30.82116999401478,
|
||||
"content": "Ein Backup ist eine punktuell erstellte Kopie zur Wiederherstellung nach Datenverlust. Eine Synchronisierung hält zwei Speicherorte durch ständige Angleichung aktuell. Backups schützen vor Fehlern, Synchronisierung dient der Konsistenz.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64200,
|
||||
"completion_tokens": 51,
|
||||
"total_tokens": 64251,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64165
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64165,
|
||||
"prompt_n": 35,
|
||||
"prompt_ms": 173.4,
|
||||
"prompt_per_token_ms": 4.954,
|
||||
"prompt_per_second": 201.8,
|
||||
"predicted_n": 51,
|
||||
"predicted_ms": 15.3,
|
||||
"predicted_per_token_ms": 15.3,
|
||||
"predicted_per_second": 65.4,
|
||||
"draft_n": 36,
|
||||
"draft_n_accepted": 17
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-2",
|
||||
"maximum": 96,
|
||||
"started_at": 28.408586785022635,
|
||||
"first_content_at": 28.93144909699913,
|
||||
"finished_at": 30.70761131698964,
|
||||
"content": "Ein Backup ist eine punktuell erstellte Kopie zur Wiederherstellung nach Datenverlust. Eine Synchronisierung hält zwei Speicherorte permanent auf dem gleichen Stand. Backups schützen vor Fehlern, Synchronisierung dient der aktuellen Verfügbarkeit.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64200,
|
||||
"completion_tokens": 49,
|
||||
"total_tokens": 64249,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64165
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64165,
|
||||
"prompt_n": 35,
|
||||
"prompt_ms": 348.3,
|
||||
"prompt_per_token_ms": 9.951,
|
||||
"prompt_per_second": 100.5,
|
||||
"predicted_n": 49,
|
||||
"predicted_ms": 1708.9,
|
||||
"predicted_per_token_ms": 35.602,
|
||||
"predicted_per_second": 28.1,
|
||||
"draft_n": 34,
|
||||
"draft_n_accepted": 15
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-3",
|
||||
"maximum": 96,
|
||||
"started_at": 30.823096677020658,
|
||||
"first_content_at": 31.326216162997298,
|
||||
"finished_at": 32.835196643020026,
|
||||
"content": "Prüfen Sie zuerst die Integrität und Vollständigkeit der Sicherungsdateien. Stellen Sie sicher, dass die Wiederherstellung in einer isolierten Umgebung erfolgt. Verifizieren Sie die Daten nach der Wiederherstellung auf Korrektheit.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64283,
|
||||
"completion_tokens": 52,
|
||||
"total_tokens": 64335,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64250
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64250,
|
||||
"prompt_n": 33,
|
||||
"prompt_ms": 318.0,
|
||||
"prompt_per_token_ms": 9.636,
|
||||
"prompt_per_second": 103.8,
|
||||
"predicted_n": 52,
|
||||
"predicted_ms": 1482.2,
|
||||
"predicted_per_token_ms": 29.063,
|
||||
"predicted_per_second": 34.4,
|
||||
"draft_n": 47,
|
||||
"draft_n_accepted": 26
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-3",
|
||||
"maximum": 96,
|
||||
"started_at": 30.82358716701856,
|
||||
"first_content_at": 31.823037096997723,
|
||||
"finished_at": 32.93590869702166,
|
||||
"content": "Prüfen Sie zuerst die Integrität und Vollständigkeit der Sicherungsdateien. Stellen Sie sicher, dass die Wiederherstellung in einer isolierten Umgebung erfolgt. Verifizieren Sie die Daten nach der Wiederherstellung auf Korrektheit.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64281,
|
||||
"completion_tokens": 52,
|
||||
"total_tokens": 64333,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64248
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64248,
|
||||
"prompt_n": 33,
|
||||
"prompt_ms": 376.6,
|
||||
"prompt_per_token_ms": 11.412,
|
||||
"prompt_per_second": 87.6,
|
||||
"predicted_n": 52,
|
||||
"predicted_ms": 14.7,
|
||||
"predicted_per_token_ms": 14.7,
|
||||
"predicted_per_second": 68.0,
|
||||
"draft_n": 40,
|
||||
"draft_n_accepted": 29
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
}
|
||||
],
|
||||
"snapshots": [
|
||||
{
|
||||
"at": 1793557467.2975435,
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "prefill",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": 16,
|
||||
"prompt_tokens": 64000,
|
||||
"prefill_done": 24304,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 64000,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"at": 1793557472.2997837,
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "prefill",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": 16,
|
||||
"prompt_tokens": 64000,
|
||||
"prefill_done": 51027,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 64000,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"at": 1793557477.302146,
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "prefill",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": 16,
|
||||
"prompt_tokens": 64000,
|
||||
"prefill_done": 9920,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 64000,
|
||||
"drafts_offered": 6,
|
||||
"drafts_accepted": 4
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"at": 1793557482.3041096,
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "prefill",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": 16,
|
||||
"prompt_tokens": 64000,
|
||||
"prefill_done": 36704,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 64000,
|
||||
"drafts_offered": 6,
|
||||
"drafts_accepted": 4
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"at": 1793557487.305965,
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "prefill",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": 16,
|
||||
"prompt_tokens": 64000,
|
||||
"prefill_done": 61945,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 64000,
|
||||
"drafts_offered": 6,
|
||||
"drafts_accepted": 4
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"at": 1793557492.3082674,
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "decoding",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 22.7,
|
||||
"generated": 25,
|
||||
"max_tokens": 96,
|
||||
"prompt_tokens": 64200,
|
||||
"prefill_done": 64200,
|
||||
"reused": 64165,
|
||||
"ttft_s": 0.42,
|
||||
"draft_len": 1.64,
|
||||
"ctx_used": 64225,
|
||||
"drafts_offered": 28,
|
||||
"drafts_accepted": 16
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": true,
|
||||
"state": "decoding",
|
||||
"api": "openai",
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"tok_s": 33.2,
|
||||
"generated": 24,
|
||||
"max_tokens": 96,
|
||||
"prompt_tokens": 64200,
|
||||
"prefill_done": 64200,
|
||||
"reused": 64165,
|
||||
"ttft_s": 0.77,
|
||||
"draft_len": 1.85,
|
||||
"ctx_used": 64224,
|
||||
"drafts_offered": 28,
|
||||
"drafts_accepted": 16
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"phase": "chat-1",
|
||||
"wall_seconds": 2.7382846170221455,
|
||||
"overlap_seconds": 1.1902228639810346,
|
||||
"output_tokens": 68
|
||||
},
|
||||
{
|
||||
"phase": "chat-2",
|
||||
"wall_seconds": 2.4140649879700504,
|
||||
"overlap_seconds": 1.413735898968298,
|
||||
"output_tokens": 100
|
||||
},
|
||||
{
|
||||
"phase": "chat-3",
|
||||
"wall_seconds": 2.114251179038547,
|
||||
"overlap_seconds": 1.0121595460223034,
|
||||
"output_tokens": 104
|
||||
}
|
||||
],
|
||||
"work_complete": true,
|
||||
"passed": true,
|
||||
"early_stop_budget": null,
|
||||
"verified_properties": {
|
||||
"total_slots": 2,
|
||||
"default_generation_settings": {
|
||||
"n_ctx": 262144,
|
||||
"params": {
|
||||
"temperature": 1.0,
|
||||
"top_p": 0.95,
|
||||
"top_k": 20,
|
||||
"min_p": 0.0,
|
||||
"presence_penalty": 0.0,
|
||||
"n_predict": -1
|
||||
}
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 32.937956888985354,
|
||||
"preload_seconds": 25.66897592099849,
|
||||
"work_seconds": 32.937911463028286
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"basalt": {
|
||||
"initial_prompt_tokens": 64000,
|
||||
"first_followup_prompt_tokens": 64132,
|
||||
"configured_limit_unchanged": 262144,
|
||||
"completed_requests": 8,
|
||||
"short_answers": 6,
|
||||
"actual_output_tokens": [
|
||||
34,
|
||||
34,
|
||||
51,
|
||||
49,
|
||||
52,
|
||||
52
|
||||
],
|
||||
"fresh_input_seconds": 25.66897592099849,
|
||||
"fresh_input_backend_tps": [
|
||||
5095.0,
|
||||
5108.1
|
||||
],
|
||||
"round_seconds": [
|
||||
2.7382846170221455,
|
||||
2.4140649879700504,
|
||||
2.114251179038547
|
||||
],
|
||||
"all_chat": {
|
||||
"median_first_visible_seconds": 0.7816351674846373,
|
||||
"median_response_wall_seconds": 2.3559466934821103,
|
||||
"median_observed_output_tokens_per_second": 29.881092752326577
|
||||
},
|
||||
"steady_followups": {
|
||||
"median_first_visible_seconds": 0.7042182954901364,
|
||||
"median_response_wall_seconds": 2.2056730309850536,
|
||||
"median_observed_output_tokens_per_second": 33.26764039967274
|
||||
},
|
||||
"whole_work_seconds": 32.937911463028286,
|
||||
"first_round_cache_reused": {
|
||||
"B": 63993,
|
||||
"A": 63993
|
||||
},
|
||||
"timing_inconsistent_with_whole_response": [
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-2"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-3"
|
||||
}
|
||||
]
|
||||
},
|
||||
"strata": {
|
||||
"initial_prompt_tokens": 64000,
|
||||
"first_followup_prompt_tokens": 64132,
|
||||
"configured_limit_unchanged": 262144,
|
||||
"completed_requests": 8,
|
||||
"short_answers": 6,
|
||||
"actual_output_tokens": [
|
||||
38,
|
||||
34,
|
||||
48,
|
||||
49,
|
||||
50,
|
||||
47
|
||||
],
|
||||
"fresh_input_seconds": 64.88171226001577,
|
||||
"fresh_input_backend_tps": [
|
||||
1993.3,
|
||||
1980.7
|
||||
],
|
||||
"round_seconds": [
|
||||
35.159657199983485,
|
||||
3.377142487966921,
|
||||
2.8992902820464224
|
||||
],
|
||||
"all_chat": {
|
||||
"median_first_visible_seconds": 1.5034246094874106,
|
||||
"median_response_wall_seconds": 3.215627621015301,
|
||||
"median_observed_output_tokens_per_second": 26.05955764888433
|
||||
},
|
||||
"steady_followups": {
|
||||
"median_first_visible_seconds": 1.2681522784987465,
|
||||
"median_response_wall_seconds": 2.9769428865110967,
|
||||
"median_observed_output_tokens_per_second": 26.05955764888433
|
||||
},
|
||||
"whole_work_seconds": 106.31905576999998,
|
||||
"first_round_cache_reused": {
|
||||
"B": 63993,
|
||||
"A": 0
|
||||
},
|
||||
"timing_inconsistent_with_whole_response": []
|
||||
},
|
||||
"method": "Same64000-token archives and questions, two concurrent conversations, three short rounds each. Later histories include each actual answer. First-visible and whole response measured at SSE client. Observed write rate=(completion_tokens-1)/(finish-first_content), approximate for chunked streams, not fragmented backend peak counters."
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"checked_at": 1793557928.166,
|
||||
"endpoint": "running",
|
||||
"worker": "ready",
|
||||
"runtime": "strata",
|
||||
"profile_id": "0c25bfe00240414397c41a980ecbe4f0",
|
||||
"llm_loaded": true,
|
||||
"tts_loaded": true,
|
||||
"stt_loaded": true,
|
||||
"active_requests": 0,
|
||||
"scheduler": {
|
||||
"active_requests": 0,
|
||||
"waiting_requests": 0,
|
||||
"tts_waiting_requests": 0,
|
||||
"switching": false
|
||||
},
|
||||
"protected_hashes_unchanged": 12,
|
||||
"production_image_and_start_unchanged": true,
|
||||
"owned_container_removed": true
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"inference": false,
|
||||
"prepared": true,
|
||||
"source": "actual pinned tokenizer and chat template",
|
||||
"initial_tokens": 64000,
|
||||
"final_tokens": 64132,
|
||||
"output_tokens": 96,
|
||||
"slack": 8,
|
||||
"held_prefix_tokens": [
|
||||
64001,
|
||||
64001
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"client_exit_code": 0,
|
||||
"error": null,
|
||||
"test_finished": 1793557498.5666022,
|
||||
"owned_container_removed": true,
|
||||
"production_restore_required": true
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"started": 1793557444.8711767,
|
||||
"deadline": 1793557776.9458838,
|
||||
"production_modified_by_runner": false,
|
||||
"passed": true,
|
||||
"phase": "candidate stopped; outer operator must restore original Strata/Qwen",
|
||||
"updated": 1793557496.9457831,
|
||||
"load_seconds": 17.381574392318726,
|
||||
"capacity_test": true,
|
||||
"server_exit_code": 0
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
[server] legend pp=prompt read tg=generation c=cached acc=drafts accepted dl=tokens per window hit=expert cache pcie=routed experts over PCIe
|
||||
[server] engine ctx=262144 kv=int8 expert-cache=auto prefill=auto resident-experts batch=2 (from config)
|
||||
[server] sampling temp=1.0 top_p=0.95 top_k=20 min_p=0.0 pres=0.0
|
||||
[server] vision mode=off
|
||||
[server] ready http://127.0.0.1:18320/v1 openai+anthropic stats http://127.0.0.1:18320/
|
||||
[server] warning: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
|
||||
[server] auto resident=42.2GB pool-affinity=auto pool=3
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 4 / 21)
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 8 / 21)
|
||||
[server] loaded 43.8GiB 13.2s cuda0=12.8GiB ram=30.9GiB
|
||||
[server] kv 0.9/7.8GiB cuda0 elastic slots=2
|
||||
[server] slots par=2 ctx/slot=262144 (slot-full-context), others queue
|
||||
[server] weights loaded, ctx=262144 images=off
|
||||
[server] s1 read pp=27776/64000 5504t/s 5s
|
||||
[server] s1 read pp=53757/64000 5330t/s 10s
|
||||
[server] live | s1 tg=1/16 | total 0t/s
|
||||
[server] s1 done pp=64000/0c 12.6s 5095t/s tg=2 7.9t/s acc=67% ttft=12.7s end=stop hit=35.6% pcie=0.0%
|
||||
[server] s1 read pp=30752/64000 5555t/s 6s
|
||||
[server] s1 read pp=56486/64000 5338t/s 11s
|
||||
[server] live | s1 tg=1/16 | total 0t/s
|
||||
[server] s1 done pp=64000/0c 12.5s 5108t/s tg=2 8.1t/s acc=67% ttft=12.7s end=stop hit=40.0% pcie=0.0%
|
||||
[server] live | s1 tg=27/96 16.0t/s | s2 tg=22/96 24.3t/s | total 40t/s
|
||||
[server] s1 done pp=64132/63993c 0.5s tg=34 16.9t/s acc=58% dl=1.8 ttft=0.6s end=stop
|
||||
[server] s2 done pp=64132/63993c 0.6s tg=34 26.8t/s acc=57% dl=2.0 ttft=1.3s end=stop hit=71.5% pcie=0.0%
|
||||
[server] live | s1 tg=45/96 27.4t/s | s2 tg=43/96 33.6t/s | total 61t/s
|
||||
[server] s1 done pp=64200/64165c 0.3s tg=49 28.1t/s acc=44% dl=1.5 ttft=0.4s end=stop hit=66.5% pcie=0.0%
|
||||
[server] s2 done pp=64200/64165c 0.2s tg=51 65.4t/s acc=47% dl=1.5 ttft=0.8s end=stop hit=77.5% pcie=0.0%
|
||||
[server] s1 done pp=64283/64250c 0.3s tg=52 34.4t/s acc=55% dl=2.0 ttft=0.4s end=stop
|
||||
[server] s2 done pp=64281/64248c 0.4s tg=52 68.0t/s acc=72% dl=2.4 ttft=0.9s end=stop hit=80.6% pcie=0.0%
|
||||
[server] stopping (Ctrl+C again to force)
|
||||
[server] stopped
|
||||
@@ -0,0 +1,596 @@
|
||||
{
|
||||
"engine": "strata",
|
||||
"started_at": 1793557670.3317032,
|
||||
"deadline": 1793558196.9458838,
|
||||
"context_per_slot": 262144,
|
||||
"initial_tokens": 64000,
|
||||
"final_tokens": 64132,
|
||||
"output_tokens": 96,
|
||||
"requests": [
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 0.05486807902343571,
|
||||
"first_content_at": 32.313648139999714,
|
||||
"finished_at": 32.39287346700439,
|
||||
"content": "OK",
|
||||
"usage": {
|
||||
"prompt_tokens": 64000,
|
||||
"completion_tokens": 2,
|
||||
"total_tokens": 64002,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 64000,
|
||||
"prompt_ms": 32107.2,
|
||||
"prompt_per_token_ms": 0.502,
|
||||
"prompt_per_second": 1993.3,
|
||||
"predicted_n": 2,
|
||||
"predicted_ms": 98.6,
|
||||
"predicted_per_token_ms": 49.3,
|
||||
"predicted_per_second": 20.3,
|
||||
"draft_n": 3,
|
||||
"draft_n_accepted": 3
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 32.39340435300255,
|
||||
"first_content_at": 64.81076030799886,
|
||||
"finished_at": 64.88117066398263,
|
||||
"content": "OK",
|
||||
"usage": {
|
||||
"prompt_tokens": 64000,
|
||||
"completion_tokens": 2,
|
||||
"total_tokens": 64002,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 64000,
|
||||
"prompt_ms": 32311.9,
|
||||
"prompt_per_token_ms": 0.505,
|
||||
"prompt_per_second": 1980.7,
|
||||
"predicted_n": 2,
|
||||
"predicted_ms": 86.1,
|
||||
"predicted_per_token_ms": 43.05,
|
||||
"predicted_per_second": 23.2,
|
||||
"draft_n": 3,
|
||||
"draft_n_accepted": 3
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-1",
|
||||
"maximum": 96,
|
||||
"started_at": 64.88329863501713,
|
||||
"first_content_at": 66.25181083800271,
|
||||
"finished_at": 100.04082317498978,
|
||||
"content": "Meine Archivkennung ist C64_B. Sichern Sie Ihre Daten regelmäßig an einem separaten Speicherort. Testen Sie die Wiederherstellung Ihrer Backups periodisch.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64132,
|
||||
"completion_tokens": 38,
|
||||
"total_tokens": 64170,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 63993
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 63993,
|
||||
"prompt_n": 139,
|
||||
"prompt_ms": 1218.1,
|
||||
"prompt_per_token_ms": 8.763,
|
||||
"prompt_per_second": 114.1,
|
||||
"predicted_n": 38,
|
||||
"predicted_ms": 33472.1,
|
||||
"predicted_per_token_ms": 880.845,
|
||||
"predicted_per_second": 1.1,
|
||||
"draft_n": 0,
|
||||
"draft_n_accepted": 0
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-1",
|
||||
"maximum": 96,
|
||||
"started_at": 64.88343662401894,
|
||||
"first_content_at": 98.68147134303581,
|
||||
"finished_at": 99.73019198299153,
|
||||
"content": "Meine Archivkennung ist C64_A. Sichern Sie Ihre Daten regelmäßig auf redundanten Medien. Testen Sie die Wiederherstellung Ihrer Backups.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64132,
|
||||
"completion_tokens": 34,
|
||||
"total_tokens": 64166,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 64132,
|
||||
"prompt_ms": 32271.9,
|
||||
"prompt_per_token_ms": 0.503,
|
||||
"prompt_per_second": 1987.2,
|
||||
"predicted_n": 34,
|
||||
"predicted_ms": 995.7,
|
||||
"predicted_per_token_ms": 29.285,
|
||||
"predicted_per_second": 34.1,
|
||||
"draft_n": 0,
|
||||
"draft_n_accepted": 0
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-2",
|
||||
"maximum": 96,
|
||||
"started_at": 100.04218179301824,
|
||||
"first_content_at": 100.6401676950045,
|
||||
"finished_at": 103.09757655201247,
|
||||
"content": "Ein Backup ist eine statische Kopie zur Wiederherstellung nach Datenverlust. Eine Synchronisierung hält zwei Speicherorte durch ständige Angleichung aktuell. Backups schützen vor Fehlern, Synchronisierung dient der Konsistenz.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64204,
|
||||
"completion_tokens": 48,
|
||||
"total_tokens": 64252,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64169
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64169,
|
||||
"prompt_n": 35,
|
||||
"prompt_ms": 365.6,
|
||||
"prompt_per_token_ms": 10.446,
|
||||
"prompt_per_second": 95.7,
|
||||
"predicted_n": 48,
|
||||
"predicted_ms": 2373.4,
|
||||
"predicted_per_token_ms": 49.446,
|
||||
"predicted_per_second": 20.2,
|
||||
"draft_n": 0,
|
||||
"draft_n_accepted": 0
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-2",
|
||||
"maximum": 96,
|
||||
"started_at": 100.04231246799463,
|
||||
"first_content_at": 101.68064948398387,
|
||||
"finished_at": 103.41817295103101,
|
||||
"content": "Ein Backup ist eine punktuell erstellte Kopie zur Wiederherstellung nach Datenverlust. Eine Synchronisierung hält zwei Speicherorte permanent auf dem gleichen aktuellen Stand. Backups schützen vor Löschungen, Synchronisierungen nicht.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64200,
|
||||
"completion_tokens": 49,
|
||||
"total_tokens": 64249,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64165
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64165,
|
||||
"prompt_n": 35,
|
||||
"prompt_ms": 876.5,
|
||||
"prompt_per_token_ms": 25.043,
|
||||
"prompt_per_second": 39.9,
|
||||
"predicted_n": 49,
|
||||
"predicted_ms": 1419.2,
|
||||
"predicted_per_token_ms": 28.963,
|
||||
"predicted_per_second": 34.5,
|
||||
"draft_n": 0,
|
||||
"draft_n_accepted": 0
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "chat-3",
|
||||
"maximum": 96,
|
||||
"started_at": 103.41968307300704,
|
||||
"first_content_at": 104.31765061401529,
|
||||
"finished_at": 106.318174087035,
|
||||
"content": "Prüfen Sie zuerst die Integrität und Vollständigkeit der Sicherungsdateien. Stellen Sie sicher, dass die Zielumgebung kompatibel ist. Führen Sie die Wiederherstellung idealerweise in einer isolierten Testumgebung durch.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64284,
|
||||
"completion_tokens": 50,
|
||||
"total_tokens": 64334,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64251
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64251,
|
||||
"prompt_n": 33,
|
||||
"prompt_ms": 745.7,
|
||||
"prompt_per_token_ms": 22.597,
|
||||
"prompt_per_second": 44.3,
|
||||
"predicted_n": 50,
|
||||
"predicted_ms": 1903.7,
|
||||
"predicted_per_token_ms": 38.074,
|
||||
"predicted_per_second": 26.3,
|
||||
"draft_n": 0,
|
||||
"draft_n_accepted": 0
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "chat-3",
|
||||
"maximum": 96,
|
||||
"started_at": 103.41985899303108,
|
||||
"first_content_at": 105.15423092100536,
|
||||
"finished_at": 106.28691636701114,
|
||||
"content": "Prüfen Sie zuerst die Integrität und Vollständigkeit der Sicherungsdateien. Stellen Sie sicher, dass die Zielumgebung kompatibel ist. Testen Sie die Wiederherstellung idealerweise in einer isolierten Umgebung.",
|
||||
"usage": {
|
||||
"prompt_tokens": 64281,
|
||||
"completion_tokens": 47,
|
||||
"total_tokens": 64328,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 64248
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 64248,
|
||||
"prompt_n": 33,
|
||||
"prompt_ms": 655.5,
|
||||
"prompt_per_token_ms": 19.864,
|
||||
"prompt_per_second": 50.3,
|
||||
"predicted_n": 47,
|
||||
"predicted_ms": 1056.7,
|
||||
"predicted_per_token_ms": 22.483,
|
||||
"predicted_per_second": 44.5,
|
||||
"draft_n": 0,
|
||||
"draft_n_accepted": 0
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
}
|
||||
],
|
||||
"snapshots": [
|
||||
{
|
||||
"at": 1793557675.390145,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557675.388674,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 63.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557680.3931208,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557680.3917189,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1887.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557685.3958776,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557685.394668,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1999.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557690.3991408,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557690.3976154,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2069.5,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557695.4022021,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557695.4008596,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2087.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557700.405529,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557700.4040508,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2101.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557705.4091072,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557705.4075062,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1993.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557710.4137406,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557710.4119499,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1540.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557715.4171252,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557715.4156706,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1968.2,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557720.420461,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557720.4190397,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2020.0,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557725.4240637,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557725.4225397,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2047.6,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557730.4278102,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557730.4264367,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2085.4,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557735.4324386,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557735.4296825,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1980.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557740.4354672,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557740.4341328,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 113.3,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557745.4389977,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557745.437623,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1576.9,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557750.4421165,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557750.4407814,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1978.2,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557755.4456851,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557755.4440792,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2029.6,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557760.4493153,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557760.447995,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2074.3,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557765.4524827,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557765.4510577,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2090.6,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557770.4562268,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557770.4545674,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "idle",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": null,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793557775.4605117,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793557775.4584975,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 44.5,
|
||||
"active_slots": 2,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"phase": "chat-1",
|
||||
"wall_seconds": 35.159657199983485,
|
||||
"overlap_seconds": 1.048720639955718,
|
||||
"output_tokens": 72
|
||||
},
|
||||
{
|
||||
"phase": "chat-2",
|
||||
"wall_seconds": 3.377142487966921,
|
||||
"overlap_seconds": 1.416927068028599,
|
||||
"output_tokens": 97
|
||||
},
|
||||
{
|
||||
"phase": "chat-3",
|
||||
"wall_seconds": 2.8992902820464224,
|
||||
"overlap_seconds": 1.1326854460057802,
|
||||
"output_tokens": 97
|
||||
}
|
||||
],
|
||||
"work_complete": true,
|
||||
"passed": true,
|
||||
"early_stop_budget": null,
|
||||
"verified_properties": {
|
||||
"total_slots": 2,
|
||||
"default_generation_settings": {
|
||||
"n_ctx": 262144,
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 106.31910459202481,
|
||||
"preload_seconds": 64.88171226001577,
|
||||
"work_seconds": 106.31905576999998
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"started": 1793557416.9458838,
|
||||
"test_deadline": 1793557776.9458838,
|
||||
"comparison_deadline": 1793558196.9458838,
|
||||
"restore_deadline": 1793558316.9458838,
|
||||
"go": "Michael: small64K-context chat bites comparison",
|
||||
"actual_context_test": "Two64000-token archives, three short follow-up rounds each; existing262144 per-slot limits unchanged"
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"reference": {
|
||||
"solo_decode_tps": 64.8,
|
||||
"parallel_wall_seconds": 12.3075,
|
||||
"parallel_output_tokens": 1024,
|
||||
"fresh_pair_wall_seconds": 13.5068,
|
||||
"cached_pair_wall_seconds": 1.5775,
|
||||
"long_wall_seconds": 31.7225,
|
||||
"long_prefill_tps": 1923.3,
|
||||
"long_prompt_tokens": 60047,
|
||||
"source": "docs/maintenance/strata-029-staged-2026-11-01/README.md:134-143",
|
||||
"runtime": "Strata 0.1.55, optimized original dual-GPU profile"
|
||||
},
|
||||
"historical_not_controlled": true,
|
||||
"solo": {
|
||||
"strata_backend_tps": 64.8,
|
||||
"basalt_backend_tps": 71.4,
|
||||
"percent": 10.185185185185208
|
||||
},
|
||||
"parallel": {
|
||||
"strata_wall_seconds": 12.3075,
|
||||
"basalt_wall_seconds": 13.765592798998114,
|
||||
"basalt_time_more_percent": 11.847189104189425,
|
||||
"strata_end_to_end_tps": 83.20130002031283,
|
||||
"basalt_end_to_end_tps": 74.38836924440542
|
||||
},
|
||||
"long": {
|
||||
"prompt_tokens": 60047,
|
||||
"strata_wall_seconds": 31.7225,
|
||||
"basalt_wall_seconds": 12.05722963399603,
|
||||
"time_reduction_percent": 61.99155289149332,
|
||||
"wall_speedup": 2.630994097562565,
|
||||
"strata_prefill_tps": 1923.3,
|
||||
"basalt_prefill_tps": 5140.4
|
||||
},
|
||||
"cache_reused_tokens": [
|
||||
7427,
|
||||
7413
|
||||
],
|
||||
"restored_window_minutes_seconds": [
|
||||
6,
|
||||
23
|
||||
],
|
||||
"limits": [
|
||||
"One run, not a counterbalanced comparison",
|
||||
"Basalt 5080+RAM versus Strata 3060+5080+RAM",
|
||||
"Basalt official complete pack and provider defaults, pool=3, MTP active in parallel; Strata batch MTP off",
|
||||
"Configured two 262144-token slots, not filled simultaneously",
|
||||
"No general quality equivalence, long soak or generated-code/fenced-tool case in this shorter subset",
|
||||
"Parallel comparison uses shared wall time, not summed per-request backend counters"
|
||||
],
|
||||
"recommendation": "Keep current Strata active; Basalt is interesting for long prompt processing, not an unconditional faster replacement"
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"checked_at": "2026-11-01T13:05:52.771318+00:00",
|
||||
"root": "/opt/athena-deck-dev/basalt-candidate-9175e7a3211b",
|
||||
"commit": "9175e7a3211bda355c02e804c7c107b15b8ea89f",
|
||||
"version": "0.1.0",
|
||||
"gpu_architectures": [
|
||||
120
|
||||
],
|
||||
"build_complete": true,
|
||||
"binaries": {
|
||||
"basalt": {
|
||||
"bytes": 89597232,
|
||||
"sha256": "1278458f0519a65fefec93224d5e3ff9cd1862a981f0fce2ae48a8e2614fb38a"
|
||||
},
|
||||
"basalt-bench": {
|
||||
"bytes": 605664,
|
||||
"sha256": "91f35e14aa080a2f92d4aa48ab7b31abd49586447eeb0b873d48361b0c447b26"
|
||||
},
|
||||
"basalt-probe": {
|
||||
"bytes": 430392,
|
||||
"sha256": "16ed0638cf653d0944f6aed0731d79514773b3ba07d85832998510d78724894e"
|
||||
},
|
||||
"basalt-vision": {
|
||||
"bytes": 593560,
|
||||
"sha256": "ec5a436ce6c5a7e74525d5258cacc498799a6f898a4a1ee9ee2cefa3b34e195e"
|
||||
}
|
||||
},
|
||||
"binary_hashes_unchanged": true,
|
||||
"native_debian_help_passed": true,
|
||||
"native_libraries_found": true,
|
||||
"ctest": {
|
||||
"selected": 62,
|
||||
"failed": 0,
|
||||
"skipped": 0,
|
||||
"seconds": 91.0
|
||||
},
|
||||
"python_fixture_tests": {
|
||||
"total": 647,
|
||||
"passed": 645,
|
||||
"skipped": 2,
|
||||
"seconds": 290.0,
|
||||
"successful": true
|
||||
},
|
||||
"nas_helper_tests": 9,
|
||||
"manifest": {
|
||||
"entries": 8290,
|
||||
"logical_bytes": 1589570206,
|
||||
"logical_gib": 1.48,
|
||||
"directory_and_file_symlinks": 1,
|
||||
"complete_inventory_readback": true
|
||||
},
|
||||
"production": {
|
||||
"protected_hashes_unchanged": 12,
|
||||
"image_unchanged": true,
|
||||
"start_unchanged": true,
|
||||
"health": "healthy"
|
||||
},
|
||||
"cleanup_rehearsal": {
|
||||
"deleted_owned_fixture": true,
|
||||
"external_symlink_target_preserved": true,
|
||||
"symlink_root_rejected": true
|
||||
},
|
||||
"owned_builder_removed": true,
|
||||
"adopted_worker_exit_code": "0",
|
||||
"activated": false,
|
||||
"inference_performed": false,
|
||||
"models_downloaded": false,
|
||||
"limits": [
|
||||
"SM86 RTX 3060 unsupported including peer tier",
|
||||
"No model or GPU quality/performance test",
|
||||
"AVX-512-only tests and quantizer microbenchmark excluded",
|
||||
"Native Python server/Deck/systemd integration and fresh Debian full restore not accepted"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"at": 1793552738.9177687, "gpu": "NVIDIA GeForce RTX 3060, 1 MiB, 12288 MiB\nNVIDIA GeForce RTX 5080, 15400 MiB, 16303 MiB\n", "mem_available_kib": "12561668"}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"client_exit_code": 0,
|
||||
"error": null,
|
||||
"test_finished": 1793552339.981375,
|
||||
"owned_container_removed": true,
|
||||
"production_restore_required": true
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"checked_at": 1793552964.504,
|
||||
"state": "running",
|
||||
"profile_id": "0c25bfe00240414397c41a980ecbe4f0",
|
||||
"runtime": "strata",
|
||||
"worker_state": "ready",
|
||||
"llm_loaded": true,
|
||||
"tts_loaded": true,
|
||||
"stt_loaded": true,
|
||||
"scheduler": {
|
||||
"active_requests": 0,
|
||||
"waiting_requests": 0,
|
||||
"tts_waiting_requests": 0,
|
||||
"switching": false
|
||||
},
|
||||
"restore_job": "80def5babe2b4cf1aa647e3a08401590",
|
||||
"restore_job_state": "complete",
|
||||
"protected_hashes_unchanged": 12,
|
||||
"production_image_and_start_unchanged": true,
|
||||
"owned_container_removed": true,
|
||||
"window_seconds": 890.2707097530365
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"started": 1793552130.2978513,
|
||||
"deadline": 1793552794.2332902,
|
||||
"production_modified_by_runner": false,
|
||||
"passed": true,
|
||||
"phase": "candidate stopped; outer operator must restore original Strata/Qwen",
|
||||
"updated": 1793552338.796751,
|
||||
"load_seconds": 33.45602011680603,
|
||||
"capacity_test": false,
|
||||
"server_exit_code": 0
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
[server] legend pp=prompt read tg=generation c=cached acc=drafts accepted dl=tokens per window hit=expert cache pcie=routed experts over PCIe
|
||||
[server] engine ctx=262144 kv=int8 expert-cache=auto prefill=auto resident-experts batch=2 (from config)
|
||||
[server] sampling temp=1.0 top_p=0.95 top_k=20 min_p=0.0 pres=0.0
|
||||
[server] vision mode=off
|
||||
[server] ready http://127.0.0.1:18320/v1 openai+anthropic stats http://127.0.0.1:18320/
|
||||
[server] warning: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
|
||||
[server] loading weights into cuda0 [==========> ] 5.4/12.7 GiB
|
||||
[server] auto resident=41.6GB pool-affinity=auto pool=3
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 4 / 21)
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 8 / 21)
|
||||
[server] loaded 43.8GiB 29.1s cuda0=12.7GiB ram=31.0GiB
|
||||
[server] kv 0.9/7.8GiB cuda0 elastic slots=2
|
||||
[server] slots par=2 ctx/slot=262144 (slot-full-context), others queue
|
||||
[server] weights loaded, ctx=262144 images=off
|
||||
[server] s1 read pp=27232/261632 5052t/s 5s
|
||||
[server] s2 read pp=49312/261632 5039t/s 10s
|
||||
[server] s1 read pp=52992/261632 4965t/s 11s
|
||||
[server] s1 read pp=79120/261632 4972t/s 16s
|
||||
[server] s2 read pp=96784/261632 4920t/s 20s
|
||||
[server] s1 read pp=104144/261632 4901t/s 21s
|
||||
[server] s1 read pp=126960/261632 4831t/s 26s
|
||||
[server] s2 read pp=141680/261632 4772t/s 30s
|
||||
[server] s1 read pp=149408/261632 4765t/s 31s
|
||||
[server] s1 read pp=171488/261632 4704t/s 37s
|
||||
[server] s2 read pp=185840/261632 4671t/s 40s
|
||||
[server] s1 read pp=193200/261632 4652t/s 42s
|
||||
[server] s1 read pp=214912/261632 4583t/s 47s
|
||||
[server] s2 read pp=225952/261632 4551t/s 50s
|
||||
[server] s1 read pp=234784/261632 4524t/s 52s
|
||||
[server] s1 read pp=256251/261632 4458t/s 58s
|
||||
[server] live | s1 tg=1/1 | total 0t/s
|
||||
[server] s1 done pp=261632/0c 59.3s 4411t/s tg=1 7.5t/s ttft=59.5s end=length hit=29.3% pcie=0.0%
|
||||
[server] s2 read pp=90/261632 424t/s 60s
|
||||
[server] s2 read pp=14688/261632 2703t/s 65s
|
||||
[server] s2 read pp=28288/261632 2679t/s 70s
|
||||
[server] s2 read pp=41706/261632 2646t/s 75s
|
||||
[server] s2 read pp=54853/261632 2620t/s 80s
|
||||
[server] s2 read pp=67818/261632 2601t/s 86s
|
||||
[server] s2 read pp=80784/261632 2583t/s 91s
|
||||
[server] s2 read pp=93477/261632 2566t/s 96s
|
||||
[server] s2 read pp=106080/261632 2549t/s 101s
|
||||
[server] s2 read pp=118592/261632 2536t/s 106s
|
||||
[server] s2 read pp=130560/261632 2517t/s 111s
|
||||
[server] s2 read pp=143253/261632 2504t/s 117s
|
||||
[server] s2 read pp=155765/261632 2494t/s 122s
|
||||
[server] s2 read pp=168277/261632 2483t/s 127s
|
||||
[server] s2 read pp=180426/261632 2473t/s 132s
|
||||
[server] s2 read pp=192485/261632 2462t/s 138s
|
||||
[server] s2 read pp=204272/261632 2448t/s 143s
|
||||
[server] s2 read pp=216149/261632 2439t/s 148s
|
||||
[server] s2 read pp=228117/261632 2429t/s 153s
|
||||
[server] s2 read pp=239360/261632 2416t/s 159s
|
||||
[server] s2 read pp=251690/261632 2406t/s 164s
|
||||
[server] s2 read pp=261582/261632 2379t/s 169s
|
||||
[server] s2 done pp=261632/0c 110.2s 2373t/s tg=1 9.3t/s ttft=169.9s end=length
|
||||
[server] stopping (Ctrl+C again to force)
|
||||
[server] stopped
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"prompt_tokens_per_request": 261632,
|
||||
"cold_requests": [
|
||||
{
|
||||
"slot": "A",
|
||||
"prompt_tokens": 261632,
|
||||
"prompt_seconds": 106.1235,
|
||||
"prompt_tokens_per_second": 2465.4,
|
||||
"ttft_seconds": 166.24535822300822
|
||||
},
|
||||
{
|
||||
"slot": "B",
|
||||
"prompt_tokens": 261632,
|
||||
"prompt_seconds": 59.3935,
|
||||
"prompt_tokens_per_second": 4405.1,
|
||||
"ttft_seconds": 59.99161572099547
|
||||
}
|
||||
],
|
||||
"combined_cold_wall_seconds": 166.3013672780071,
|
||||
"combined_cold_input_tokens_per_second": 3146.4804442963846,
|
||||
"completed_full_context_output_tokens": 504,
|
||||
"completed_full_context_output_backend_tps": 17.5,
|
||||
"output_source": "full2-server.log: s1 done pp=261632/261625c ... tg=504 17.5t/s",
|
||||
"parallel_full_decode_proven": false,
|
||||
"capacity_oom_proven": false,
|
||||
"test_complete": false,
|
||||
"stop_reason": "First attempt missing 8-token context slack. Corrected output pair incomplete on runner timeout in same fixed window; another context re-prefilled.",
|
||||
"restoration": {
|
||||
"checked_at": 1793552964.504,
|
||||
"state": "running",
|
||||
"profile_id": "0c25bfe00240414397c41a980ecbe4f0",
|
||||
"runtime": "strata",
|
||||
"worker_state": "ready",
|
||||
"llm_loaded": true,
|
||||
"tts_loaded": true,
|
||||
"stt_loaded": true,
|
||||
"scheduler": {
|
||||
"active_requests": 0,
|
||||
"waiting_requests": 0,
|
||||
"tts_waiting_requests": 0,
|
||||
"switching": false
|
||||
},
|
||||
"restore_job": "80def5babe2b4cf1aa647e3a08401590",
|
||||
"restore_job_state": "complete",
|
||||
"protected_hashes_unchanged": 12,
|
||||
"production_image_and_start_unchanged": true,
|
||||
"owned_container_removed": true,
|
||||
"window_seconds": 890.2707097530365
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"go": "Michael: fill both slots to the edge and measure input/output",
|
||||
"started": 1793552074.2332902,
|
||||
"test_deadline": 1793552794.2332902,
|
||||
"restore_deadline": 1793552974.2332902
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"client_exit_code": 1,
|
||||
"error": null,
|
||||
"test_finished": 1793552777.219092,
|
||||
"owned_container_removed": true,
|
||||
"production_restore_required": true
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"started": 1793552489.4918776,
|
||||
"deadline": 1793552794.2332902,
|
||||
"production_modified_by_runner": false,
|
||||
"passed": false,
|
||||
"phase": "candidate stopped; outer operator must restore original Strata/Qwen",
|
||||
"updated": 1793552775.803959,
|
||||
"load_seconds": 31.24987816810608,
|
||||
"error": "TimeoutExpired: Command '['/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/venv/bin/python', '/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/full2_client.py', '--go', '--deadline', '1793552794.2332902']' timed out after 253.49130519520259 seconds",
|
||||
"server_exit_code": 0
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
[server] legend pp=prompt read tg=generation c=cached acc=drafts accepted dl=tokens per window hit=expert cache pcie=routed experts over PCIe
|
||||
[server] engine ctx=262144 kv=int8 expert-cache=auto prefill=auto resident-experts batch=2 (from config)
|
||||
[server] sampling temp=1.0 top_p=0.95 top_k=20 min_p=0.0 pres=0.0
|
||||
[server] vision mode=off
|
||||
[server] ready http://127.0.0.1:18320/v1 openai+anthropic stats http://127.0.0.1:18320/
|
||||
[server] warning: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
|
||||
[server] loading weights into cuda0 [=======================>] 12.6/12.8 GiB 6641 MB/s
|
||||
[server] auto resident=41.9GB pool-affinity=auto pool=3
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 4 / 21)
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 8 / 21)
|
||||
[server] loaded 43.8GiB 27.1s cuda0=12.8GiB ram=30.9GiB
|
||||
[server] kv 0.9/7.8GiB cuda0 elastic slots=2
|
||||
[server] slots par=2 ctx/slot=262144 (slot-full-context), others queue
|
||||
[server] weights loaded, ctx=262144 images=off
|
||||
[server] s1 read pp=22496/261632 4482t/s 5s
|
||||
[server] s2 read pp=46965/261632 4792t/s 10s
|
||||
[server] s1 read pp=49728/261632 4805t/s 10s
|
||||
[server] s1 read pp=75776/261632 4793t/s 16s
|
||||
[server] s2 read pp=95114/261632 4800t/s 20s
|
||||
[server] s1 read pp=100245/261632 4811t/s 21s
|
||||
[server] s1 read pp=125898/261632 4776t/s 26s
|
||||
[server] s2 read pp=140896/261632 4750t/s 30s
|
||||
[server] s1 read pp=150368/261632 4731t/s 32s
|
||||
[server] s1 read pp=173653/261632 4669t/s 37s
|
||||
[server] s2 read pp=185493/261632 4639t/s 40s
|
||||
[server] s1 read pp=194965/261632 4614t/s 42s
|
||||
[server] s1 read pp=216277/261632 4568t/s 47s
|
||||
[server] s2 read pp=225749/261632 4545t/s 50s
|
||||
[server] s1 read pp=237589/261632 4508t/s 53s
|
||||
[server] s1 read pp=257147/261632 4449t/s 58s
|
||||
[server] live | s1 tg=1/1 | total 0t/s
|
||||
[server] s1 done pp=261632/0c 59.4s 4405t/s tg=1 7.7t/s ttft=59.6s end=length hit=29.7% pcie=0.0%
|
||||
[server] s2 read pp=96/261632 457t/s 60s
|
||||
[server] s2 read pp=14976/261632 2774t/s 65s
|
||||
[server] s2 read pp=29280/261632 2760t/s 70s
|
||||
[server] s2 read pp=43200/261632 2735t/s 75s
|
||||
[server] s2 read pp=57024/261632 2709t/s 81s
|
||||
[server] s2 read pp=70560/261632 2688t/s 86s
|
||||
[server] s2 read pp=84000/261632 2667t/s 91s
|
||||
[server] s2 read pp=96768/261632 2642t/s 96s
|
||||
[server] s2 read pp=110208/261632 2629t/s 101s
|
||||
[server] s2 read pp=123264/261632 2617t/s 107s
|
||||
[server] s2 read pp=136128/261632 2604t/s 112s
|
||||
[server] s2 read pp=148608/261632 2589t/s 117s
|
||||
[server] s2 read pp=160992/261632 2573t/s 122s
|
||||
[server] s2 read pp=173568/261632 2563t/s 127s
|
||||
[server] s2 read pp=186240/261632 2552t/s 133s
|
||||
[server] s2 read pp=198144/261632 2536t/s 138s
|
||||
[server] s2 read pp=211200/261632 2525t/s 143s
|
||||
[server] s2 read pp=223872/261632 2515t/s 149s
|
||||
[server] s2 read pp=235776/261632 2503t/s 154s
|
||||
[server] s2 read pp=247968/261632 2490t/s 159s
|
||||
[server] s2 read pp=259612/261632 2478t/s 164s
|
||||
[server] live | s2 tg=1/1 | total 0t/s
|
||||
[server] s2 done pp=261632/0c 106.1s 2465t/s tg=1 14.5t/s ttft=165.8s end=length
|
||||
[server] live | s1 tg=36/504 19.6t/s | total 20t/s
|
||||
[server] live | s1 tg=69/504 17.1t/s | total 17t/s
|
||||
[server] s2 read pp=2400/261632 490t/s 5s
|
||||
[server] live | s1 tg=106/504 17.5t/s | total 17t/s
|
||||
[server] live | s1 tg=140/504 17.2t/s | total 17t/s
|
||||
[server] live | s1 tg=172/504 16.9t/s | total 17t/s
|
||||
[server] s2 read pp=4512/261632 448t/s 10s
|
||||
[server] live | s1 tg=208/504 16.9t/s | total 17t/s
|
||||
[server] live | s1 tg=244/504 16.9t/s | total 17t/s
|
||||
[server] s2 read pp=7104/261632 460t/s 16s
|
||||
[server] live | s1 tg=283/504 17.2t/s | total 17t/s
|
||||
[server] live | s1 tg=322/504 17.3t/s | total 17t/s
|
||||
[server] live | s1 tg=356/504 17.1t/s | total 17t/s
|
||||
[server] s2 read pp=9120/261632 439t/s 21s
|
||||
[server] live | s1 tg=393/504 17.2t/s | total 17t/s
|
||||
[server] live | s1 tg=437/504 17.6t/s | total 18t/s
|
||||
[server] s2 read pp=11616/261632 447t/s 26s
|
||||
[server] live | s1 tg=472/504 17.5t/s | total 18t/s
|
||||
[server] s1 done pp=261632/261625c 0.0s tg=504 17.5t/s acc=63% dl=1.8 ttft=0.2s end=length hit=33.5% pcie=0.0%
|
||||
[server] s2 read pp=19200/261632 616t/s 32s
|
||||
[server] s2 read pp=32256/261632 887t/s 37s
|
||||
[server] s2 read pp=45504/261632 1094t/s 42s
|
||||
[server] s2 read pp=58368/261632 1249t/s 47s
|
||||
[server] s2 read pp=71232/261632 1371t/s 52s
|
||||
[server] s2 read pp=83616/261632 1464t/s 58s
|
||||
[server] s2 read pp=96096/261632 1540t/s 63s
|
||||
[server] s2 read pp=108768/261632 1608t/s 68s
|
||||
[server] s2 read pp=121344/261632 1663t/s 73s
|
||||
[server] s2 read pp=133248/261632 1704t/s 79s
|
||||
[server] s2 read pp=145632/261632 1745t/s 84s
|
||||
[server] stopping (Ctrl+C again to force)
|
||||
[server] s2 done pp=152064/0c 86.5s 1758t/s tg=0 end=length
|
||||
[server] stopped
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"paired-basalt.json": {
|
||||
"bytes": 51753,
|
||||
"sha256": "f9c9391e120945739216403d2910bdffc5bf2a3ccff5957cab2740211778fc81"
|
||||
},
|
||||
"paired-strata.json": {
|
||||
"bytes": 1349,
|
||||
"sha256": "36020780ebc8262772a9a2ab84e0988f0c0b61f9dd489bb4e1270192acbdac16"
|
||||
},
|
||||
"paired-strata2.json": {
|
||||
"bytes": 18223,
|
||||
"sha256": "0fefeadd5d2a8f75948198f041a6385841e5bad2220db0e213e31691421dcbdb"
|
||||
},
|
||||
"paired-window.json": {
|
||||
"bytes": 387,
|
||||
"sha256": "65e803dfc97d27634db34a28ff346f751401ccb5759570e67b18657b200efa55"
|
||||
},
|
||||
"paired-fixtures-proof.json": {
|
||||
"bytes": 248,
|
||||
"sha256": "1950437fa1b0209740f13c6fef70c05a2cebb8988c439f20830c9b8ef6176e33"
|
||||
},
|
||||
"paired-runner-status.json": {
|
||||
"bytes": 332,
|
||||
"sha256": "8c6e3190a2ef3f86a856f859730e41648eaa7d978c437ca9c84ce324dbdd885a"
|
||||
},
|
||||
"paired-host-exit.json": {
|
||||
"bytes": 158,
|
||||
"sha256": "d74dae821a75bf5896cab3f6405b65b729adccc9fbf65707b0c49a811c85d1a3"
|
||||
},
|
||||
"paired-server.log": {
|
||||
"bytes": 4040,
|
||||
"sha256": "63b6c3909fe971fbf343a3672f0e2f8e986a032c17957aba9095c6876279aa02"
|
||||
},
|
||||
"paired-final-state.json": {
|
||||
"bytes": 531,
|
||||
"sha256": "6dd33784eb9096cbdee892c56a4fead48929888730282714f5dc4779fe82e54c"
|
||||
},
|
||||
"paired-fixtures.json": {
|
||||
"bytes": 2437195,
|
||||
"sha256": "e7ec6b476774c5b04cd851c1f57cbfac3234f87f5c03f95c19bc8d50ff0cb3d4"
|
||||
},
|
||||
"paired_client.py": {
|
||||
"bytes": 10620,
|
||||
"sha256": "597a91cda44db92331878ba008a4cb0383522d662c843b2ed61ee55475a90e99"
|
||||
},
|
||||
"paired_strata_client.py": {
|
||||
"bytes": 10750,
|
||||
"sha256": "8bf83521aa789a163d4ab8ff687b2e37ad4e33d0c0cf0b77fbc604355a38c154"
|
||||
},
|
||||
"paired_host.py": {
|
||||
"bytes": 4963,
|
||||
"sha256": "2fb279f11c57d3eeff2ea173d39013ada83439f20f95e11ddeac82678fd21b56"
|
||||
},
|
||||
"paired_runner.py": {
|
||||
"bytes": 4908,
|
||||
"sha256": "fd406a1e6cf71824e1de2027053db00f402b7bee1203d1d7ae73eaea38ab2ca0"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"basalt_complete": true,
|
||||
"basalt_whole_work_seconds": 199.9931117410306,
|
||||
"basalt_read_and_acknowledge_seconds": 172.15862989303423,
|
||||
"basalt_parallel_answers_seconds": 27.833112599037122,
|
||||
"basalt_parallel_end_to_end_output_tokens_per_second": 36.21585607478452,
|
||||
"basalt_per_answer_backend_output_tps": [
|
||||
19.6,
|
||||
18.9
|
||||
],
|
||||
"basalt_simultaneous_full_decode_seconds": 25.629003488982562,
|
||||
"basalt_both_full_decode_snapshots": 5,
|
||||
"basalt_first_input_tps": 4056.0,
|
||||
"strata_first_input_tps": 1949.1,
|
||||
"first_input_speed_ratio": 2.0809604432815147,
|
||||
"strata_abort_seconds": 232.2537018750445,
|
||||
"strata_more_total_time_percent_lower_bound": 16.130850634389795,
|
||||
"strata_second_input_incomplete": true,
|
||||
"strata_full_pair_output_not_measured": true,
|
||||
"early_abort_requested_by_user": true,
|
||||
"scope": "One identical near-limit conversation workload; Basalt5080+RAM versus current optimized Strata3060+5080+RAM; not general short-prompt or quality equivalence",
|
||||
"final_state": {
|
||||
"checked_at": 1793555492.298,
|
||||
"endpoint": "running",
|
||||
"worker": "ready",
|
||||
"runtime": "strata",
|
||||
"profile_id": "0c25bfe00240414397c41a980ecbe4f0",
|
||||
"llm_loaded": true,
|
||||
"tts_loaded": true,
|
||||
"stt_loaded": true,
|
||||
"active_requests": 0,
|
||||
"scheduler": {
|
||||
"active_requests": 0,
|
||||
"waiting_requests": 0,
|
||||
"tts_waiting_requests": 0,
|
||||
"switching": false
|
||||
},
|
||||
"protected_hashes_unchanged": 12,
|
||||
"production_image_and_start_unchanged": true,
|
||||
"owned_test_container_removed": true,
|
||||
"additional_inference": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"checked_at": 1793555492.298,
|
||||
"endpoint": "running",
|
||||
"worker": "ready",
|
||||
"runtime": "strata",
|
||||
"profile_id": "0c25bfe00240414397c41a980ecbe4f0",
|
||||
"llm_loaded": true,
|
||||
"tts_loaded": true,
|
||||
"stt_loaded": true,
|
||||
"active_requests": 0,
|
||||
"scheduler": {
|
||||
"active_requests": 0,
|
||||
"waiting_requests": 0,
|
||||
"tts_waiting_requests": 0,
|
||||
"switching": false
|
||||
},
|
||||
"protected_hashes_unchanged": 12,
|
||||
"production_image_and_start_unchanged": true,
|
||||
"owned_test_container_removed": true,
|
||||
"additional_inference": false
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"inference": false,
|
||||
"prepared": true,
|
||||
"source": "actual pinned tokenizer and chat template",
|
||||
"initial_tokens": 261500,
|
||||
"final_tokens": 261632,
|
||||
"output_tokens": 504,
|
||||
"slack": 8,
|
||||
"held_prefix_tokens": [
|
||||
261501,
|
||||
261501
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"client_exit_code": 0,
|
||||
"error": null,
|
||||
"test_finished": 1793554788.7173693,
|
||||
"owned_container_removed": true,
|
||||
"production_restore_required": true
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"started": 1793554569.0149407,
|
||||
"deadline": 1793555440.9617686,
|
||||
"production_modified_by_runner": false,
|
||||
"passed": true,
|
||||
"phase": "candidate stopped; outer operator must restore original Strata/Qwen",
|
||||
"updated": 1793554787.8391988,
|
||||
"load_seconds": 17.36522102355957,
|
||||
"capacity_test": true,
|
||||
"server_exit_code": 0
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
[server] legend pp=prompt read tg=generation c=cached acc=drafts accepted dl=tokens per window hit=expert cache pcie=routed experts over PCIe
|
||||
[server] engine ctx=262144 kv=int8 expert-cache=auto prefill=auto resident-experts batch=2 (from config)
|
||||
[server] sampling temp=1.0 top_p=0.95 top_k=20 min_p=0.0 pres=0.0
|
||||
[server] vision mode=off
|
||||
[server] ready http://127.0.0.1:18320/v1 openai+anthropic stats http://127.0.0.1:18320/
|
||||
[server] warning: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
|
||||
[server] auto resident=42.2GB pool-affinity=auto pool=3
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 4 / 21)
|
||||
[server] warning: fallback: dense_tc projection on native_mmvq (types 8 / 21)
|
||||
[server] loaded 43.8GiB 13.2s cuda0=12.8GiB ram=30.9GiB
|
||||
[server] kv 0.9/7.8GiB cuda0 elastic slots=2
|
||||
[server] slots par=2 ctx/slot=262144 (slot-full-context), others queue
|
||||
[server] weights loaded, ctx=262144 images=off
|
||||
[server] s1 read pp=394/261500 65t/s 6s
|
||||
[server] s1 read pp=28021/261500 2515t/s 11s
|
||||
[server] s1 read pp=55253/261500 3348t/s 17s
|
||||
[server] s1 read pp=81696/261500 3719t/s 22s
|
||||
[server] s1 read pp=105376/261500 3907t/s 27s
|
||||
[server] s1 read pp=128661/261500 4011t/s 32s
|
||||
[server] s1 read pp=151552/261500 4054t/s 37s
|
||||
[server] s1 read pp=176021/261500 4106t/s 43s
|
||||
[server] s1 read pp=197728/261500 4127t/s 48s
|
||||
[server] s1 read pp=218645/261500 4119t/s 53s
|
||||
[server] s1 read pp=239957/261500 4114t/s 58s
|
||||
[server] s1 read pp=259273/261500 4089t/s 63s
|
||||
[server] live | s1 tg=1/16 | total 0t/s
|
||||
[server] s1 done pp=261500/0c 64.5s 4056t/s tg=2 6.8t/s acc=67% ttft=64.7s end=stop hit=25.1% pcie=0.0%
|
||||
[server] s1 read pp=13824/261500 2690t/s 5s
|
||||
[server] s1 read pp=27552/261500 2713t/s 10s
|
||||
[server] s1 read pp=41280/261500 2698t/s 15s
|
||||
[server] s1 read pp=54912/261500 2685t/s 20s
|
||||
[server] s1 read pp=68448/261500 2664t/s 26s
|
||||
[server] s1 read pp=81792/261500 2647t/s 31s
|
||||
[server] s1 read pp=95040/261500 2633t/s 36s
|
||||
[server] s1 read pp=108192/261500 2618t/s 41s
|
||||
[server] s1 read pp=121152/261500 2602t/s 47s
|
||||
[server] s1 read pp=133632/261500 2581t/s 52s
|
||||
[server] s1 read pp=146400/261500 2571t/s 57s
|
||||
[server] s1 read pp=158976/261500 2560t/s 62s
|
||||
[server] s1 read pp=171552/261500 2547t/s 67s
|
||||
[server] s1 read pp=183936/261500 2532t/s 73s
|
||||
[server] s1 read pp=196608/261500 2521t/s 78s
|
||||
[server] s1 read pp=209280/261500 2510t/s 83s
|
||||
[server] s1 read pp=221184/261500 2495t/s 89s
|
||||
[server] s1 read pp=233376/261500 2487t/s 94s
|
||||
[server] s1 read pp=245280/261500 2475t/s 99s
|
||||
[server] s1 read pp=257184/261500 2463t/s 104s
|
||||
[server] live | s1 tg=1/16 | total 0t/s
|
||||
[server] s1 done pp=261500/0c 106.8s 2448t/s tg=2 6.2t/s acc=67% ttft=107.0s end=stop hit=14.9% pcie=0.0%
|
||||
[server] live | s1 tg=5/504 5.5t/s | s2 tg=1/504 | total 6t/s
|
||||
[server] live | s1 tg=41/504 14.1t/s | s2 tg=41/504 20.4t/s | total 34t/s
|
||||
[server] live | s1 tg=81/504 16.1t/s | s2 tg=84/504 20.3t/s | total 36t/s
|
||||
[server] live | s1 tg=118/504 16.6t/s | s2 tg=129/504 20.8t/s | total 37t/s
|
||||
[server] live | s1 tg=171/504 18.7t/s | s2 tg=162/504 19.7t/s | total 38t/s
|
||||
[server] live | s1 tg=213/504 19.0t/s | s2 tg=207/504 20.1t/s | total 39t/s
|
||||
[server] live | s1 tg=255/504 19.1t/s | s2 tg=247/504 19.8t/s | total 39t/s
|
||||
[server] live | s1 tg=297/504 19.2t/s | s2 tg=285/504 19.6t/s | total 39t/s
|
||||
[server] live | s1 tg=336/504 19.1t/s | s2 tg=327/504 19.6t/s | total 39t/s
|
||||
[server] live | s1 tg=378/504 19.2t/s | s2 tg=372/504 19.8t/s | total 39t/s
|
||||
[server] live | s1 tg=414/504 19.0t/s | s2 tg=414/504 19.8t/s | total 39t/s
|
||||
[server] live | s1 tg=448/504 18.7t/s | s2 tg=455/504 19.7t/s | total 38t/s
|
||||
[server] live | s1 tg=490/504 18.8t/s | s2 tg=496/504 19.7t/s | total 39t/s
|
||||
[server] s2 done pp=261632/261493c 0.5s tg=504 19.6t/s acc=61% dl=1.7 ttft=1.6s end=length
|
||||
[server] s1 done pp=261632/261493c 0.6s tg=504 18.9t/s acc=60% dl=1.7 ttft=0.8s end=length hit=31.2% pcie=0.0%
|
||||
[server] stopping (Ctrl+C again to force)
|
||||
[server] stopped
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"engine": "strata",
|
||||
"started_at": 1793554963.2803357,
|
||||
"deadline": 1793556460.9617686,
|
||||
"context_per_slot": 262144,
|
||||
"initial_tokens": 261500,
|
||||
"final_tokens": 261632,
|
||||
"output_tokens": 504,
|
||||
"requests": [
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 0.029037983971647918,
|
||||
"first_content_at": null,
|
||||
"finished_at": 0.032633850001730025,
|
||||
"content": "",
|
||||
"usage": {},
|
||||
"timings": {},
|
||||
"stream_complete": false,
|
||||
"error": "RuntimeError: HTTP 400: {\"error\": {\"message\": \"Denkbudget: positive ganze Tokenzahl oder -1 f\\u00fcr unbegrenzt; 0 ist nicht backendneutral.\", \"type\": \"invalid_request_error\", \"param\": null, \"code\": \"invalid_request_error\"}}"
|
||||
}
|
||||
],
|
||||
"snapshots": [],
|
||||
"work_complete": false,
|
||||
"passed": false,
|
||||
"early_stop_budget": 231.99207850218517,
|
||||
"verified_properties": {
|
||||
"total_slots": 2,
|
||||
"default_generation_settings": {
|
||||
"n_ctx": 262144,
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 0.03278498299187049,
|
||||
"stop_reason": "request_failed",
|
||||
"error": "RuntimeError: HTTP 400: {\"error\": {\"message\": \"Denkbudget: positive ganze Tokenzahl oder -1 f\\u00fcr unbegrenzt; 0 ist nicht backendneutral.\", \"type\": \"invalid_request_error\", \"param\": null, \"code\": \"invalid_request_error\"}}"
|
||||
}
|
||||
@@ -0,0 +1,716 @@
|
||||
{
|
||||
"engine": "strata",
|
||||
"started_at": 1793555194.9898386,
|
||||
"deadline": 1793556460.9617686,
|
||||
"context_per_slot": 262144,
|
||||
"initial_tokens": 261500,
|
||||
"final_tokens": 261632,
|
||||
"output_tokens": 504,
|
||||
"requests": [
|
||||
{
|
||||
"tag": "A",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 0.06457248103106394,
|
||||
"first_content_at": 134.4906737000565,
|
||||
"finished_at": 134.57836158102145,
|
||||
"content": "OK",
|
||||
"usage": {
|
||||
"prompt_tokens": 261500,
|
||||
"completion_tokens": 2,
|
||||
"total_tokens": 261502,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 261500,
|
||||
"prompt_ms": 134167.8,
|
||||
"prompt_per_token_ms": 0.513,
|
||||
"prompt_per_second": 1949.1,
|
||||
"predicted_n": 2,
|
||||
"predicted_ms": 109.3,
|
||||
"predicted_per_token_ms": 54.65,
|
||||
"predicted_per_second": 18.3,
|
||||
"draft_n": 3,
|
||||
"draft_n_accepted": 3
|
||||
},
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop"
|
||||
},
|
||||
{
|
||||
"tag": "B",
|
||||
"phase": "preload",
|
||||
"maximum": 16,
|
||||
"started_at": 134.57894860202214,
|
||||
"first_content_at": null,
|
||||
"finished_at": 232.25433554302435,
|
||||
"content": "",
|
||||
"usage": {},
|
||||
"timings": {},
|
||||
"stream_complete": false
|
||||
}
|
||||
],
|
||||
"snapshots": [
|
||||
{
|
||||
"at": 1793555200.057153,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555200.0558207,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 60.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555205.0610237,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555205.0594864,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1887.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555210.065528,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555210.063582,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1998.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555215.068904,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555215.0675328,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2084.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555220.071983,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555220.0705934,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2100.6,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555225.07604,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555225.074163,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2113.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555230.0876691,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555230.0863626,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2120.5,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555235.091053,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555235.089577,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2118.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555240.0947769,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555240.0932806,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2118.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555245.099664,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555245.0973575,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2113.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555250.1032665,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555250.1017992,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2103.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555255.1067684,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555255.105219,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2098.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555260.1098335,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555260.1084738,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2093.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555265.114336,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555265.1120875,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2087.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555270.118712,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555270.116685,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2079.5,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555275.1224577,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555275.121063,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2064.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555280.1258013,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555280.1243658,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2058.5,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555285.1287785,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555285.1273372,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2050.4,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555290.1324544,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555290.1308792,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2043.4,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555295.1360543,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555295.134535,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2035.2,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555300.1391444,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555300.1377554,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2028.0,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555305.1422448,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555305.140902,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2019.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555310.1452308,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555310.143942,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2004.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555315.1482148,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555315.146833,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1994.5,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555320.1513176,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555320.1498532,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1986.4,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555325.1545882,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555325.1533017,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1979.3,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555330.158575,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555330.157082,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1949.0,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555335.1694772,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555335.16823,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1635.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555340.1726468,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555340.1713045,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 1900.2,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555345.1760924,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555345.1743436,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2008.5,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555350.179238,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555350.1778872,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2090.0,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555355.182781,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555355.1812756,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2104.0,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555360.1866937,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555360.185094,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2116.6,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555365.1897936,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555365.1884825,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2123.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555370.1932251,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555370.1917732,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2121.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555375.1970456,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555375.1953404,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2119.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555380.2005825,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555380.1990316,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2111.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555385.2043674,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555385.2028196,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2105.1,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555390.2157872,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555390.2145143,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2099.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555395.219717,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555395.2180724,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2092.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555400.2239592,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555400.2221503,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2087.0,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555405.2271414,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555405.225744,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2072.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555410.2304082,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555410.229071,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2064.8,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555415.2333264,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555415.2319975,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2057.9,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555420.2377527,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555420.2360256,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2049.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"at": 1793555425.2425077,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"sampled_at": 1793555425.2404025,
|
||||
"scope": "backend",
|
||||
"backend": "strata",
|
||||
"phase": "reading",
|
||||
"generation_tok_s": null,
|
||||
"prefill_tok_s": 2042.7,
|
||||
"active_slots": 0,
|
||||
"attribution": "unavailable"
|
||||
}
|
||||
}
|
||||
],
|
||||
"work_complete": false,
|
||||
"passed": false,
|
||||
"early_stop_budget": 231.99207850218517,
|
||||
"verified_properties": {
|
||||
"total_slots": 2,
|
||||
"default_generation_settings": {
|
||||
"n_ctx": 262144,
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 232.25683023204328,
|
||||
"stop_reason": "strata_proven_slower_total_work_lower_bound",
|
||||
"strata_elapsed_lower_bound_seconds": 232.2537018750445,
|
||||
"preload_seconds": 232.2546956380247,
|
||||
"error": "RuntimeError: Benchmark stopped before admission"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"method": "Compared actual active Strata GGUF sizes and SHA-256(first 64 MiB + last 64 MiB + little-endian uint64 size) with source records read from the verified Basalt pack metadata",
|
||||
"model": "Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS",
|
||||
"sources": [
|
||||
{
|
||||
"filename": "Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
|
||||
"size": 47039860096,
|
||||
"size_matches": true,
|
||||
"fingerprint": "2cc828488f9d622aed814d8f8944a3c787ce3880a3dbe915823f0123af7e3379",
|
||||
"source_fingerprint_matches": true
|
||||
},
|
||||
{
|
||||
"filename": "Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
|
||||
"size": 28800138432,
|
||||
"size_matches": true,
|
||||
"fingerprint": "d7860b7ebdddd9450948726843da988fdea64a08e451654ee17e1117eadb3c68",
|
||||
"source_fingerprint_matches": true
|
||||
}
|
||||
],
|
||||
"all_sources_match": true,
|
||||
"full_gguf_hash_comparison_performed": false,
|
||||
"full_runtime_tensor_equivalence_proven": false,
|
||||
"runtime_pack_difference": "Basalt includes HC8 and other packaged runtime-specific components; identical input GGUF variant is not proof of bit-identical internal arithmetic or every runtime tensor"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"started": 1793554540.9617686,
|
||||
"test_deadline": 1793555440.9617686,
|
||||
"comparison_deadline": 1793556460.9617686,
|
||||
"restore_deadline": 1793556640.9617686,
|
||||
"go": "Michael: repeat correctly, same test with Strata, stop Strata if demonstrably slower",
|
||||
"policy": "Stop only own Strata requests after Basalt total work time plus15percent and2seconds; leave original Strata loaded"
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"checked_at": 1793550917.391583,
|
||||
"manifest_entries": 8470,
|
||||
"logical_bytes": 81701843234,
|
||||
"logical_gib": 76.09,
|
||||
"manifest_independently_complete": true,
|
||||
"model_sha256_matches": "d02bb1b188bbc9ed6bc88ce5e89c7c2d64247290c7bae70fbb9d9d17fe65ed71",
|
||||
"production_unchanged": true,
|
||||
"owned_test_container_removed": true,
|
||||
"cleanup_fixture_passed": true,
|
||||
"candidate_retained": true,
|
||||
"weights_only_in_owned_candidate": true,
|
||||
"go_consumed": true,
|
||||
"restoration": {
|
||||
"restored": true,
|
||||
"checked_at": 1793550091.122105,
|
||||
"model": "flash-next-strata-iq3-dual",
|
||||
"protected_hashes_unchanged": 12,
|
||||
"container_image_start_unchanged": true,
|
||||
"production_health": "healthy",
|
||||
"owned_container_removed": true,
|
||||
"total_window_seconds": 382.50690150260925,
|
||||
"loaded": {
|
||||
"llm": true,
|
||||
"tts": true,
|
||||
"stt": true
|
||||
},
|
||||
"authenticated_gui_loaded_readback": true,
|
||||
"original_restore_probe_passed": true,
|
||||
"restore_probe_used_as_benchmark": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,635 @@
|
||||
{
|
||||
"test": {
|
||||
"started": 1793549816.993339,
|
||||
"client_budget_seconds": 480,
|
||||
"model": "athena-basalt-iq3xxs-test",
|
||||
"historical_reference_not_controlled": true,
|
||||
"requests": [
|
||||
{
|
||||
"content": "# Datensicherung: Strategien, Methoden und Best Practices für die digitale Resilienz\n\nIn der modernen, digitalisierten Welt sind Daten das wertvollste Gut eines Unternehmens, einer Institution oder eines einzelnen Individuums. Sie bilden das Fundament für operative Prozesse, strategische Entscheidungen und die Bewahrung historischer Informationen. Doch die Abhängigkeit von digitalen Daten bringt erhebliche Risiken mit sich. Hardware-Ausfälle, menschliche Fehler, Cyberangriffe wie Ransomware, Naturkatastrophen oder schlichte Softwarefehler können zu einem vollständigen Datenverlust führen. Die Datensicherung, oft als Backup bezeichnet, ist daher keine optionale Zusatzleistung, sondern eine zentrale Säule der IT-Sicherheit und der betrieblichen Kontinuitätsplanung (Business Continuity Planning). Dieser Fachtext beleuchtet die grundlegenden Konzepte, die verschiedenen Backup-Strategien, die technischen Implementierungen sowie die aktuellen Herausforderungen im Bereich der Datensicherung.\n\n## Die Notwendigkeit und die Ziele der Datensicherung\n\nDer primäre Zweck der Datensicherung besteht darin, Kopien von Daten zu erstellen, die im Falle eines Datenverlusts zur Wiederherstellung genutzt werden können. Es geht nicht nur darum, Daten zu kopieren, sondern darum, eine funktionierende und verifizierbare Wiederherstellungsstrategie zu etablieren. Ein Backup ist dann erfolgreich, wenn die Daten nicht nur gespeichert, sondern auch in einem definierten Zeitrahmen (Recovery Time Objective, RTO) und mit einem definierten Datenverlust (Recovery Point Objective, RPO) wiederhergestellt werden können.\n\nOhne eine robuste Backup-Strategie sind Organisationen extrem verwundbar. Studien zeigen, dass ein erheblicher Anteil kleiner und mittelständischer Unternehmen, die einen schweren Datenverlust erleiden, innerhalb von zwei Jahren schließen müssen. Die Datensicherung dient somit der Risikominderung. Sie schützt vor:\n1. **Hardware-Fehlern:** Festplatten, SSDs und Server haben eine begrenzte Lebensdauer.\n2. **Menschlichem Versagen:** Versehentliches Löschen, Überschreiben oder fehlerhafte Konfigurationen.\n3. **Cyberbedrohungen:** Ransomware verschlüsselt Daten und löscht oft Backups, wenn diese nicht isoliert sind.\n4. **Physischen Katastrophen:** Brände, Überschwemmungen oder Diebstahl können lokale Speichermedien zerstören.\n\n## Die 3-2-1-Regel: Der Goldstandard der Datens",
|
||||
"usage": {
|
||||
"prompt_tokens": 56,
|
||||
"completion_tokens": 512,
|
||||
"total_tokens": 568,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 56,
|
||||
"prompt_ms": 953.7,
|
||||
"prompt_per_token_ms": 17.03,
|
||||
"prompt_per_second": 58.7,
|
||||
"predicted_n": 512,
|
||||
"predicted_ms": 7173.3,
|
||||
"predicted_per_token_ms": 14.01,
|
||||
"predicted_per_second": 71.4,
|
||||
"draft_n": 364,
|
||||
"draft_n_accepted": 224
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "length",
|
||||
"label": "solo-512",
|
||||
"wall_seconds": 8.141315011016559,
|
||||
"ttft_seconds": 1.0895000720047392
|
||||
},
|
||||
{
|
||||
"content": "# Datensicherung: Strategien, Methoden und Best Practices für die digitale Resilienz\n\nIn der modernen, digitalisierten Welt ist Information das wertvollste Gut eines Unternehmens. Ob es sich um sensible Kundenstammdaten, komplexe Konstruktionspläne, Finanztransaktionen oder wissenschaftliche Forschungsdaten handelt – der Verlust dieser Informationen kann existenzbedrohende Folgen haben. Datensicherung, oft als Backup bezeichnet, ist daher keine optionale Zusatzleistung, sondern eine fundamentale Säule der IT-Infrastruktur und der betrieblichen Kontinuitätsplanung (Business Continuity Planning). Dieser Fachtext beleuchtet die theoretischen Grundlagen, die technischen Methoden, die organisatorischen Herausforderungen und die aktuellen Trends im Bereich der Datensicherung.\n\n## Die Notwendigkeit der Datensicherung: Risiken und Bedrohungen\n\nUm die Bedeutung der Datensicherung zu verstehen, muss man zunächst die Bedrohungen betrachten, gegen die sie schützt. Die Ursachen für Datenverlust sind vielfältig und reichen von banalen menschlichen Fehlern bis hin zu hochkomplexen Cyberangriffen.\n\nErstens sind **menschliche Fehler** eine der häufigsten Ursachen. Ein versehentliches Löschen einer Datei, eine fehlerhafte Konfiguration eines Servers oder das Überschreiben von Daten durch falsche Eingaben sind alltägliche Vorfälle. Zweitens spielen **technische Defekte** eine Rolle. Festplatten haben eine begrenzte Lebensdauer, SSDs können durch Schreibzyklen ausfallen, und RAID-Systeme sind zwar redundant, aber nicht unfehlbar. Hardware-Ausfälle sind statistisch gesehen unvermeidbar.\n\nDrittens, und in den letzten Jahren zunehmend dominant, sind **Cyberangriffe**. Ransomware, bei der Daten verschlüsselt und gegen Lösegeld freigegeben werden, hat sich zu einer der größten Bedrohungen für Unternehmen entwickelt. Auch Insider-Bedrohungen, bei denen Mitarbeiter absichtlich Daten stehlen oder manipulieren, stellen ein erhebliches Risiko dar.\n\nSchließlich dürfen **physische Katastrophen** nicht ignoriert werden. Brände, Überschwemmungen, Erdbeben oder Diebstahl können physische Speichermedien zerstören. Eine Datensicherung, die nur lokal im selben Gebäude gespeichert ist, bietet in solchen Szenarien keinen Schutz.\n\n## Grundlegende Prinzipien: Die 3-2-1-Regel\n\nDas goldene Standardmodell für eine robuste Datensicherungsstrategie ist die **",
|
||||
"usage": {
|
||||
"prompt_tokens": 61,
|
||||
"completion_tokens": 512,
|
||||
"total_tokens": 573,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 61,
|
||||
"prompt_ms": 950.9,
|
||||
"prompt_per_token_ms": 15.589,
|
||||
"prompt_per_second": 64.1,
|
||||
"predicted_n": 512,
|
||||
"predicted_ms": 762.3,
|
||||
"predicted_per_token_ms": 17.728,
|
||||
"predicted_per_second": 56.4,
|
||||
"draft_n": 352,
|
||||
"draft_n_accepted": 209
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "length",
|
||||
"label": "parallel-512-0",
|
||||
"wall_seconds": 13.763757278007688,
|
||||
"ttft_seconds": 2.163895653007785
|
||||
},
|
||||
{
|
||||
"content": "# Home Assistant: Die Architektur der offenen Smart-Home-Automatisierung\n\nIn der modernen Landschaft der intelligenten Gebäudeautomation hat sich eine klare Dichotomie zwischen proprietären, cloud-zentrierten Ökosystemen und offenen, lokal gesteuerten Plattformen herausgebildet. Während Anbieter wie Amazon Alexa, Google Home oder Apple HomeKit oft auf Benutzerfreundlichkeit und nahtlose Integration setzen, aber häufig Abhängigkeiten von externen Servern und Datenschutzbedenken mit sich bringen, positioniert sich **Home Assistant** als das Gegenmodell. Es ist eine Open-Source-Softwareplattform, die darauf ausgelegt ist, die volle Kontrolle über das eigene Smart Home in die Hände des Nutzers zu legen. Dieser Fachtext beleuchtet die technische Architektur, die Funktionsweise, die Integrationsvielfalt sowie die philosophischen und praktischen Implikationen von Home Assistant im Kontext der heutigen IoT-Landschaft (Internet of Things).\n\n## Die philosophische Grundlage: Lokalität und Privatsphäre\n\nDer Kern von Home Assistant liegt nicht nur in seiner technischen Funktionalität, sondern in seiner zugrunde liegenden Philosophie. Im Gegensatz zu vielen kommerziellen Smart-Home-Systemen, die Daten zur Analyse in die Cloud senden, operiert Home Assistant primär lokal. Das bedeutet, dass die Logik für Automatisierungen, die Speicherung von Zuständen und die Steuerung von Geräten auf einem lokalen Server (oft ein Raspberry Pi, ein Mini-PC oder ein NAS) stattfinden. Diese Architektur bietet mehrere entscheidende Vorteile:\n\n1. **Datenschutz:** Da keine Daten an externe Server gesendet werden müssen, um das System funktionsfähig zu halten, bleibt die Privatsphäre des Nutzers gewahrt. Sensordaten, Nutzungsprofile und Verhaltensmuster verbleiben im eigenen Netzwerk.\n2. **Zuverlässigkeit und Latenz:** Cloud-basierte Systeme sind anfällig für Internetverbindungsprobleme. Home Assistant funktioniert auch dann, wenn die Internetverbindung abbricht. Die Reaktionszeiten sind zudem oft kürzer, da die Befehle nicht erst über externe Server umgeleitet werden müssen.\n3. **Unabhängigkeit von Herstellern:** Proprietäre Ökosysteme neigen dazu, nur Geräte zu unterstützen, die in ihrem eigenen Partnerprogramm sind. Home Assistant hingegen ist herstellerneutral. Es kann Geräte von Zigbee, Z-Wave, Wi-Fi, Bluetooth, Matter und vielen anderen Protokollen integrieren, unabhängig davon, ob der",
|
||||
"usage": {
|
||||
"prompt_tokens": 56,
|
||||
"completion_tokens": 512,
|
||||
"total_tokens": 568,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 56,
|
||||
"prompt_ms": 969.6,
|
||||
"prompt_per_token_ms": 17.314,
|
||||
"prompt_per_second": 57.8,
|
||||
"predicted_n": 512,
|
||||
"predicted_ms": 11850.1,
|
||||
"predicted_per_token_ms": 23.19,
|
||||
"predicted_per_second": 43.1,
|
||||
"draft_n": 338,
|
||||
"draft_n_accepted": 228
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "length",
|
||||
"label": "parallel-512-1",
|
||||
"wall_seconds": 12.958067108003888,
|
||||
"ttft_seconds": 1.0948563019919675
|
||||
},
|
||||
{
|
||||
"content": "ORION_029_A",
|
||||
"usage": {
|
||||
"prompt_tokens": 7420,
|
||||
"completion_tokens": 8,
|
||||
"total_tokens": 7428,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 7420,
|
||||
"prompt_ms": 1916.8,
|
||||
"prompt_per_token_ms": 0.258,
|
||||
"prompt_per_second": 3871.0,
|
||||
"predicted_n": 8,
|
||||
"predicted_ms": 2062.2,
|
||||
"predicted_per_token_ms": 294.6,
|
||||
"predicted_per_second": 3.4,
|
||||
"draft_n": 7,
|
||||
"draft_n_accepted": 5
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "fresh-context-pair-0",
|
||||
"wall_seconds": 4.166197038983228,
|
||||
"ttft_seconds": 2.0890192619990557
|
||||
},
|
||||
{
|
||||
"content": "VEGA_029_B",
|
||||
"usage": {
|
||||
"prompt_tokens": 7420,
|
||||
"completion_tokens": 8,
|
||||
"total_tokens": 7428,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 7420,
|
||||
"prompt_ms": 2001.7,
|
||||
"prompt_per_token_ms": 0.27,
|
||||
"prompt_per_second": 3706.8,
|
||||
"predicted_n": 8,
|
||||
"predicted_ms": 184.1,
|
||||
"predicted_per_token_ms": 36.82,
|
||||
"predicted_per_second": 27.2,
|
||||
"draft_n": 14,
|
||||
"draft_n_accepted": 7
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "fresh-context-pair-1",
|
||||
"wall_seconds": 4.721308364009019,
|
||||
"ttft_seconds": 4.288342759013176
|
||||
},
|
||||
{
|
||||
"content": "ORION_029_A",
|
||||
"usage": {
|
||||
"prompt_tokens": 7457,
|
||||
"completion_tokens": 8,
|
||||
"total_tokens": 7465,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 7427
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 7427,
|
||||
"prompt_n": 30,
|
||||
"prompt_ms": 347.1,
|
||||
"prompt_per_token_ms": 11.57,
|
||||
"prompt_per_second": 86.4,
|
||||
"predicted_n": 8,
|
||||
"predicted_ms": 198.6,
|
||||
"predicted_per_token_ms": 28.371,
|
||||
"predicted_per_second": 35.2,
|
||||
"draft_n": 7,
|
||||
"draft_n_accepted": 5
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "cached-context-pair-0",
|
||||
"wall_seconds": 0.6599048889765982,
|
||||
"ttft_seconds": 0.44635216798633337
|
||||
},
|
||||
{
|
||||
"content": "VEGA_029_B",
|
||||
"usage": {
|
||||
"prompt_tokens": 7457,
|
||||
"completion_tokens": 8,
|
||||
"total_tokens": 7465,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 7413
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 7413,
|
||||
"prompt_n": 44,
|
||||
"prompt_ms": 556.2,
|
||||
"prompt_per_token_ms": 12.641,
|
||||
"prompt_per_second": 79.1,
|
||||
"predicted_n": 8,
|
||||
"predicted_ms": 98.4,
|
||||
"predicted_per_token_ms": 19.68,
|
||||
"predicted_per_second": 50.8,
|
||||
"draft_n": 13,
|
||||
"draft_n_accepted": 6
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "cached-context-pair-1",
|
||||
"wall_seconds": 1.441102206998039,
|
||||
"ttft_seconds": 1.15489095900557
|
||||
},
|
||||
{
|
||||
"content": "ALPHA_029\nOMEGA_029",
|
||||
"usage": {
|
||||
"prompt_tokens": 60047,
|
||||
"completion_tokens": 14,
|
||||
"total_tokens": 60061,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 60047,
|
||||
"prompt_ms": 11681.4,
|
||||
"prompt_per_token_ms": 0.195,
|
||||
"prompt_per_second": 5140.4,
|
||||
"predicted_n": 14,
|
||||
"predicted_ms": 337.5,
|
||||
"predicted_per_token_ms": 24.107,
|
||||
"predicted_per_second": 41.5,
|
||||
"draft_n": 19,
|
||||
"draft_n_accepted": 13
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "long-context-retrieval",
|
||||
"wall_seconds": 12.05722963399603,
|
||||
"ttft_seconds": 11.765940587996738
|
||||
},
|
||||
{
|
||||
"content": "{\"ok\":true,\"marker\":\"ATHENA029\"}",
|
||||
"usage": {
|
||||
"prompt_tokens": 38,
|
||||
"completion_tokens": 14,
|
||||
"total_tokens": 52,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 38,
|
||||
"prompt_ms": 450.7,
|
||||
"prompt_per_token_ms": 11.861,
|
||||
"prompt_per_second": 84.3,
|
||||
"predicted_n": 14,
|
||||
"predicted_ms": 315.3,
|
||||
"predicted_per_token_ms": 22.521,
|
||||
"predicted_per_second": 44.4,
|
||||
"draft_n": 16,
|
||||
"draft_n_accepted": 14
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "json",
|
||||
"wall_seconds": 0.8031282690062653,
|
||||
"ttft_seconds": 0.5288593270233832
|
||||
},
|
||||
{
|
||||
"content": "Ich rufe lookup_order für die Bestellung TEST-029 auf.",
|
||||
"usage": {
|
||||
"prompt_tokens": 290,
|
||||
"completion_tokens": 48,
|
||||
"total_tokens": 338,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 290,
|
||||
"prompt_ms": 1075.2,
|
||||
"prompt_per_token_ms": 3.708,
|
||||
"prompt_per_second": 269.7,
|
||||
"predicted_n": 48,
|
||||
"predicted_ms": 746.1,
|
||||
"predicted_per_token_ms": 15.544,
|
||||
"predicted_per_second": 64.3,
|
||||
"draft_n": 49,
|
||||
"draft_n_accepted": 40
|
||||
},
|
||||
"tool_calls": [
|
||||
{
|
||||
"id": "call_edbf0ab6f8ff447fad635f74",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "lookup_order",
|
||||
"arguments": "{\"order_id\":\"TEST-029\"}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "tool_calls",
|
||||
"label": "mock-tool-call",
|
||||
"wall_seconds": 1.8477112609834876,
|
||||
"ttft_seconds": 1.1111738350009546
|
||||
},
|
||||
{
|
||||
"content": "Die Bestellung **TEST-029** hat den Status **READY**.",
|
||||
"usage": {
|
||||
"prompt_tokens": 111,
|
||||
"completion_tokens": 16,
|
||||
"total_tokens": 127,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
}
|
||||
},
|
||||
"timings": {
|
||||
"cache_n": 0,
|
||||
"prompt_n": 111,
|
||||
"prompt_ms": 326.4,
|
||||
"prompt_per_token_ms": 2.941,
|
||||
"prompt_per_second": 340.1,
|
||||
"predicted_n": 16,
|
||||
"predicted_ms": 267.2,
|
||||
"predicted_per_token_ms": 16.7,
|
||||
"predicted_per_second": 59.9,
|
||||
"draft_n": 15,
|
||||
"draft_n_accepted": 10
|
||||
},
|
||||
"tool_calls": [],
|
||||
"stream_complete": true,
|
||||
"finish_reason": "stop",
|
||||
"label": "mock-tool-result",
|
||||
"wall_seconds": 0.6197226489894092,
|
||||
"ttft_seconds": 0.3876685779832769
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"label": "parallel-512",
|
||||
"wall_seconds": 13.765592798998114,
|
||||
"output_tokens": 1024,
|
||||
"end_to_end_output_tokens_per_second": 74.38836924440542
|
||||
},
|
||||
{
|
||||
"label": "fresh-context-pair",
|
||||
"wall_seconds": 4.721667356992839,
|
||||
"output_tokens": 16,
|
||||
"end_to_end_output_tokens_per_second": 3.388633461504617
|
||||
},
|
||||
{
|
||||
"label": "cached-context-pair",
|
||||
"wall_seconds": 1.441468163015088,
|
||||
"output_tokens": 16,
|
||||
"end_to_end_output_tokens_per_second": 11.099794230996503
|
||||
}
|
||||
],
|
||||
"passed": true,
|
||||
"verified_slots": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 0,
|
||||
"drafts_offered": null,
|
||||
"drafts_accepted": null
|
||||
}
|
||||
],
|
||||
"elapsed_seconds": 43.42267671698937,
|
||||
"cache_slot_snapshot": [
|
||||
{
|
||||
"id": 0,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 7465,
|
||||
"drafts_offered": 7,
|
||||
"drafts_accepted": 0
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"n_ctx": 262144,
|
||||
"is_processing": false,
|
||||
"state": "idle",
|
||||
"api": null,
|
||||
"model": null,
|
||||
"tok_s": 0.0,
|
||||
"generated": 0,
|
||||
"max_tokens": null,
|
||||
"prompt_tokens": 0,
|
||||
"prefill_done": 0,
|
||||
"reused": null,
|
||||
"ttft_s": null,
|
||||
"draft_len": null,
|
||||
"ctx_used": 7465,
|
||||
"drafts_offered": 13,
|
||||
"drafts_accepted": 6
|
||||
}
|
||||
]
|
||||
},
|
||||
"runner": {
|
||||
"started": 1793549783.8752985,
|
||||
"deadline": 1793550428.6152046,
|
||||
"production_modified_by_runner": false,
|
||||
"passed": true,
|
||||
"phase": "candidate stopped; outer operator must restore original Strata/Qwen",
|
||||
"updated": 1793549862.1543162,
|
||||
"load_seconds": 33.07659959793091,
|
||||
"server_exit_code": 0
|
||||
},
|
||||
"restoration": {
|
||||
"restored": true,
|
||||
"checked_at": 1793550091.122105,
|
||||
"model": "flash-next-strata-iq3-dual",
|
||||
"protected_hashes_unchanged": 12,
|
||||
"container_image_start_unchanged": true,
|
||||
"production_health": "healthy",
|
||||
"owned_container_removed": true,
|
||||
"total_window_seconds": 382.50690150260925,
|
||||
"loaded": {
|
||||
"llm": true,
|
||||
"tts": true,
|
||||
"stt": true
|
||||
},
|
||||
"authenticated_gui_loaded_readback": true,
|
||||
"original_restore_probe_passed": true,
|
||||
"restore_probe_used_as_benchmark": false
|
||||
},
|
||||
"model": {
|
||||
"repo": "jesdga/Qwen3.8-Flash-Next-Basalt",
|
||||
"revision": "c0e57437ea564aa85263ab0bc0ee83568dd53213",
|
||||
"filename": "Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt",
|
||||
"bytes": 79867643037,
|
||||
"sha256": "d02bb1b188bbc9ed6bc88ce5e89c7c2d64247290c7bae70fbb9d9d17fe65ed71",
|
||||
"header_readable_by_pinned_build": true,
|
||||
"section_count": 19,
|
||||
"sections": {
|
||||
"tokenizer/chat_template.jinja": {
|
||||
"offset": 2097152,
|
||||
"bytes": 9993
|
||||
},
|
||||
"tokenizer/merges.txt": {
|
||||
"offset": 4194304,
|
||||
"bytes": 3353258
|
||||
},
|
||||
"tokenizer/token_type.json": {
|
||||
"offset": 8388608,
|
||||
"bytes": 744960
|
||||
},
|
||||
"tokenizer/tokenizer.json": {
|
||||
"offset": 10485760,
|
||||
"bytes": 541
|
||||
},
|
||||
"tokenizer/vocab.json": {
|
||||
"offset": 12582912,
|
||||
"bytes": 5737005
|
||||
},
|
||||
"dense": {
|
||||
"offset": 18874368,
|
||||
"bytes": 1538035200
|
||||
},
|
||||
"dense.index": {
|
||||
"offset": 1558183936,
|
||||
"bytes": 93571
|
||||
},
|
||||
"experts": {
|
||||
"offset": 1560281088,
|
||||
"bytes": 42912972800
|
||||
},
|
||||
"experts.layout": {
|
||||
"offset": 44474302464,
|
||||
"bytes": 3282
|
||||
},
|
||||
"gguf": {
|
||||
"offset": 44476399616,
|
||||
"bytes": 32916868096
|
||||
},
|
||||
"mtp/dense": {
|
||||
"offset": 77393297408,
|
||||
"bytes": 116099072
|
||||
},
|
||||
"mtp/dense.index": {
|
||||
"offset": 77510737920,
|
||||
"bytes": 1851
|
||||
},
|
||||
"mtp/experts": {
|
||||
"offset": 77512835072,
|
||||
"bytes": 707788800
|
||||
},
|
||||
"mtp/draft_vocab": {
|
||||
"offset": 78221672448,
|
||||
"bytes": 425196
|
||||
},
|
||||
"profile": {
|
||||
"offset": 78223769600,
|
||||
"bytes": 196628
|
||||
},
|
||||
"hc8": {
|
||||
"offset": 78225866752,
|
||||
"bytes": 712920832
|
||||
},
|
||||
"vision/mmproj": {
|
||||
"offset": 78938898432,
|
||||
"bytes": 907543008
|
||||
},
|
||||
"vision/text_vocab": {
|
||||
"offset": 79846965248,
|
||||
"bytes": 10946560
|
||||
},
|
||||
"meta": {
|
||||
"offset": 79859548160,
|
||||
"bytes": 8094877
|
||||
}
|
||||
},
|
||||
"metadata_keys": [
|
||||
"converter",
|
||||
"format",
|
||||
"gguf_kv",
|
||||
"hc8",
|
||||
"license",
|
||||
"name",
|
||||
"profile",
|
||||
"sampling",
|
||||
"sources",
|
||||
"tensors",
|
||||
"version",
|
||||
"vision"
|
||||
],
|
||||
"activated": false,
|
||||
"inference_performed": false
|
||||
},
|
||||
"source": {
|
||||
"repo": "jesdga/Qwen3.8-Flash-Next-Basalt",
|
||||
"revision": "c0e57437ea564aa85263ab0bc0ee83568dd53213",
|
||||
"filename": "Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt",
|
||||
"size": 79867643037,
|
||||
"sha256": "d02bb1b188bbc9ed6bc88ce5e89c7c2d64247290c7bae70fbb9d9d17fe65ed71",
|
||||
"source": "https://huggingface.co/jesdga/Qwen3.8-Flash-Next-Basalt",
|
||||
"quantization": "GSQ-RCO IQ3_XXS",
|
||||
"license": "Qwen Community License 1.0",
|
||||
"purpose": "prepare-only; no production unload, model loading or inference authorized"
|
||||
},
|
||||
"gpu_selection": {
|
||||
"gpu_plan": {
|
||||
"devices": "GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe",
|
||||
"cards": [
|
||||
{
|
||||
"visible": 0,
|
||||
"token": "GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe",
|
||||
"smi": 0,
|
||||
"name": "RTX 5080"
|
||||
}
|
||||
],
|
||||
"notes": [],
|
||||
"warning": "",
|
||||
"error": ""
|
||||
},
|
||||
"model_loaded": false,
|
||||
"inference_performed": false,
|
||||
"production_unchanged": true
|
||||
},
|
||||
"configuration": {
|
||||
"parallel": 2,
|
||||
"slot_full_context": true,
|
||||
"engine_words": [
|
||||
"--max-context",
|
||||
"262144",
|
||||
"--kv",
|
||||
"int8",
|
||||
"--expert-cache",
|
||||
"auto",
|
||||
"--prefill",
|
||||
"auto",
|
||||
"--resident-experts",
|
||||
"--batch",
|
||||
"2"
|
||||
],
|
||||
"model": "/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/models/Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt",
|
||||
"alias": "athena-basalt-iq3xxs-test",
|
||||
"vision": "off",
|
||||
"all_engine_flags_accepted": true,
|
||||
"server_started": false,
|
||||
"inference_performed": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside the owned candidate container: CPU-only preparation, or approved full-slot test.
|
||||
|
||||
Use --prepare without GPUs before maintenance. --go requires a fresh absolute
|
||||
window deadline. All input/output is synthetic; no production API is contacted.
|
||||
"""
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import importlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
BASE = 'http://127.0.0.1:18320'
|
||||
MODEL = 'athena-basalt-iq3xxs-test'
|
||||
CONTEXT = 262144
|
||||
OUTPUT = 504
|
||||
TARGET = CONTEXT - 512
|
||||
|
||||
|
||||
def save(path, value):
|
||||
path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == value
|
||||
|
||||
|
||||
def prepare():
|
||||
sys.path[:0] = [str(ROOT / 'source'), str(ROOT / 'source/tools')]
|
||||
ST = importlib.import_module('tokenizer')
|
||||
ModelFile = importlib.import_module('model_file').ModelFile
|
||||
extract_tokenizer = importlib.import_module('serve.engine.modelfile').extract_tokenizer
|
||||
ChatTemplate = importlib.import_module('serve.frontend').ChatTemplate
|
||||
Service = importlib.import_module('serve.service').Service
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
directory = extract_tokenizer(ModelFile(ROOT / 'models' / source['filename']))
|
||||
vocab = json.loads((directory / 'vocab.json').read_text())
|
||||
tokens = [None] * len(vocab)
|
||||
for text, index in vocab.items():
|
||||
tokens[index] = text
|
||||
tok = ST.Tokenizer(tokens, (directory / 'merges.txt').read_text().split('\n'),
|
||||
json.loads((directory / 'token_type.json').read_text()))
|
||||
template = directory / 'chat_template.jinja'
|
||||
if not template.exists():
|
||||
template = ROOT / 'source/serve/chat_template.jinja'
|
||||
# Token counting only: no model engine, GPU, inference or generated result.
|
||||
service = Service(SimpleNamespace(max_context=CONTEXT), tok, ChatTemplate(template))
|
||||
docs = []
|
||||
for slot in ('A', 'B'):
|
||||
rows = [f'Archiv {slot} Zeile {n:05d}: Standort {"West" if slot == "A" else "Ost"}, '
|
||||
f'Bauteil {(n * 71 + 19) % 10007:05d}, Freigabe dokumentiert.\n'
|
||||
for n in range(16000)]
|
||||
ending = ('\nEnde des synthetischen Archivs. Schreibe jetzt einen ausführlichen '
|
||||
'deutschen Fachtext mit mindestens 1200 Wörtern über zuverlässige '
|
||||
'Datensicherung. Beginne mit der Anfangskennung. Keine Rückfragen.')
|
||||
|
||||
def messages(count, padding):
|
||||
return [{'role': 'system', 'content': f'Unabhängiger Vollkontext-Test {slot}. '
|
||||
f'Anfangskennung BASALT_FULL_{slot}. Schreibe auf Deutsch.'},
|
||||
{'role': 'user', 'content': ''.join(rows[:count]) + ' x' * padding + ending}]
|
||||
|
||||
def length(value):
|
||||
return len(service.encode_prompt(value, None, {'enable_thinking': False}))
|
||||
|
||||
low, high = 0, len(rows)
|
||||
while low < high:
|
||||
middle = (low + high + 1) // 2
|
||||
if length(messages(middle, 0)) <= TARGET:
|
||||
low = middle
|
||||
else:
|
||||
high = middle - 1
|
||||
count = low
|
||||
missing = TARGET - length(messages(count, 0))
|
||||
assert 0 <= missing < 100
|
||||
# Joining padding to the following newline can change one BPE token.
|
||||
actual = 0
|
||||
padded = messages(count, 0)
|
||||
for padding in range(max(0, missing - 2), missing + 3):
|
||||
padded = messages(count, padding)
|
||||
actual = length(padded)
|
||||
if actual == TARGET:
|
||||
break
|
||||
else:
|
||||
raise AssertionError((slot, actual, TARGET))
|
||||
docs.append(dict(slot=slot, prompt_tokens=actual, max_tokens=OUTPUT, messages=padded))
|
||||
path = ROOT / 'full-fixtures.json'
|
||||
assert not path.exists(), 'Inspect existing full-context fixture rather than overwrite'
|
||||
save(path, docs)
|
||||
print(json.dumps(dict(prepared=True, inference=False, prompt_tokens=[d['prompt_tokens'] for d in docs],
|
||||
output_room=OUTPUT, context_per_slot=CONTEXT)), flush=True)
|
||||
|
||||
|
||||
def run(deadline):
|
||||
from test_client import parse_sse
|
||||
assert time.time() < deadline <= time.time() + 720
|
||||
path = ROOT / 'full2-results.json'
|
||||
assert not path.exists(), 'Never silently repeat full-context inference'
|
||||
docs = json.loads((ROOT / 'full-fixtures.json').read_text())
|
||||
assert len(docs) == 2 and all(d['prompt_tokens'] == TARGET for d in docs)
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=deadline, context_per_slot=CONTEXT,
|
||||
prompt_tokens_per_slot=TARGET, output_room_per_slot=OUTPUT,
|
||||
phases=[], passed=False, both_full_slots_decoding_observed=False)
|
||||
|
||||
def persist():
|
||||
result['elapsed_seconds'] = time.time() - result['started']
|
||||
save(path, result)
|
||||
|
||||
def get(route):
|
||||
with urllib.request.urlopen(BASE + route, timeout=3) as response:
|
||||
return json.load(response)
|
||||
|
||||
def request(document, maximum, barrier) -> dict[str, Any]:
|
||||
barrier.wait(timeout=10)
|
||||
began = time.monotonic()
|
||||
first = []
|
||||
body = dict(model=MODEL, messages=document['messages'], max_tokens=maximum,
|
||||
temperature=0, seed=42, reasoning_effort='none', stream=True,
|
||||
stream_options={'include_usage': True})
|
||||
req = urllib.request.Request(BASE + '/v1/chat/completions',
|
||||
data=json.dumps(body).encode(), headers={'Content-Type': 'application/json'})
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=max(1, min(600, deadline - time.time()))) as response:
|
||||
def lines():
|
||||
for line in response:
|
||||
if time.time() >= deadline:
|
||||
raise TimeoutError('Full-context deadline; restore original runtime')
|
||||
yield line
|
||||
row = parse_sse(lines(), lambda: first.append(time.monotonic() - began))
|
||||
row.update(slot=document['slot'], wall_seconds=time.monotonic() - began,
|
||||
ttft_seconds=first[0] if first else None)
|
||||
assert row['usage']['prompt_tokens'] == TARGET, 'Actual backend input differs from fixture'
|
||||
return row
|
||||
except urllib.error.HTTPError as error:
|
||||
return dict(slot=document['slot'], http_error=error.code,
|
||||
error_body=error.read().decode(), wall_seconds=time.monotonic() - began)
|
||||
except Exception as error:
|
||||
return dict(slot=document['slot'], error=type(error).__name__ + ': ' + str(error),
|
||||
wall_seconds=time.monotonic() - began)
|
||||
|
||||
def pair(label, maximum):
|
||||
phase: dict[str, Any] = dict(label=label, maximum_output_tokens=maximum, snapshots=[], requests=[])
|
||||
result['phases'].append(phase)
|
||||
persist()
|
||||
began = time.monotonic()
|
||||
barrier = threading.Barrier(2)
|
||||
heartbeat = began
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
|
||||
jobs = [pool.submit(request, document, maximum, barrier) for document in docs]
|
||||
while not all(job.done() for job in jobs):
|
||||
if time.time() >= deadline:
|
||||
raise TimeoutError('Hard full-context client deadline')
|
||||
try:
|
||||
slots = get('/slots')
|
||||
phase['snapshots'].append(dict(at=time.time(), slots=slots))
|
||||
if all(s.get('state') == 'decoding' and s.get('prompt_tokens') == TARGET for s in slots) and len(slots) == 2:
|
||||
result['both_full_slots_decoding_observed'] = True
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
if time.monotonic() - heartbeat >= 20:
|
||||
heartbeat = time.monotonic()
|
||||
persist()
|
||||
print(json.dumps(dict(phase=label, elapsed=time.monotonic() - began,
|
||||
last_snapshot=phase['snapshots'][-1:])), flush=True)
|
||||
time.sleep(0.5)
|
||||
phase['requests'] = [job.result() for job in jobs]
|
||||
phase['wall_seconds'] = time.monotonic() - began
|
||||
phase['output_tokens'] = sum(row.get('usage', {}).get('completion_tokens', 0) for row in phase['requests'])
|
||||
phase['end_to_end_output_tokens_per_second'] = phase['output_tokens'] / phase['wall_seconds']
|
||||
phase['accepted_both'] = all('usage' in row for row in phase['requests'])
|
||||
phase['final_slots'] = get('/slots')
|
||||
persist()
|
||||
return phase
|
||||
|
||||
try:
|
||||
props = get('/props')
|
||||
slots = get('/slots')
|
||||
assert props['total_slots'] == 2 and props['default_generation_settings']['n_ctx'] == CONTEXT
|
||||
assert len(slots) == 2 and all(s['n_ctx'] == CONTEXT and not s['is_processing'] for s in slots)
|
||||
result['initial_slots'] = slots
|
||||
# Separate input speed from output speed. First read two full, different
|
||||
# documents with one output token each; then reuse them for parallel decode.
|
||||
cold = pair('fresh-two-full-inputs', 1)
|
||||
if not cold['accepted_both']:
|
||||
result['capacity_rejected'] = True
|
||||
return
|
||||
cold['combined_input_tokens_per_wall_second'] = 2 * TARGET / cold['wall_seconds']
|
||||
warm = pair('cached-two-full-outputs', OUTPUT)
|
||||
result['passed'] = (warm['accepted_both'] and result['both_full_slots_decoding_observed']
|
||||
and all(row['usage']['completion_tokens'] == OUTPUT for row in warm['requests']))
|
||||
result['cached_tokens'] = [row.get('usage', {}).get('prompt_tokens_details', {}).get('cached_tokens')
|
||||
for row in warm['requests']]
|
||||
except Exception as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
persist()
|
||||
print(json.dumps({k: v for k, v in result.items() if k != 'phases'}, ensure_ascii=False), flush=True)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument('--prepare', action='store_true')
|
||||
group.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float)
|
||||
args = parser.parse_args()
|
||||
if args.prepare:
|
||||
prepare()
|
||||
else:
|
||||
if args.deadline is None:
|
||||
parser.error('Fresh explicit Go and deadline required')
|
||||
run(args.deadline)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: one explicitly authorized test after normal authenticated drain.
|
||||
|
||||
Never stops/starts Deck or production models. The operator must restore normal
|
||||
production immediately after this worker returns, including on failure.
|
||||
"""
|
||||
import argparse
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
GPU = 'GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe'
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
if not parser.parse_args().go:
|
||||
parser.error('Explicit Michael model-switch/test Go required')
|
||||
spec = importlib.util.spec_from_file_location('candidate', ROOT / 'candidate.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
owner = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(owner)
|
||||
owner.validate(ROOT, ROOT)
|
||||
window = json.loads((ROOT / 'full-window.json').read_text())
|
||||
drained = json.loads((ROOT / 'full2-drained.json').read_text())
|
||||
assert time.time() - drained['checked_at'] < 45
|
||||
assert drained['state'] == 'stopped' and drained['active_requests'] == 0
|
||||
assert all(type(drained['scheduler'][key]) is int and drained['scheduler'][key] == 0
|
||||
for key in ('active_requests', 'waiting_requests', 'tts_waiting_requests'))
|
||||
assert not drained['scheduler']['switching']
|
||||
assert not Path('/opt/athena-deck-dev/runtime/state/strata-worker/worker.json').exists()
|
||||
assert not subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
|
||||
'--format=csv,noheader,nounits'], text=True).strip()
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
current = owner.snapshot()
|
||||
assert before['image'] == current['image'] and before['started'] == current['started']
|
||||
assert not owner.owned_container(before['image'])
|
||||
assert time.time() + 60 < window['test_deadline']
|
||||
production = json.loads(subprocess.check_output(['docker', 'inspect', 'athena-deck-dev'], text=True))[0]
|
||||
command = ['docker', 'run', '--rm', '--pull=never', '--name', owner.NAME,
|
||||
'--label', 'athena-deck.basalt-owner=' + owner.OWNER,
|
||||
'--runtime', production['HostConfig']['Runtime'], '--gpus', 'device=' + GPU,
|
||||
'--network', 'none', '--read-only', '--user', '65534:65534', '--cap-drop', 'ALL',
|
||||
'--security-opt', 'no-new-privileges', '--cpus', '12', '--cpuset-cpus', '0,1,2,3,6,7,8,9',
|
||||
'--memory', '52g', '--memory-swap', '52g', '--pids-limit', '512',
|
||||
'--ulimit', 'memlock=-1:-1', '--mount', f'type=bind,src={ROOT},dst={ROOT}',
|
||||
'--mount', f'type=bind,src={ROOT / "tmp"},dst=/tmp',
|
||||
'--mount', f'type=bind,src={CUDA},dst={CUDA},readonly',
|
||||
'-e', 'CUDA_VISIBLE_DEVICES=' + GPU, '-e', 'NVIDIA_VISIBLE_DEVICES=' + GPU,
|
||||
'-e', 'NVIDIA_DRIVER_CAPABILITIES=compute,utility', '-e', 'HOME=' + str(ROOT / 'home'),
|
||||
'-e', 'TMPDIR=' + str(ROOT / 'tmp'), '-e', 'CUDA_CACHE_PATH=' + str(ROOT / 'cache/cuda'),
|
||||
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'OPENBLAS_NUM_THREADS=1', '-e', 'OMP_NUM_THREADS=1',
|
||||
'--entrypoint', str(ROOT / 'venv/bin/python'), before['image'], '-B',
|
||||
str(ROOT / 'full2_runner.py'), '--go', '--deadline', str(window['test_deadline'])]
|
||||
error = None
|
||||
with (ROOT / 'full2-host.log').open('w') as log:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
try:
|
||||
while process.poll() is None:
|
||||
if time.time() >= window['test_deadline']:
|
||||
raise TimeoutError('Test budget reached; stop only owned test and restore original')
|
||||
if owner.available() < 1536:
|
||||
raise RuntimeError('Host RAM headroom guard; restore original')
|
||||
time.sleep(2)
|
||||
except BaseException as exc:
|
||||
error = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
instance = owner.owned_container(before['image'])
|
||||
if instance:
|
||||
action = ['docker', 'stop', '--timeout', '10'] if instance['State']['Running'] else ['docker', 'rm']
|
||||
subprocess.run(action + [instance['Id']], check=True, stdout=log, stderr=log)
|
||||
if process.poll() is None:
|
||||
process.wait(timeout=30)
|
||||
remaining = owner.owned_container(before['image'])
|
||||
assert remaining is None
|
||||
result = dict(client_exit_code=process.returncode, error=error, test_finished=time.time(),
|
||||
owned_container_removed=True, production_restore_required=True)
|
||||
path = ROOT / 'full2-host-exit.json'
|
||||
path.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == result
|
||||
print(json.dumps(result), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside a future isolated GPU test container, only after separate Michael Go.
|
||||
|
||||
No production API, model stop/start or profile mutation is implemented here.
|
||||
The operator must drain/stop the original model beforehand and restore it after
|
||||
this process exits. The absolute deadline leaves the outer restoration reserve.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float, help='Absolute epoch deadline before restoration reserve')
|
||||
args = parser.parse_args()
|
||||
if not args.go or args.deadline is None:
|
||||
parser.error('Explicit Michael model-switch/test Go and absolute deadline required')
|
||||
assert time.time() < args.deadline <= time.time() + 720
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
proof = json.loads((ROOT / 'model-verification.json').read_text())
|
||||
assert json.loads((ROOT / 'model-download.json').read_text())['state'] == 'verified'
|
||||
assert proof['sha256'] == source['sha256'] and proof['header_readable_by_pinned_build']
|
||||
assert (ROOT / 'models' / source['filename']).stat().st_size == source['size']
|
||||
assert not (ROOT / 'full2-results.json').exists(), 'Never silently repeat a test'
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=args.deadline,
|
||||
production_modified_by_runner=False, passed=False)
|
||||
record = ROOT / 'full2-runner-status.json'
|
||||
|
||||
def save(phase):
|
||||
result['phase'] = phase
|
||||
result['updated'] = time.time()
|
||||
record.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(record.read_text()) == result
|
||||
|
||||
save('loading one candidate; no production routes')
|
||||
python = ROOT / 'venv/bin/python'
|
||||
command = [ROOT / 'source/bin/basalt', 'serve', '--python', python,
|
||||
'--config', ROOT / 'test-config.json']
|
||||
with (ROOT / 'full2-server.log').open('w') as output:
|
||||
server = subprocess.Popen(list(map(str, command)), cwd=ROOT / 'source',
|
||||
stdout=output, stderr=subprocess.STDOUT, start_new_session=True)
|
||||
try:
|
||||
load_deadline = min(args.deadline - 20, time.time() + 240)
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError('Owned Basalt server exited during load; inspect own server log')
|
||||
if time.time() >= load_deadline:
|
||||
raise TimeoutError('Load budget expired; restore original runtime')
|
||||
try:
|
||||
with urllib.request.urlopen('http://127.0.0.1:18320/props', timeout=2) as response:
|
||||
props = json.load(response)
|
||||
if not props['is_sleeping']:
|
||||
assert props['model_alias'] == 'athena-basalt-iq3xxs-test'
|
||||
assert props['total_slots'] == 2
|
||||
assert props['default_generation_settings']['n_ctx'] == 262144
|
||||
break
|
||||
except (OSError, urllib.error.URLError, KeyError):
|
||||
pass
|
||||
time.sleep(0.5)
|
||||
result['load_seconds'] = time.time() - result['started']
|
||||
save('short synthetic client; no tools executed')
|
||||
remaining = min(600, args.deadline - time.time() - 20)
|
||||
if remaining <= 0:
|
||||
raise TimeoutError('No test budget remains; restore original runtime')
|
||||
with (ROOT / 'full2-client.log').open('w') as output:
|
||||
completed = subprocess.run([str(python), str(ROOT / 'full2_client.py'), '--go', '--deadline', str(args.deadline)],
|
||||
cwd=ROOT, stdout=output, stderr=subprocess.STDOUT, timeout=remaining)
|
||||
assert completed.returncode == 0
|
||||
result['capacity_test'] = json.loads((ROOT / 'full2-results.json').read_text())['passed']
|
||||
result['passed'] = True
|
||||
except BaseException as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
if server.poll() is None:
|
||||
os.killpg(server.pid, signal.SIGTERM)
|
||||
try:
|
||||
server.wait(timeout=15)
|
||||
except subprocess.TimeoutExpired:
|
||||
os.killpg(server.pid, signal.SIGKILL)
|
||||
server.wait(timeout=5)
|
||||
result['server_exit_code'] = server.poll()
|
||||
save('candidate stopped; outer operator must restore original Strata/Qwen')
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,221 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside the owned candidate container: CPU-only preparation, or approved full-slot test.
|
||||
|
||||
Use --prepare without GPUs before maintenance. --go requires a fresh absolute
|
||||
window deadline. All input/output is synthetic; no production API is contacted.
|
||||
"""
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import importlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
BASE = 'http://127.0.0.1:18320'
|
||||
MODEL = 'athena-basalt-iq3xxs-test'
|
||||
CONTEXT = 262144
|
||||
OUTPUT = 512
|
||||
TARGET = CONTEXT - OUTPUT
|
||||
|
||||
|
||||
def save(path, value):
|
||||
path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == value
|
||||
|
||||
|
||||
def prepare():
|
||||
sys.path[:0] = [str(ROOT / 'source'), str(ROOT / 'source/tools')]
|
||||
ST = importlib.import_module('tokenizer')
|
||||
ModelFile = importlib.import_module('model_file').ModelFile
|
||||
extract_tokenizer = importlib.import_module('serve.engine.modelfile').extract_tokenizer
|
||||
ChatTemplate = importlib.import_module('serve.frontend').ChatTemplate
|
||||
Service = importlib.import_module('serve.service').Service
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
directory = extract_tokenizer(ModelFile(ROOT / 'models' / source['filename']))
|
||||
vocab = json.loads((directory / 'vocab.json').read_text())
|
||||
tokens = [None] * len(vocab)
|
||||
for text, index in vocab.items():
|
||||
tokens[index] = text
|
||||
tok = ST.Tokenizer(tokens, (directory / 'merges.txt').read_text().split('\n'),
|
||||
json.loads((directory / 'token_type.json').read_text()))
|
||||
template = directory / 'chat_template.jinja'
|
||||
if not template.exists():
|
||||
template = ROOT / 'source/serve/chat_template.jinja'
|
||||
# Token counting only: no model engine, GPU, inference or generated result.
|
||||
service = Service(SimpleNamespace(max_context=CONTEXT), tok, ChatTemplate(template))
|
||||
docs = []
|
||||
for slot in ('A', 'B'):
|
||||
rows = [f'Archiv {slot} Zeile {n:05d}: Standort {"West" if slot == "A" else "Ost"}, '
|
||||
f'Bauteil {(n * 71 + 19) % 10007:05d}, Freigabe dokumentiert.\n'
|
||||
for n in range(16000)]
|
||||
ending = ('\nEnde des synthetischen Archivs. Schreibe jetzt einen ausführlichen '
|
||||
'deutschen Fachtext mit mindestens 1200 Wörtern über zuverlässige '
|
||||
'Datensicherung. Beginne mit der Anfangskennung. Keine Rückfragen.')
|
||||
|
||||
def messages(count, padding):
|
||||
return [{'role': 'system', 'content': f'Unabhängiger Vollkontext-Test {slot}. '
|
||||
f'Anfangskennung BASALT_FULL_{slot}. Schreibe auf Deutsch.'},
|
||||
{'role': 'user', 'content': ''.join(rows[:count]) + ' x' * padding + ending}]
|
||||
|
||||
def length(value):
|
||||
return len(service.encode_prompt(value, None, {'enable_thinking': False}))
|
||||
|
||||
low, high = 0, len(rows)
|
||||
while low < high:
|
||||
middle = (low + high + 1) // 2
|
||||
if length(messages(middle, 0)) <= TARGET:
|
||||
low = middle
|
||||
else:
|
||||
high = middle - 1
|
||||
count = low
|
||||
missing = TARGET - length(messages(count, 0))
|
||||
assert 0 <= missing < 100
|
||||
# Joining padding to the following newline can change one BPE token.
|
||||
actual = 0
|
||||
padded = messages(count, 0)
|
||||
for padding in range(max(0, missing - 2), missing + 3):
|
||||
padded = messages(count, padding)
|
||||
actual = length(padded)
|
||||
if actual == TARGET:
|
||||
break
|
||||
else:
|
||||
raise AssertionError((slot, actual, TARGET))
|
||||
docs.append(dict(slot=slot, prompt_tokens=actual, max_tokens=OUTPUT, messages=padded))
|
||||
path = ROOT / 'full-fixtures.json'
|
||||
assert not path.exists(), 'Inspect existing full-context fixture rather than overwrite'
|
||||
save(path, docs)
|
||||
print(json.dumps(dict(prepared=True, inference=False, prompt_tokens=[d['prompt_tokens'] for d in docs],
|
||||
output_room=OUTPUT, context_per_slot=CONTEXT)), flush=True)
|
||||
|
||||
|
||||
def run(deadline):
|
||||
from test_client import parse_sse
|
||||
assert time.time() < deadline <= time.time() + 720
|
||||
path = ROOT / 'full-results.json'
|
||||
assert not path.exists(), 'Never silently repeat full-context inference'
|
||||
docs = json.loads((ROOT / 'full-fixtures.json').read_text())
|
||||
assert len(docs) == 2 and all(d['prompt_tokens'] == TARGET for d in docs)
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=deadline, context_per_slot=CONTEXT,
|
||||
prompt_tokens_per_slot=TARGET, output_room_per_slot=OUTPUT,
|
||||
phases=[], passed=False, both_full_slots_decoding_observed=False)
|
||||
|
||||
def persist():
|
||||
result['elapsed_seconds'] = time.time() - result['started']
|
||||
save(path, result)
|
||||
|
||||
def get(route):
|
||||
with urllib.request.urlopen(BASE + route, timeout=3) as response:
|
||||
return json.load(response)
|
||||
|
||||
def request(document, maximum, barrier) -> dict[str, Any]:
|
||||
barrier.wait(timeout=10)
|
||||
began = time.monotonic()
|
||||
first = []
|
||||
body = dict(model=MODEL, messages=document['messages'], max_tokens=maximum,
|
||||
temperature=0, seed=42, reasoning_effort='none', stream=True,
|
||||
stream_options={'include_usage': True})
|
||||
req = urllib.request.Request(BASE + '/v1/chat/completions',
|
||||
data=json.dumps(body).encode(), headers={'Content-Type': 'application/json'})
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=max(1, min(600, deadline - time.time()))) as response:
|
||||
def lines():
|
||||
for line in response:
|
||||
if time.time() >= deadline:
|
||||
raise TimeoutError('Full-context deadline; restore original runtime')
|
||||
yield line
|
||||
row = parse_sse(lines(), lambda: first.append(time.monotonic() - began))
|
||||
row.update(slot=document['slot'], wall_seconds=time.monotonic() - began,
|
||||
ttft_seconds=first[0] if first else None)
|
||||
assert row['usage']['prompt_tokens'] == TARGET, 'Actual backend input differs from fixture'
|
||||
return row
|
||||
except urllib.error.HTTPError as error:
|
||||
return dict(slot=document['slot'], http_error=error.code,
|
||||
error_body=error.read().decode(), wall_seconds=time.monotonic() - began)
|
||||
except Exception as error:
|
||||
return dict(slot=document['slot'], error=type(error).__name__ + ': ' + str(error),
|
||||
wall_seconds=time.monotonic() - began)
|
||||
|
||||
def pair(label, maximum):
|
||||
phase: dict[str, Any] = dict(label=label, maximum_output_tokens=maximum, snapshots=[], requests=[])
|
||||
result['phases'].append(phase)
|
||||
persist()
|
||||
began = time.monotonic()
|
||||
barrier = threading.Barrier(2)
|
||||
heartbeat = began
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
|
||||
jobs = [pool.submit(request, document, maximum, barrier) for document in docs]
|
||||
while not all(job.done() for job in jobs):
|
||||
if time.time() >= deadline:
|
||||
raise TimeoutError('Hard full-context client deadline')
|
||||
try:
|
||||
slots = get('/slots')
|
||||
phase['snapshots'].append(dict(at=time.time(), slots=slots))
|
||||
if all(s.get('state') == 'decoding' and s.get('prompt_tokens') == TARGET for s in slots) and len(slots) == 2:
|
||||
result['both_full_slots_decoding_observed'] = True
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
if time.monotonic() - heartbeat >= 20:
|
||||
heartbeat = time.monotonic()
|
||||
persist()
|
||||
print(json.dumps(dict(phase=label, elapsed=time.monotonic() - began,
|
||||
last_snapshot=phase['snapshots'][-1:])), flush=True)
|
||||
time.sleep(0.5)
|
||||
phase['requests'] = [job.result() for job in jobs]
|
||||
phase['wall_seconds'] = time.monotonic() - began
|
||||
phase['output_tokens'] = sum(row.get('usage', {}).get('completion_tokens', 0) for row in phase['requests'])
|
||||
phase['end_to_end_output_tokens_per_second'] = phase['output_tokens'] / phase['wall_seconds']
|
||||
phase['accepted_both'] = all('usage' in row for row in phase['requests'])
|
||||
phase['final_slots'] = get('/slots')
|
||||
persist()
|
||||
return phase
|
||||
|
||||
try:
|
||||
props = get('/props')
|
||||
slots = get('/slots')
|
||||
assert props['total_slots'] == 2 and props['default_generation_settings']['n_ctx'] == CONTEXT
|
||||
assert len(slots) == 2 and all(s['n_ctx'] == CONTEXT and not s['is_processing'] for s in slots)
|
||||
result['initial_slots'] = slots
|
||||
# Separate input speed from output speed. First read two full, different
|
||||
# documents with one output token each; then reuse them for parallel decode.
|
||||
cold = pair('fresh-two-full-inputs', 1)
|
||||
if not cold['accepted_both']:
|
||||
result['capacity_rejected'] = True
|
||||
return
|
||||
cold['combined_input_tokens_per_wall_second'] = 2 * TARGET / cold['wall_seconds']
|
||||
warm = pair('cached-two-full-outputs', OUTPUT)
|
||||
result['passed'] = (warm['accepted_both'] and result['both_full_slots_decoding_observed']
|
||||
and all(row['usage']['completion_tokens'] == OUTPUT for row in warm['requests']))
|
||||
result['cached_tokens'] = [row.get('usage', {}).get('prompt_tokens_details', {}).get('cached_tokens')
|
||||
for row in warm['requests']]
|
||||
except Exception as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
persist()
|
||||
print(json.dumps({k: v for k, v in result.items() if k != 'phases'}, ensure_ascii=False), flush=True)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument('--prepare', action='store_true')
|
||||
group.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float)
|
||||
args = parser.parse_args()
|
||||
if args.prepare:
|
||||
prepare()
|
||||
else:
|
||||
if args.deadline is None:
|
||||
parser.error('Fresh explicit Go and deadline required')
|
||||
run(args.deadline)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: one explicitly authorized test after normal authenticated drain.
|
||||
|
||||
Never stops/starts Deck or production models. The operator must restore normal
|
||||
production immediately after this worker returns, including on failure.
|
||||
"""
|
||||
import argparse
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
GPU = 'GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe'
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
if not parser.parse_args().go:
|
||||
parser.error('Explicit Michael model-switch/test Go required')
|
||||
spec = importlib.util.spec_from_file_location('candidate', ROOT / 'candidate.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
owner = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(owner)
|
||||
owner.validate(ROOT, ROOT)
|
||||
window = json.loads((ROOT / 'full-window.json').read_text())
|
||||
drained = json.loads((ROOT / 'full-drained.json').read_text())
|
||||
assert time.time() - drained['checked_at'] < 45
|
||||
assert drained['state'] == 'stopped' and drained['active_requests'] == 0
|
||||
assert all(type(drained['scheduler'][key]) is int and drained['scheduler'][key] == 0
|
||||
for key in ('active_requests', 'waiting_requests', 'tts_waiting_requests'))
|
||||
assert not drained['scheduler']['switching']
|
||||
assert not Path('/opt/athena-deck-dev/runtime/state/strata-worker/worker.json').exists()
|
||||
assert not subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
|
||||
'--format=csv,noheader,nounits'], text=True).strip()
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
current = owner.snapshot()
|
||||
assert before['image'] == current['image'] and before['started'] == current['started']
|
||||
assert not owner.owned_container(before['image'])
|
||||
assert time.time() + 60 < window['test_deadline']
|
||||
production = json.loads(subprocess.check_output(['docker', 'inspect', 'athena-deck-dev'], text=True))[0]
|
||||
command = ['docker', 'run', '--rm', '--pull=never', '--name', owner.NAME,
|
||||
'--label', 'athena-deck.basalt-owner=' + owner.OWNER,
|
||||
'--runtime', production['HostConfig']['Runtime'], '--gpus', 'device=' + GPU,
|
||||
'--network', 'none', '--read-only', '--user', '65534:65534', '--cap-drop', 'ALL',
|
||||
'--security-opt', 'no-new-privileges', '--cpus', '12', '--cpuset-cpus', '0,1,2,3,6,7,8,9',
|
||||
'--memory', '52g', '--memory-swap', '52g', '--pids-limit', '512',
|
||||
'--ulimit', 'memlock=-1:-1', '--mount', f'type=bind,src={ROOT},dst={ROOT}',
|
||||
'--mount', f'type=bind,src={ROOT / "tmp"},dst=/tmp',
|
||||
'--mount', f'type=bind,src={CUDA},dst={CUDA},readonly',
|
||||
'-e', 'CUDA_VISIBLE_DEVICES=' + GPU, '-e', 'NVIDIA_VISIBLE_DEVICES=' + GPU,
|
||||
'-e', 'NVIDIA_DRIVER_CAPABILITIES=compute,utility', '-e', 'HOME=' + str(ROOT / 'home'),
|
||||
'-e', 'TMPDIR=' + str(ROOT / 'tmp'), '-e', 'CUDA_CACHE_PATH=' + str(ROOT / 'cache/cuda'),
|
||||
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'OPENBLAS_NUM_THREADS=1', '-e', 'OMP_NUM_THREADS=1',
|
||||
'--entrypoint', str(ROOT / 'venv/bin/python'), before['image'], '-B',
|
||||
str(ROOT / 'full_runner.py'), '--go', '--deadline', str(window['test_deadline'])]
|
||||
error = None
|
||||
with (ROOT / 'full-host.log').open('w') as log:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
try:
|
||||
while process.poll() is None:
|
||||
if time.time() >= window['test_deadline']:
|
||||
raise TimeoutError('Test budget reached; stop only owned test and restore original')
|
||||
if owner.available() < 1536:
|
||||
raise RuntimeError('Host RAM headroom guard; restore original')
|
||||
time.sleep(2)
|
||||
except BaseException as exc:
|
||||
error = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
instance = owner.owned_container(before['image'])
|
||||
if instance:
|
||||
action = ['docker', 'stop', '--timeout', '10'] if instance['State']['Running'] else ['docker', 'rm']
|
||||
subprocess.run(action + [instance['Id']], check=True, stdout=log, stderr=log)
|
||||
if process.poll() is None:
|
||||
process.wait(timeout=30)
|
||||
remaining = owner.owned_container(before['image'])
|
||||
assert remaining is None
|
||||
result = dict(client_exit_code=process.returncode, error=error, test_finished=time.time(),
|
||||
owned_container_removed=True, production_restore_required=True)
|
||||
path = ROOT / 'full-host-exit.json'
|
||||
path.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == result
|
||||
print(json.dumps(result), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside a future isolated GPU test container, only after separate Michael Go.
|
||||
|
||||
No production API, model stop/start or profile mutation is implemented here.
|
||||
The operator must drain/stop the original model beforehand and restore it after
|
||||
this process exits. The absolute deadline leaves the outer restoration reserve.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float, help='Absolute epoch deadline before restoration reserve')
|
||||
args = parser.parse_args()
|
||||
if not args.go or args.deadline is None:
|
||||
parser.error('Explicit Michael model-switch/test Go and absolute deadline required')
|
||||
assert time.time() < args.deadline <= time.time() + 720
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
proof = json.loads((ROOT / 'model-verification.json').read_text())
|
||||
assert json.loads((ROOT / 'model-download.json').read_text())['state'] == 'verified'
|
||||
assert proof['sha256'] == source['sha256'] and proof['header_readable_by_pinned_build']
|
||||
assert (ROOT / 'models' / source['filename']).stat().st_size == source['size']
|
||||
assert not (ROOT / 'full-results.json').exists(), 'Never silently repeat a test'
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=args.deadline,
|
||||
production_modified_by_runner=False, passed=False)
|
||||
record = ROOT / 'full-runner-status.json'
|
||||
|
||||
def save(phase):
|
||||
result['phase'] = phase
|
||||
result['updated'] = time.time()
|
||||
record.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(record.read_text()) == result
|
||||
|
||||
save('loading one candidate; no production routes')
|
||||
python = ROOT / 'venv/bin/python'
|
||||
command = [ROOT / 'source/bin/basalt', 'serve', '--python', python,
|
||||
'--config', ROOT / 'test-config.json']
|
||||
with (ROOT / 'full-server.log').open('w') as output:
|
||||
server = subprocess.Popen(list(map(str, command)), cwd=ROOT / 'source',
|
||||
stdout=output, stderr=subprocess.STDOUT, start_new_session=True)
|
||||
try:
|
||||
load_deadline = min(args.deadline - 20, time.time() + 240)
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError('Owned Basalt server exited during load; inspect own server log')
|
||||
if time.time() >= load_deadline:
|
||||
raise TimeoutError('Load budget expired; restore original runtime')
|
||||
try:
|
||||
with urllib.request.urlopen('http://127.0.0.1:18320/props', timeout=2) as response:
|
||||
props = json.load(response)
|
||||
if not props['is_sleeping']:
|
||||
assert props['model_alias'] == 'athena-basalt-iq3xxs-test'
|
||||
assert props['total_slots'] == 2
|
||||
assert props['default_generation_settings']['n_ctx'] == 262144
|
||||
break
|
||||
except (OSError, urllib.error.URLError, KeyError):
|
||||
pass
|
||||
time.sleep(0.5)
|
||||
result['load_seconds'] = time.time() - result['started']
|
||||
save('short synthetic client; no tools executed')
|
||||
remaining = min(600, args.deadline - time.time() - 20)
|
||||
if remaining <= 0:
|
||||
raise TimeoutError('No test budget remains; restore original runtime')
|
||||
with (ROOT / 'full-client.log').open('w') as output:
|
||||
completed = subprocess.run([str(python), str(ROOT / 'full_client.py'), '--go', '--deadline', str(args.deadline)],
|
||||
cwd=ROOT, stdout=output, stderr=subprocess.STDOUT, timeout=remaining)
|
||||
assert completed.returncode == 0
|
||||
result['capacity_test'] = json.loads((ROOT / 'full-results.json').read_text())['passed']
|
||||
result['passed'] = True
|
||||
except BaseException as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
if server.poll() is None:
|
||||
os.killpg(server.pid, signal.SIGTERM)
|
||||
try:
|
||||
server.wait(timeout=15)
|
||||
except subprocess.TimeoutExpired:
|
||||
os.killpg(server.pid, signal.SIGKILL)
|
||||
server.wait(timeout=5)
|
||||
result['server_exit_code'] = server.poll()
|
||||
save('candidate stopped; outer operator must restore original Strata/Qwen')
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: one explicitly authorized test after normal authenticated drain.
|
||||
|
||||
Never stops/starts Deck or production models. The operator must restore normal
|
||||
production immediately after this worker returns, including on failure.
|
||||
"""
|
||||
import argparse
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
GPU = 'GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe'
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
if not parser.parse_args().go:
|
||||
parser.error('Explicit Michael model-switch/test Go required')
|
||||
spec = importlib.util.spec_from_file_location('candidate', ROOT / 'candidate.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
owner = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(owner)
|
||||
owner.validate(ROOT, ROOT)
|
||||
window = json.loads((ROOT / 'test-window.json').read_text())
|
||||
drained = json.loads((ROOT / 'test-drained.json').read_text())
|
||||
assert time.time() - drained['checked_at'] < 45
|
||||
assert drained['state'] == 'stopped' and drained['active_requests'] == 0
|
||||
assert all(type(drained['scheduler'][key]) is int and drained['scheduler'][key] == 0
|
||||
for key in ('active_requests', 'waiting_requests', 'tts_waiting_requests'))
|
||||
assert not drained['scheduler']['switching']
|
||||
assert not Path('/opt/athena-deck-dev/runtime/state/strata-worker/worker.json').exists()
|
||||
assert not subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
|
||||
'--format=csv,noheader,nounits'], text=True).strip()
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
current = owner.snapshot()
|
||||
assert before['image'] == current['image'] and before['started'] == current['started']
|
||||
assert not owner.owned_container(before['image'])
|
||||
assert time.time() + 60 < window['test_deadline']
|
||||
production = json.loads(subprocess.check_output(['docker', 'inspect', 'athena-deck-dev'], text=True))[0]
|
||||
command = ['docker', 'run', '--rm', '--pull=never', '--name', owner.NAME,
|
||||
'--label', 'athena-deck.basalt-owner=' + owner.OWNER,
|
||||
'--runtime', production['HostConfig']['Runtime'], '--gpus', 'device=' + GPU,
|
||||
'--network', 'none', '--read-only', '--user', '65534:65534', '--cap-drop', 'ALL',
|
||||
'--security-opt', 'no-new-privileges', '--cpus', '12', '--cpuset-cpus', '0,1,2,3,6,7,8,9',
|
||||
'--memory', '52g', '--memory-swap', '52g', '--pids-limit', '512',
|
||||
'--ulimit', 'memlock=-1:-1', '--mount', f'type=bind,src={ROOT},dst={ROOT}',
|
||||
'--mount', f'type=bind,src={ROOT / "tmp"},dst=/tmp',
|
||||
'--mount', f'type=bind,src={CUDA},dst={CUDA},readonly',
|
||||
'-e', 'CUDA_VISIBLE_DEVICES=' + GPU, '-e', 'NVIDIA_VISIBLE_DEVICES=' + GPU,
|
||||
'-e', 'NVIDIA_DRIVER_CAPABILITIES=compute,utility', '-e', 'HOME=' + str(ROOT / 'home'),
|
||||
'-e', 'TMPDIR=' + str(ROOT / 'tmp'), '-e', 'CUDA_CACHE_PATH=' + str(ROOT / 'cache/cuda'),
|
||||
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'OPENBLAS_NUM_THREADS=1', '-e', 'OMP_NUM_THREADS=1',
|
||||
'--entrypoint', str(ROOT / 'venv/bin/python'), before['image'], '-B',
|
||||
str(ROOT / 'run_short_test.py'), '--go', '--deadline', str(window['test_deadline'])]
|
||||
error = None
|
||||
with (ROOT / 'host-test.log').open('w') as log:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
try:
|
||||
while process.poll() is None:
|
||||
if time.time() >= window['test_deadline']:
|
||||
raise TimeoutError('Test budget reached; stop only owned test and restore original')
|
||||
if owner.available() < 1536:
|
||||
raise RuntimeError('Host RAM headroom guard; restore original')
|
||||
time.sleep(2)
|
||||
except BaseException as exc:
|
||||
error = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
instance = owner.owned_container(before['image'])
|
||||
if instance:
|
||||
action = ['docker', 'stop', '--timeout', '10'] if instance['State']['Running'] else ['docker', 'rm']
|
||||
subprocess.run(action + [instance['Id']], check=True, stdout=log, stderr=log)
|
||||
if process.poll() is None:
|
||||
process.wait(timeout=30)
|
||||
remaining = owner.owned_container(before['image'])
|
||||
assert remaining is None
|
||||
result = dict(client_exit_code=process.returncode, error=error, test_finished=time.time(),
|
||||
owned_container_removed=True, production_restore_required=True)
|
||||
path = ROOT / 'host-test-exit.json'
|
||||
path.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == result
|
||||
print(json.dumps(result), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"repo": "jesdga/Qwen3.8-Flash-Next-Basalt",
|
||||
"revision": "c0e57437ea564aa85263ab0bc0ee83568dd53213",
|
||||
"filename": "Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt",
|
||||
"size": 79867643037,
|
||||
"sha256": "d02bb1b188bbc9ed6bc88ce5e89c7c2d64247290c7bae70fbb9d9d17fe65ed71",
|
||||
"source": "https://huggingface.co/jesdga/Qwen3.8-Flash-Next-Basalt",
|
||||
"quantization": "GSQ-RCO IQ3_XXS",
|
||||
"license": "Qwen Community License 1.0",
|
||||
"purpose": "prepare-only; no production unload, model loading or inference authorized"
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Same synthetic near-limit conversation workload for Basalt and current Strata.
|
||||
|
||||
Basalt: inside own isolated GPU container. Strata: native Athena host, existing
|
||||
managed API credential received on stdin only. Stops only its own HTTP sockets.
|
||||
No service/model/profile mutation. Separate fresh Go and deadline required.
|
||||
"""
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import http.client
|
||||
import json
|
||||
from pathlib import Path
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from typing import Any
|
||||
from urllib.parse import quote
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
FINAL = 261632
|
||||
OUTPUT = 504
|
||||
|
||||
|
||||
def overlaps(rows):
|
||||
if len(rows) != 2 or any(r.get('first_content_at') is None or r.get('finished_at') is None for r in rows):
|
||||
return 0.0
|
||||
return max(0.0, min(r['finished_at'] for r in rows) - max(r['first_content_at'] for r in rows))
|
||||
|
||||
|
||||
def slower_budget(reference):
|
||||
assert reference > 0
|
||||
return reference * 1.15 + 2.0
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--engine', required=True, choices=['basalt', 'strata'])
|
||||
parser.add_argument('--deadline', required=True, type=float)
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Fresh explicit Michael benchmark/model-switch Go required')
|
||||
assert time.time() < args.deadline <= time.time() + 2100
|
||||
basalt = args.engine == 'basalt'
|
||||
key = '' if basalt else json.load(sys.stdin)['key']
|
||||
assert basalt or (isinstance(key, str) and key)
|
||||
port = 18320 if basalt else 8120
|
||||
model = 'athena-basalt-iq3xxs-test' if basalt else 'flash-next-strata-iq3-dual'
|
||||
path = ROOT / ('paired-' + args.engine + '.json')
|
||||
assert not path.exists(), 'Do not silently repeat a benchmark'
|
||||
docs = json.loads((ROOT / 'paired-fixtures.json').read_text())
|
||||
assert len(docs) == 2 and all(d['initial_tokens'] == 261500 and d['final_tokens'] == FINAL for d in docs)
|
||||
early = None
|
||||
if not basalt:
|
||||
reference = json.loads((ROOT / 'paired-basalt.json').read_text())
|
||||
assert reference['passed'] and reference['work_complete']
|
||||
early = slower_budget(reference['work_seconds'])
|
||||
started = time.monotonic()
|
||||
stop = threading.Event()
|
||||
lock = threading.RLock()
|
||||
sockets: set[Any] = set()
|
||||
result: dict[str, Any] = dict(engine=args.engine, started_at=time.time(), deadline=args.deadline,
|
||||
context_per_slot=262144, initial_tokens=261500, final_tokens=FINAL, output_tokens=OUTPUT,
|
||||
requests=[], snapshots=[], work_complete=False, passed=False, early_stop_budget=early)
|
||||
|
||||
def save():
|
||||
with lock:
|
||||
result['elapsed_seconds'] = time.monotonic() - started
|
||||
temporary = path.with_suffix('.pending')
|
||||
temporary.write_text(json.dumps(result, ensure_ascii=False, indent=2) + '\n')
|
||||
temporary.replace(path)
|
||||
|
||||
def headers():
|
||||
return {'Content-Type': 'application/json', **({'Authorization': 'Bearer ' + key} if key else {})}
|
||||
|
||||
def get(route):
|
||||
conn = http.client.HTTPConnection('127.0.0.1', port, timeout=3)
|
||||
try:
|
||||
conn.request('GET', route, headers=headers())
|
||||
response = conn.getresponse()
|
||||
assert response.status == 200, ('Telemetry HTTP', response.status)
|
||||
return json.loads(response.read())
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def cancel(reason):
|
||||
with lock:
|
||||
if result['work_complete'] or stop.is_set():
|
||||
return
|
||||
result['stop_reason'] = reason
|
||||
if reason == 'strata_proven_slower_total_work_lower_bound':
|
||||
result['strata_elapsed_lower_bound_seconds'] = time.monotonic() - started
|
||||
stop.set()
|
||||
owned = list(sockets)
|
||||
save()
|
||||
for sock in owned:
|
||||
try:
|
||||
sock.shutdown(socket.SHUT_RDWR)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def watch():
|
||||
last_save = 0.0
|
||||
while not stop.wait(0.5):
|
||||
elapsed = time.monotonic() - started
|
||||
if time.time() >= args.deadline:
|
||||
cancel('hard_benchmark_deadline')
|
||||
break
|
||||
if early is not None and elapsed > early:
|
||||
cancel('strata_proven_slower_total_work_lower_bound')
|
||||
break
|
||||
if elapsed - last_save >= 5:
|
||||
last_save = elapsed
|
||||
try:
|
||||
sample = get('/slots' if basalt else '/v1/telemetry/speed')
|
||||
with lock:
|
||||
result['snapshots'].append(dict(at=time.time(), data=sample))
|
||||
except (OSError, ValueError, AssertionError, http.client.HTTPException):
|
||||
pass
|
||||
save()
|
||||
|
||||
def request(document, phase, maximum, barrier=None):
|
||||
if barrier:
|
||||
barrier.wait(timeout=10)
|
||||
if stop.is_set():
|
||||
raise RuntimeError('Benchmark stopped before admission')
|
||||
messages = document['initial' if phase == 'preload' else 'final']
|
||||
expected = document['initial_tokens' if phase == 'preload' else 'final_tokens']
|
||||
row: dict[str, Any] = dict(tag=document['tag'], phase=phase, maximum=maximum,
|
||||
started_at=time.monotonic() - started, first_content_at=None, finished_at=None,
|
||||
content='', usage={}, timings={}, stream_complete=False)
|
||||
with lock:
|
||||
result['requests'].append(row)
|
||||
save()
|
||||
conn = http.client.HTTPConnection('127.0.0.1', port,
|
||||
timeout=max(1, min(900, args.deadline - time.time())))
|
||||
raw_socket = None
|
||||
body = dict(model=model, messages=messages, max_tokens=maximum, temperature=0,
|
||||
seed=42, reasoning_effort='none', reasoning_budget_tokens=0,
|
||||
stream=True, stream_options={'include_usage': True})
|
||||
try:
|
||||
conn.request('POST', '/v1/chat/completions', body=json.dumps(body).encode(), headers=headers())
|
||||
raw_socket = conn.sock
|
||||
with lock:
|
||||
sockets.add(raw_socket)
|
||||
if stop.is_set():
|
||||
cancel('benchmark_stopped')
|
||||
raise RuntimeError('Benchmark stopped')
|
||||
response = conn.getresponse()
|
||||
if response.status != 200:
|
||||
raise RuntimeError('HTTP ' + str(response.status) + ': ' + response.read().decode()[:2000])
|
||||
while not stop.is_set():
|
||||
line = response.readline()
|
||||
if not line:
|
||||
break
|
||||
if not line.startswith(b'data:'):
|
||||
continue
|
||||
raw = line[5:].strip()
|
||||
if raw == b'[DONE]':
|
||||
with lock:
|
||||
row['stream_complete'] = True
|
||||
break
|
||||
item = json.loads(raw)
|
||||
if 'error' in item:
|
||||
raise RuntimeError(str(item['error']))
|
||||
with lock:
|
||||
row['usage'] = item.get('usage') or row['usage']
|
||||
row['timings'] = item.get('timings') or item.get('backend_timings') or row['timings']
|
||||
for choice in item.get('choices', []):
|
||||
text = choice.get('delta', {}).get('content') or ''
|
||||
if text and row['first_content_at'] is None:
|
||||
row['first_content_at'] = time.monotonic() - started
|
||||
save()
|
||||
row['content'] += text
|
||||
if choice.get('finish_reason'):
|
||||
row['finish_reason'] = choice['finish_reason']
|
||||
if not stop.is_set():
|
||||
assert row['stream_complete'], 'Incomplete real response'
|
||||
assert row['usage'].get('prompt_tokens') == expected, ('Actual token count', row['usage'])
|
||||
if phase == 'preload':
|
||||
assert row['content'].strip() == 'OK', ('Unexpected preload reply', row['content'])
|
||||
else:
|
||||
assert row['usage'].get('completion_tokens') == OUTPUT, ('Output shortened', row['usage'])
|
||||
return row
|
||||
except Exception as exc:
|
||||
with lock:
|
||||
row['error'] = type(exc).__name__ + ': ' + str(exc)
|
||||
if not stop.is_set():
|
||||
cancel('request_failed')
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
with lock:
|
||||
sockets.discard(raw_socket)
|
||||
row['finished_at'] = time.monotonic() - started
|
||||
save() # Preserve this response even when the other never finishes.
|
||||
|
||||
worker = threading.Thread(target=watch, daemon=True)
|
||||
try:
|
||||
route = '/props' if basalt else '/props?model=' + quote(model)
|
||||
props = get(route)
|
||||
assert props['total_slots'] == 2 and props['default_generation_settings']['n_ctx'] == 262144
|
||||
result['verified_properties'] = {k: props[k] for k in ('total_slots', 'default_generation_settings')}
|
||||
save()
|
||||
worker.start()
|
||||
for doc in docs:
|
||||
request(doc, 'preload', 16)
|
||||
result['preload_seconds'] = time.monotonic() - started
|
||||
save()
|
||||
barrier = threading.Barrier(2)
|
||||
parallel_start = time.monotonic()
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
|
||||
jobs = [pool.submit(request, doc, 'full-output', OUTPUT, barrier) for doc in docs]
|
||||
rows = [job.result() for job in jobs]
|
||||
result['parallel_wall_seconds'] = time.monotonic() - parallel_start
|
||||
result['overlap_seconds'] = overlaps(rows)
|
||||
result['output_tokens_per_wall_second'] = sum(r['usage']['completion_tokens'] for r in rows) / result['parallel_wall_seconds']
|
||||
result['cache_reused'] = [r['usage'].get('prompt_tokens_details', {}).get('cached_tokens', 0) for r in rows]
|
||||
result['work_seconds'] = time.monotonic() - started
|
||||
result['work_complete'] = True
|
||||
result['passed'] = result['overlap_seconds'] > 0.5 and all(n >= 261400 for n in result['cache_reused'])
|
||||
if not result['passed']:
|
||||
result['unmet'] = 'Both near-full contexts must actually decode concurrently with preserved input'
|
||||
except Exception as exc:
|
||||
result['error'] = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
stop.set()
|
||||
if worker.is_alive():
|
||||
worker.join(timeout=5)
|
||||
save()
|
||||
print(json.dumps({k: v for k, v in result.items() if k not in ('requests', 'snapshots')}, ensure_ascii=False), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: one explicitly authorized test after normal authenticated drain.
|
||||
|
||||
Never stops/starts Deck or production models. The operator must restore normal
|
||||
production immediately after this worker returns, including on failure.
|
||||
"""
|
||||
import argparse
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
CUDA = Path('/opt/athena-deck-dev/runtime/state/strata-runtime/cuda')
|
||||
GPU = 'GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe'
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
if not parser.parse_args().go:
|
||||
parser.error('Explicit Michael model-switch/test Go required')
|
||||
spec = importlib.util.spec_from_file_location('candidate', ROOT / 'candidate.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
owner = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(owner)
|
||||
owner.validate(ROOT, ROOT)
|
||||
window = json.loads((ROOT / 'paired-window.json').read_text())
|
||||
drained = json.loads((ROOT / 'paired-drained.json').read_text())
|
||||
assert time.time() - drained['checked_at'] < 45
|
||||
assert drained['state'] == 'stopped' and drained['active_requests'] == 0
|
||||
assert all(type(drained['scheduler'][key]) is int and drained['scheduler'][key] == 0
|
||||
for key in ('active_requests', 'waiting_requests', 'tts_waiting_requests'))
|
||||
assert not drained['scheduler']['switching']
|
||||
assert not Path('/opt/athena-deck-dev/runtime/state/strata-worker/worker.json').exists()
|
||||
assert not subprocess.check_output(['nvidia-smi', '--query-compute-apps=pid',
|
||||
'--format=csv,noheader,nounits'], text=True).strip()
|
||||
before = json.loads((ROOT / 'paired-before.json').read_text())
|
||||
current = owner.snapshot()
|
||||
assert before['image'] == current['image'] and before['started'] == current['started']
|
||||
assert not owner.owned_container(before['image'])
|
||||
assert time.time() + 60 < window['test_deadline']
|
||||
production = json.loads(subprocess.check_output(['docker', 'inspect', 'athena-deck-dev'], text=True))[0]
|
||||
command = ['docker', 'run', '--rm', '--pull=never', '--name', owner.NAME,
|
||||
'--label', 'athena-deck.basalt-owner=' + owner.OWNER,
|
||||
'--runtime', production['HostConfig']['Runtime'], '--gpus', 'device=' + GPU,
|
||||
'--network', 'none', '--read-only', '--user', '65534:65534', '--cap-drop', 'ALL',
|
||||
'--security-opt', 'no-new-privileges', '--cpus', '12', '--cpuset-cpus', '0,1,2,3,6,7,8,9',
|
||||
'--memory', '52g', '--memory-swap', '52g', '--pids-limit', '512',
|
||||
'--ulimit', 'memlock=-1:-1', '--mount', f'type=bind,src={ROOT},dst={ROOT}',
|
||||
'--mount', f'type=bind,src={ROOT / "tmp"},dst=/tmp',
|
||||
'--mount', f'type=bind,src={CUDA},dst={CUDA},readonly',
|
||||
'-e', 'CUDA_VISIBLE_DEVICES=' + GPU, '-e', 'NVIDIA_VISIBLE_DEVICES=' + GPU,
|
||||
'-e', 'NVIDIA_DRIVER_CAPABILITIES=compute,utility', '-e', 'HOME=' + str(ROOT / 'home'),
|
||||
'-e', 'TMPDIR=' + str(ROOT / 'tmp'), '-e', 'CUDA_CACHE_PATH=' + str(ROOT / 'cache/cuda'),
|
||||
'-e', 'PYTHONDONTWRITEBYTECODE=1', '-e', 'OPENBLAS_NUM_THREADS=1', '-e', 'OMP_NUM_THREADS=1',
|
||||
'--entrypoint', str(ROOT / 'venv/bin/python'), before['image'], '-B',
|
||||
str(ROOT / 'paired_runner.py'), '--go', '--deadline', str(window['test_deadline'])]
|
||||
error = None
|
||||
with (ROOT / 'paired-host.log').open('w') as log:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
try:
|
||||
while process.poll() is None:
|
||||
if time.time() >= window['test_deadline']:
|
||||
raise TimeoutError('Test budget reached; stop only owned test and restore original')
|
||||
if owner.available() < 1536:
|
||||
raise RuntimeError('Host RAM headroom guard; restore original')
|
||||
time.sleep(2)
|
||||
except BaseException as exc:
|
||||
error = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
instance = owner.owned_container(before['image'])
|
||||
if instance:
|
||||
action = ['docker', 'stop', '--timeout', '10'] if instance['State']['Running'] else ['docker', 'rm']
|
||||
subprocess.run(action + [instance['Id']], check=True, stdout=log, stderr=log)
|
||||
if process.poll() is None:
|
||||
process.wait(timeout=30)
|
||||
remaining = owner.owned_container(before['image'])
|
||||
assert remaining is None
|
||||
result = dict(client_exit_code=process.returncode, error=error, test_finished=time.time(),
|
||||
owned_container_removed=True, production_restore_required=True)
|
||||
path = ROOT / 'paired-host-exit.json'
|
||||
path.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(path.read_text()) == result
|
||||
print(json.dumps(result), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Owned CPU-only container: create identical real-tokenized conversation fixtures.
|
||||
|
||||
No engine/model inference. Preserve assistant history so held slot prefixes
|
||||
are genuine prefixes, instead of replaying a whole prompt with a one-token cap.
|
||||
"""
|
||||
import importlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
INITIAL = 261500
|
||||
FINAL = 261632
|
||||
OUTPUT = 504
|
||||
SLACK = 8
|
||||
|
||||
|
||||
def main():
|
||||
sys.path[:0] = [str(ROOT / 'source'), str(ROOT / 'source/tools')]
|
||||
ST = importlib.import_module('tokenizer')
|
||||
ModelFile = importlib.import_module('model_file').ModelFile
|
||||
extract = importlib.import_module('serve.engine.modelfile').extract_tokenizer
|
||||
Template = importlib.import_module('serve.frontend').ChatTemplate
|
||||
Service = importlib.import_module('serve.service').Service
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
directory = extract(ModelFile(ROOT / 'models' / source['filename']))
|
||||
vocab = json.loads((directory / 'vocab.json').read_text())
|
||||
tokens = [None] * len(vocab)
|
||||
for text, index in vocab.items():
|
||||
tokens[index] = text
|
||||
tok = ST.Tokenizer(tokens, (directory / 'merges.txt').read_text().split('\n'),
|
||||
json.loads((directory / 'token_type.json').read_text()))
|
||||
template = directory / 'chat_template.jinja'
|
||||
assert template.is_file()
|
||||
svc = Service(SimpleNamespace(max_context=262144), tok, Template(template))
|
||||
|
||||
def encode(messages):
|
||||
return svc.encode_prompt(messages, None, {'enable_thinking': False})
|
||||
|
||||
def pad(make, target, estimate=0):
|
||||
ids = []
|
||||
for n in range(max(0, estimate - 3), estimate + 5):
|
||||
messages = make(n)
|
||||
ids = encode(messages)
|
||||
if len(ids) == target:
|
||||
return messages, ids
|
||||
raise AssertionError(('No exact token padding', target, len(ids)))
|
||||
|
||||
docs = []
|
||||
for tag in ('A', 'B'):
|
||||
rows = [f'Archiv PAIR3_{tag} Zeile {n:05d}: Standort '
|
||||
f'{"West" if tag == "A" else "Ost"}, Bauteil {(n * 71 + 19) % 10007:05d}, '
|
||||
'Freigabe dokumentiert.\n' for n in range(15000)]
|
||||
|
||||
def initial(count, padding=0):
|
||||
return [{'role': 'system', 'content': f'Unabhängiges Gespräch PAIR3_{tag}. Lies nur dein Archiv.'},
|
||||
{'role': 'user', 'content': ''.join(rows[:count]) + ' x' * padding +
|
||||
'\nBestätige den Empfang. Antworte ausschließlich mit OK, ohne Satzzeichen.'}]
|
||||
|
||||
low, high = 0, len(rows)
|
||||
while low < high:
|
||||
middle = (low + high + 1) // 2
|
||||
if len(encode(initial(middle))) <= INITIAL:
|
||||
low = middle
|
||||
else:
|
||||
high = middle - 1
|
||||
count = low
|
||||
base, before = pad(lambda n: initial(count, n), INITIAL,
|
||||
INITIAL - len(encode(initial(count))))
|
||||
history = base + [{'role': 'assistant', 'content': 'OK', 'reasoning_content': ''}]
|
||||
|
||||
def follow(padding):
|
||||
return history + [{'role': 'user', 'content': ' x' * padding +
|
||||
'\nSchreibe jetzt einen ausführlichen deutschen Fachtext mit mindestens '
|
||||
'1200 Wörtern über zuverlässige Datensicherung. Keine Rückfragen.'}]
|
||||
|
||||
final, after = pad(follow, FINAL, FINAL - len(encode(follow(0))))
|
||||
held = before + tok.encode('OK')
|
||||
common = 0
|
||||
for a, b in zip(held, after):
|
||||
if a != b:
|
||||
break
|
||||
common += 1
|
||||
# Exact assertion: next request extends the whole held prompt+answer.
|
||||
assert common == len(held), (tag, common, len(held))
|
||||
assert FINAL + OUTPUT + SLACK == 262144
|
||||
docs.append(dict(tag=tag, initial=base, final=final, initial_tokens=len(before),
|
||||
final_tokens=len(after), held_prefix_tokens=common,
|
||||
expected_initial_answer='OK', output_tokens=OUTPUT))
|
||||
target = ROOT / 'paired-fixtures.json'
|
||||
assert not target.exists(), 'Preserve previously prepared fixture'
|
||||
target.write_text(json.dumps(docs, ensure_ascii=False) + '\n')
|
||||
assert json.loads(target.read_text()) == docs
|
||||
report = dict(inference=False, prepared=True, source='actual pinned tokenizer and chat template',
|
||||
initial_tokens=INITIAL, final_tokens=FINAL, output_tokens=OUTPUT, slack=SLACK,
|
||||
held_prefix_tokens=[d['held_prefix_tokens'] for d in docs])
|
||||
(ROOT / 'paired-fixtures-proof.json').write_text(json.dumps(report, indent=2) + '\n')
|
||||
print(json.dumps(report), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside a future isolated GPU test container, only after separate Michael Go.
|
||||
|
||||
No production API, model stop/start or profile mutation is implemented here.
|
||||
The operator must drain/stop the original model beforehand and restore it after
|
||||
this process exits. The absolute deadline leaves the outer restoration reserve.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float, help='Absolute epoch deadline before restoration reserve')
|
||||
args = parser.parse_args()
|
||||
if not args.go or args.deadline is None:
|
||||
parser.error('Explicit Michael model-switch/test Go and absolute deadline required')
|
||||
assert time.time() < args.deadline <= time.time() + 1200
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
proof = json.loads((ROOT / 'model-verification.json').read_text())
|
||||
assert json.loads((ROOT / 'model-download.json').read_text())['state'] == 'verified'
|
||||
assert proof['sha256'] == source['sha256'] and proof['header_readable_by_pinned_build']
|
||||
assert (ROOT / 'models' / source['filename']).stat().st_size == source['size']
|
||||
assert not (ROOT / 'paired-basalt.json').exists(), 'Never silently repeat a test'
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=args.deadline,
|
||||
production_modified_by_runner=False, passed=False)
|
||||
record = ROOT / 'paired-runner-status.json'
|
||||
|
||||
def save(phase):
|
||||
result['phase'] = phase
|
||||
result['updated'] = time.time()
|
||||
record.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(record.read_text()) == result
|
||||
|
||||
save('loading one candidate; no production routes')
|
||||
python = ROOT / 'venv/bin/python'
|
||||
command = [ROOT / 'source/bin/basalt', 'serve', '--python', python,
|
||||
'--config', ROOT / 'test-config.json']
|
||||
with (ROOT / 'paired-server.log').open('w') as output:
|
||||
server = subprocess.Popen(list(map(str, command)), cwd=ROOT / 'source',
|
||||
stdout=output, stderr=subprocess.STDOUT, start_new_session=True)
|
||||
try:
|
||||
load_deadline = min(args.deadline - 20, time.time() + 240)
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError('Owned Basalt server exited during load; inspect own server log')
|
||||
if time.time() >= load_deadline:
|
||||
raise TimeoutError('Load budget expired; restore original runtime')
|
||||
try:
|
||||
with urllib.request.urlopen('http://127.0.0.1:18320/props', timeout=2) as response:
|
||||
props = json.load(response)
|
||||
if not props['is_sleeping']:
|
||||
assert props['model_alias'] == 'athena-basalt-iq3xxs-test'
|
||||
assert props['total_slots'] == 2
|
||||
assert props['default_generation_settings']['n_ctx'] == 262144
|
||||
break
|
||||
except (OSError, urllib.error.URLError, KeyError):
|
||||
pass
|
||||
time.sleep(0.5)
|
||||
result['load_seconds'] = time.time() - result['started']
|
||||
save('short synthetic client; no tools executed')
|
||||
remaining = min(900, args.deadline - time.time() - 20)
|
||||
if remaining <= 0:
|
||||
raise TimeoutError('No test budget remains; restore original runtime')
|
||||
with (ROOT / 'paired-client.log').open('w') as output:
|
||||
completed = subprocess.run([str(python), str(ROOT / 'paired_client.py'), '--go', '--engine', 'basalt', '--deadline', str(args.deadline)],
|
||||
cwd=ROOT, stdout=output, stderr=subprocess.STDOUT, timeout=remaining)
|
||||
assert completed.returncode == 0
|
||||
result['capacity_test'] = json.loads((ROOT / 'paired-basalt.json').read_text())['passed']
|
||||
result['passed'] = True
|
||||
except BaseException as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
if server.poll() is None:
|
||||
os.killpg(server.pid, signal.SIGTERM)
|
||||
try:
|
||||
server.wait(timeout=15)
|
||||
except subprocess.TimeoutExpired:
|
||||
os.killpg(server.pid, signal.SIGKILL)
|
||||
server.wait(timeout=5)
|
||||
result['server_exit_code'] = server.poll()
|
||||
save('candidate stopped; outer operator must restore original Strata/Qwen')
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,241 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Same synthetic near-limit conversation workload for Basalt and current Strata.
|
||||
|
||||
Basalt: inside own isolated GPU container. Strata: native Athena host, existing
|
||||
managed API credential received on stdin only. Stops only its own HTTP sockets.
|
||||
No service/model/profile mutation. Separate fresh Go and deadline required.
|
||||
"""
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import http.client
|
||||
import json
|
||||
from pathlib import Path
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from typing import Any
|
||||
from urllib.parse import quote
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
FINAL = 261632
|
||||
OUTPUT = 504
|
||||
|
||||
|
||||
def overlaps(rows):
|
||||
if len(rows) != 2 or any(r.get('first_content_at') is None or r.get('finished_at') is None for r in rows):
|
||||
return 0.0
|
||||
return max(0.0, min(r['finished_at'] for r in rows) - max(r['first_content_at'] for r in rows))
|
||||
|
||||
|
||||
def slower_budget(reference):
|
||||
assert reference > 0
|
||||
return reference * 1.15 + 2.0
|
||||
|
||||
|
||||
def make_body(model, messages, maximum):
|
||||
# Deck rejects a numeric zero budget before applying the none effort.
|
||||
return dict(model=model, messages=messages, max_tokens=maximum, temperature=0,
|
||||
seed=42, reasoning_effort='none', stream=True,
|
||||
stream_options={'include_usage': True})
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--engine', required=True, choices=['basalt', 'strata'])
|
||||
parser.add_argument('--deadline', required=True, type=float)
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Fresh explicit Michael benchmark/model-switch Go required')
|
||||
assert time.time() < args.deadline <= time.time() + 2100
|
||||
basalt = args.engine == 'basalt'
|
||||
key = '' if basalt else json.load(sys.stdin)['key']
|
||||
assert basalt or (isinstance(key, str) and key)
|
||||
port = 18320 if basalt else 8120
|
||||
model = 'athena-basalt-iq3xxs-test' if basalt else 'flash-next-strata-iq3-dual'
|
||||
path = ROOT / ('paired-' + args.engine + '2.json')
|
||||
assert not path.exists(), 'Do not silently repeat a benchmark'
|
||||
docs = json.loads((ROOT / 'paired-fixtures.json').read_text())
|
||||
assert len(docs) == 2 and all(d['initial_tokens'] == 261500 and d['final_tokens'] == FINAL for d in docs)
|
||||
early = None
|
||||
if not basalt:
|
||||
reference = json.loads((ROOT / 'paired-basalt.json').read_text())
|
||||
assert reference['passed'] and reference['work_complete']
|
||||
early = slower_budget(reference['work_seconds'])
|
||||
started = time.monotonic()
|
||||
stop = threading.Event()
|
||||
lock = threading.RLock()
|
||||
sockets: set[Any] = set()
|
||||
result: dict[str, Any] = dict(engine=args.engine, started_at=time.time(), deadline=args.deadline,
|
||||
context_per_slot=262144, initial_tokens=261500, final_tokens=FINAL, output_tokens=OUTPUT,
|
||||
requests=[], snapshots=[], work_complete=False, passed=False, early_stop_budget=early)
|
||||
|
||||
def save():
|
||||
with lock:
|
||||
result['elapsed_seconds'] = time.monotonic() - started
|
||||
temporary = path.with_suffix('.pending')
|
||||
temporary.write_text(json.dumps(result, ensure_ascii=False, indent=2) + '\n')
|
||||
temporary.replace(path)
|
||||
|
||||
def headers():
|
||||
return {'Content-Type': 'application/json', **({'Authorization': 'Bearer ' + key} if key else {})}
|
||||
|
||||
def get(route):
|
||||
conn = http.client.HTTPConnection('127.0.0.1', port, timeout=3)
|
||||
try:
|
||||
conn.request('GET', route, headers=headers())
|
||||
response = conn.getresponse()
|
||||
assert response.status == 200, ('Telemetry HTTP', response.status)
|
||||
return json.loads(response.read())
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def cancel(reason):
|
||||
with lock:
|
||||
if result['work_complete'] or stop.is_set():
|
||||
return
|
||||
result['stop_reason'] = reason
|
||||
if reason == 'strata_proven_slower_total_work_lower_bound':
|
||||
result['strata_elapsed_lower_bound_seconds'] = time.monotonic() - started
|
||||
stop.set()
|
||||
owned = list(sockets)
|
||||
save()
|
||||
for sock in owned:
|
||||
try:
|
||||
sock.shutdown(socket.SHUT_RDWR)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def watch():
|
||||
last_save = 0.0
|
||||
while not stop.wait(0.5):
|
||||
elapsed = time.monotonic() - started
|
||||
if time.time() >= args.deadline:
|
||||
cancel('hard_benchmark_deadline')
|
||||
break
|
||||
if early is not None and elapsed > early:
|
||||
cancel('strata_proven_slower_total_work_lower_bound')
|
||||
break
|
||||
if elapsed - last_save >= 5:
|
||||
last_save = elapsed
|
||||
try:
|
||||
sample = get('/slots' if basalt else '/v1/telemetry/speed')
|
||||
with lock:
|
||||
result['snapshots'].append(dict(at=time.time(), data=sample))
|
||||
except (OSError, ValueError, AssertionError, http.client.HTTPException):
|
||||
pass
|
||||
save()
|
||||
|
||||
def request(document, phase, maximum, barrier=None):
|
||||
if barrier:
|
||||
barrier.wait(timeout=10)
|
||||
if stop.is_set():
|
||||
raise RuntimeError('Benchmark stopped before admission')
|
||||
messages = document['initial' if phase == 'preload' else 'final']
|
||||
expected = document['initial_tokens' if phase == 'preload' else 'final_tokens']
|
||||
row: dict[str, Any] = dict(tag=document['tag'], phase=phase, maximum=maximum,
|
||||
started_at=time.monotonic() - started, first_content_at=None, finished_at=None,
|
||||
content='', usage={}, timings={}, stream_complete=False)
|
||||
with lock:
|
||||
result['requests'].append(row)
|
||||
save()
|
||||
conn = http.client.HTTPConnection('127.0.0.1', port,
|
||||
timeout=max(1, min(900, args.deadline - time.time())))
|
||||
raw_socket = None
|
||||
body = make_body(model, messages, maximum)
|
||||
try:
|
||||
conn.request('POST', '/v1/chat/completions', body=json.dumps(body).encode(), headers=headers())
|
||||
raw_socket = conn.sock
|
||||
with lock:
|
||||
sockets.add(raw_socket)
|
||||
if stop.is_set():
|
||||
cancel('benchmark_stopped')
|
||||
raise RuntimeError('Benchmark stopped')
|
||||
response = conn.getresponse()
|
||||
if response.status != 200:
|
||||
raise RuntimeError('HTTP ' + str(response.status) + ': ' + response.read().decode()[:2000])
|
||||
while not stop.is_set():
|
||||
line = response.readline()
|
||||
if not line:
|
||||
break
|
||||
if not line.startswith(b'data:'):
|
||||
continue
|
||||
raw = line[5:].strip()
|
||||
if raw == b'[DONE]':
|
||||
with lock:
|
||||
row['stream_complete'] = True
|
||||
break
|
||||
item = json.loads(raw)
|
||||
if 'error' in item:
|
||||
raise RuntimeError(str(item['error']))
|
||||
with lock:
|
||||
row['usage'] = item.get('usage') or row['usage']
|
||||
row['timings'] = item.get('timings') or item.get('backend_timings') or row['timings']
|
||||
for choice in item.get('choices', []):
|
||||
text = choice.get('delta', {}).get('content') or ''
|
||||
if text and row['first_content_at'] is None:
|
||||
row['first_content_at'] = time.monotonic() - started
|
||||
save()
|
||||
row['content'] += text
|
||||
if choice.get('finish_reason'):
|
||||
row['finish_reason'] = choice['finish_reason']
|
||||
if not stop.is_set():
|
||||
assert row['stream_complete'], 'Incomplete real response'
|
||||
assert row['usage'].get('prompt_tokens') == expected, ('Actual token count', row['usage'])
|
||||
if phase == 'preload':
|
||||
assert row['content'].strip() == 'OK', ('Unexpected preload reply', row['content'])
|
||||
else:
|
||||
assert row['usage'].get('completion_tokens') == OUTPUT, ('Output shortened', row['usage'])
|
||||
return row
|
||||
except Exception as exc:
|
||||
with lock:
|
||||
row['error'] = type(exc).__name__ + ': ' + str(exc)
|
||||
if not stop.is_set():
|
||||
cancel('request_failed')
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
with lock:
|
||||
sockets.discard(raw_socket)
|
||||
row['finished_at'] = time.monotonic() - started
|
||||
save() # Preserve this response even when the other never finishes.
|
||||
|
||||
worker = threading.Thread(target=watch, daemon=True)
|
||||
try:
|
||||
route = '/props' if basalt else '/props?model=' + quote(model)
|
||||
props = get(route)
|
||||
assert props['total_slots'] == 2 and props['default_generation_settings']['n_ctx'] == 262144
|
||||
result['verified_properties'] = {k: props[k] for k in ('total_slots', 'default_generation_settings')}
|
||||
save()
|
||||
worker.start()
|
||||
for doc in docs:
|
||||
request(doc, 'preload', 16)
|
||||
result['preload_seconds'] = time.monotonic() - started
|
||||
save()
|
||||
barrier = threading.Barrier(2)
|
||||
parallel_start = time.monotonic()
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
|
||||
jobs = [pool.submit(request, doc, 'full-output', OUTPUT, barrier) for doc in docs]
|
||||
rows = [job.result() for job in jobs]
|
||||
result['parallel_wall_seconds'] = time.monotonic() - parallel_start
|
||||
result['overlap_seconds'] = overlaps(rows)
|
||||
result['output_tokens_per_wall_second'] = sum(r['usage']['completion_tokens'] for r in rows) / result['parallel_wall_seconds']
|
||||
result['cache_reused'] = [r['usage'].get('prompt_tokens_details', {}).get('cached_tokens', 0) for r in rows]
|
||||
result['work_seconds'] = time.monotonic() - started
|
||||
result['work_complete'] = True
|
||||
result['passed'] = result['overlap_seconds'] > 0.5 and all(n >= 261400 for n in result['cache_reused'])
|
||||
if not result['passed']:
|
||||
result['unmet'] = 'Both near-full contexts must actually decode concurrently with preserved input'
|
||||
except Exception as exc:
|
||||
result['error'] = type(exc).__name__ + ': ' + str(exc)
|
||||
finally:
|
||||
stop.set()
|
||||
if worker.is_alive():
|
||||
worker.join(timeout=5)
|
||||
save()
|
||||
print(json.dumps({k: v for k, v in result.items() if k not in ('requests', 'snapshots')}, ensure_ascii=False), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS Hermes profile transport, run with existing /opt/hermes Python environment.
|
||||
|
||||
Resolves only this profile's managed Athena API identity in memory. Never logs
|
||||
or stores a credential. Does not stop/start services or change Hermes settings.
|
||||
"""
|
||||
import argparse
|
||||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import urllib.request
|
||||
|
||||
PROFILE = Path('/opt/data/profiles/athena-deck')
|
||||
ROOT = '/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/'
|
||||
|
||||
|
||||
def key():
|
||||
from hermes_constants import set_hermes_home_override, reset_hermes_home_override
|
||||
from agent.secret_scope import build_profile_secret_scope, set_secret_scope, reset_secret_scope
|
||||
from hermes_cli.runtime_provider import resolve_runtime_provider
|
||||
logging.disable(logging.CRITICAL)
|
||||
home = set_hermes_home_override(PROFILE)
|
||||
scope = set_secret_scope(build_profile_secret_scope(PROFILE), profile_home=str(PROFILE))
|
||||
try:
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
route = resolve_runtime_provider(requested='Athena')
|
||||
assert route['base_url'].rstrip('/') == 'http://192.168.1.212:8120/v1'
|
||||
value = route['api_key']
|
||||
assert isinstance(value, str) and value
|
||||
return value
|
||||
finally:
|
||||
reset_secret_scope(scope)
|
||||
reset_hermes_home_override(home)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('mode', choices=['probe', 'strata'])
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float)
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Explicit current Michael comparison Go required')
|
||||
credential = key()
|
||||
if args.mode == 'probe':
|
||||
request = urllib.request.Request('http://192.168.1.212:8120/props?model=flash-next-strata-iq3-dual',
|
||||
headers={'Authorization': 'Bearer ' + credential})
|
||||
with urllib.request.urlopen(request, timeout=10) as response:
|
||||
data = json.load(response)
|
||||
assert data['total_slots'] == 2 and data['default_generation_settings']['n_ctx'] == 262144
|
||||
print(json.dumps(dict(managed_route_verified=True, slots=data['total_slots'],
|
||||
context_per_slot=data['default_generation_settings']['n_ctx'])))
|
||||
return
|
||||
if args.deadline is None:
|
||||
parser.error('Absolute benchmark deadline required')
|
||||
command = ['python3', '-B', ROOT + 'paired_strata_client.py', '--engine', 'strata', '--go',
|
||||
'--deadline', str(args.deadline)]
|
||||
process = subprocess.run(['athena-ssh', shlex.join(command)],
|
||||
input=json.dumps({'key': credential}), text=True, check=False)
|
||||
raise SystemExit(process.returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS Hermes profile transport, run with existing /opt/hermes Python environment.
|
||||
|
||||
Resolves only this profile's managed Athena API identity in memory. Never logs
|
||||
or stores a credential. Does not stop/start services or change Hermes settings.
|
||||
"""
|
||||
import argparse
|
||||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import urllib.request
|
||||
|
||||
PROFILE = Path('/opt/data/profiles/athena-deck')
|
||||
ROOT = '/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/'
|
||||
|
||||
|
||||
def key():
|
||||
from hermes_constants import set_hermes_home_override, reset_hermes_home_override
|
||||
from agent.secret_scope import build_profile_secret_scope, set_secret_scope, reset_secret_scope
|
||||
from hermes_cli.runtime_provider import resolve_runtime_provider
|
||||
logging.disable(logging.CRITICAL)
|
||||
home = set_hermes_home_override(PROFILE)
|
||||
scope = set_secret_scope(build_profile_secret_scope(PROFILE), profile_home=str(PROFILE))
|
||||
try:
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
route = resolve_runtime_provider(requested='Athena')
|
||||
assert route['base_url'].rstrip('/') == 'http://192.168.1.212:8120/v1'
|
||||
value = route['api_key']
|
||||
assert isinstance(value, str) and value
|
||||
return value
|
||||
finally:
|
||||
reset_secret_scope(scope)
|
||||
reset_hermes_home_override(home)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('mode', choices=['probe', 'strata'])
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float)
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Explicit current Michael comparison Go required')
|
||||
credential = key()
|
||||
if args.mode == 'probe':
|
||||
request = urllib.request.Request('http://192.168.1.212:8120/props?model=flash-next-strata-iq3-dual',
|
||||
headers={'Authorization': 'Bearer ' + credential})
|
||||
with urllib.request.urlopen(request, timeout=10) as response:
|
||||
data = json.load(response)
|
||||
assert data['total_slots'] == 2 and data['default_generation_settings']['n_ctx'] == 262144
|
||||
print(json.dumps(dict(managed_route_verified=True, slots=data['total_slots'],
|
||||
context_per_slot=data['default_generation_settings']['n_ctx'])))
|
||||
return
|
||||
if args.deadline is None:
|
||||
parser.error('Absolute benchmark deadline required')
|
||||
command = ['python3', '-B', ROOT + 'paired_client.py', '--engine', 'strata', '--go',
|
||||
'--deadline', str(args.deadline)]
|
||||
process = subprocess.run(['athena-ssh', shlex.join(command)],
|
||||
input=json.dumps({'key': credential}), text=True, check=False)
|
||||
raise SystemExit(process.returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena-host model preparation only. Never starts an engine or changes Deck."""
|
||||
import argparse
|
||||
import fcntl
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import resource
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
BASE = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
ROOT = BASE
|
||||
RESERVE = 20 * 1024 ** 3
|
||||
STARTED = time.time()
|
||||
STATUS = ROOT / 'model-download.json'
|
||||
OWNED_LOCK = False
|
||||
|
||||
|
||||
def load_source():
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
assert source['repo'] == 'jesdga/Qwen3.8-Flash-Next-Basalt'
|
||||
assert source['filename'] == 'Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt'
|
||||
assert re.fullmatch('[0-9a-f]{40}', source['revision'])
|
||||
assert re.fullmatch('[0-9a-f]{64}', source['sha256'])
|
||||
assert source['size'] == 79867643037
|
||||
return source
|
||||
|
||||
|
||||
def write_status(state, **extra):
|
||||
value = dict(state=state, pid=os.getpid(), started=STARTED, updated=time.time(),
|
||||
activated=False, inference_performed=False, **extra)
|
||||
temporary = STATUS.with_suffix('.tmp')
|
||||
temporary.write_text(json.dumps(value, indent=2) + '\n')
|
||||
temporary.replace(STATUS)
|
||||
|
||||
|
||||
def check_root():
|
||||
spec = importlib.util.spec_from_file_location('candidate', ROOT / 'candidate.py')
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
module.validate(ROOT, ROOT)
|
||||
return module
|
||||
|
||||
|
||||
def verify_pack(path, source):
|
||||
assert path.is_file() and not path.is_symlink() and path.stat().st_size == source['size']
|
||||
write_status('verifying whole-file SHA-256', bytes=source['size'])
|
||||
with path.open('rb') as data:
|
||||
actual = hashlib.file_digest(data, 'sha256').hexdigest()
|
||||
assert actual == source['sha256'], 'Downloaded pack SHA-256 mismatch; original Strata untouched'
|
||||
# Import only the fixed public reader, after dropping privileges. It reads
|
||||
# a header and bounded metadata, not an engine or GPU context.
|
||||
sys.path.insert(0, str(ROOT / 'source/tools'))
|
||||
reader = importlib.import_module('model_file')
|
||||
pack = reader.ModelFile(str(path))
|
||||
names = pack.names()
|
||||
required = ('meta', 'dense', 'experts', 'experts.layout', 'gguf', 'profile', 'hc8')
|
||||
assert all(name in names and pack.section(name)[1] > 0 for name in required)
|
||||
assert any(name.startswith('tokenizer/') for name in names)
|
||||
assert any(name.startswith('mtp/') for name in names)
|
||||
assert pack.section('meta')[1] <= 32 * 1024 ** 2
|
||||
assert pack.verify('meta'), 'Pack metadata checksum mismatch'
|
||||
metadata = json.loads(pack.read('meta'))
|
||||
result = dict(repo=source['repo'], revision=source['revision'], filename=source['filename'],
|
||||
bytes=path.stat().st_size, sha256=actual, header_readable_by_pinned_build=True,
|
||||
section_count=len(names), sections={name:dict(offset=pack.section(name)[0],
|
||||
bytes=pack.section(name)[1]) for name in names},
|
||||
metadata_keys=sorted(metadata), activated=False, inference_performed=False)
|
||||
proof = ROOT / 'model-verification.json'
|
||||
proof.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(proof.read_text()) == result
|
||||
return result
|
||||
|
||||
|
||||
def download():
|
||||
global OWNED_LOCK, ROOT, STATUS
|
||||
check_root()
|
||||
source = load_source()
|
||||
lock = os.open(ROOT / 'model-download.lock', os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600)
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
OWNED_LOCK = True
|
||||
# The host parent is deliberately root-only. Retain access only to the
|
||||
# already validated owned directory, without chmod of shared ancestors.
|
||||
root_fd = os.open(ROOT, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW)
|
||||
ROOT = Path('/proc/self/fd') / str(root_fd)
|
||||
STATUS = ROOT / 'model-download.json'
|
||||
models = ROOT / 'models'
|
||||
assert models.is_dir() and not models.is_symlink() and models.resolve() == BASE / 'models'
|
||||
final = models / source['filename']
|
||||
partial = final.with_name(final.name + '.part')
|
||||
assert not final.is_symlink() and not partial.is_symlink()
|
||||
os.chdir(ROOT)
|
||||
if os.geteuid() == 0:
|
||||
os.setgroups([])
|
||||
os.setgid(65534)
|
||||
os.setuid(65534)
|
||||
os.setpriority(os.PRIO_PROCESS, 0, 19)
|
||||
resource.setrlimit(resource.RLIMIT_AS, (768 * 1024 ** 2, 768 * 1024 ** 2))
|
||||
os.environ.update(HOME=str(ROOT / 'home'), TMPDIR=str(ROOT / 'tmp'),
|
||||
XDG_CACHE_HOME=str(ROOT / 'cache'), HF_HOME=str(ROOT / 'cache/hf'))
|
||||
if final.exists():
|
||||
proof = verify_pack(final, source)
|
||||
write_status('verified', sha256=proof['sha256'], bytes=proof['bytes'], reused=True)
|
||||
return
|
||||
allocated = partial.stat().st_blocks * 512 if partial.exists() else 0
|
||||
assert shutil.disk_usage(models).free >= max(0, source['size'] - allocated) + RESERVE
|
||||
url = 'https://huggingface.co/' + source['repo'] + '/resolve/' + source['revision'] + '/' + source['filename']
|
||||
command = ['ionice', '-c', '3', 'aria2c', '--no-conf=true', '--enable-rpc=false',
|
||||
'--dir=' + str(models), '--out=' + partial.name, '--file-allocation=none',
|
||||
'--continue=true', '--auto-file-renaming=false', '--allow-overwrite=false',
|
||||
'--check-integrity=true', '--checksum=sha-256=' + source['sha256'],
|
||||
'--max-connection-per-server=4', '--split=4', '--min-split-size=32M',
|
||||
'--max-concurrent-downloads=1', '--disk-cache=16M', '--max-tries=5',
|
||||
'--retry-wait=5', '--connect-timeout=20', '--timeout=60',
|
||||
'--summary-interval=15', '--enable-color=false', '--download-result=hide', url]
|
||||
write_status('downloading', expected_bytes=source['size'], revision=source['revision'])
|
||||
with (ROOT / 'model-download.log').open('a') as output:
|
||||
process = subprocess.Popen(command, cwd=models, pass_fds=(root_fd,),
|
||||
stdout=output, stderr=subprocess.STDOUT)
|
||||
try:
|
||||
while process.poll() is None:
|
||||
time.sleep(10)
|
||||
if shutil.disk_usage(models).free < RESERVE:
|
||||
raise RuntimeError('20 GiB free-space floor reached; stopping only own download')
|
||||
if time.time() - STARTED > 7200:
|
||||
raise TimeoutError('Download time limit reached; owned partial file is resumable')
|
||||
allocated = partial.stat().st_blocks * 512 if partial.exists() else 0
|
||||
write_status('downloading', expected_bytes=source['size'],
|
||||
allocated_bytes=min(allocated, source['size']),
|
||||
allocated_bytes_are_not_verified_download_progress=True,
|
||||
revision=source['revision'])
|
||||
if process.returncode:
|
||||
raise RuntimeError('aria2 exited ' + str(process.returncode) + '; inspect scoped private log')
|
||||
finally:
|
||||
if process.poll() is None:
|
||||
process.terminate()
|
||||
process.wait(timeout=30)
|
||||
proof = verify_pack(partial, source)
|
||||
partial.replace(final)
|
||||
assert final.stat().st_size == source['size'] and not partial.exists()
|
||||
write_status('verified', sha256=proof['sha256'], bytes=proof['bytes'],
|
||||
elapsed_seconds=time.time() - STARTED,
|
||||
final=str(BASE / 'models' / source['filename']))
|
||||
|
||||
|
||||
def plan():
|
||||
module = check_root()
|
||||
source = load_source()
|
||||
before = json.loads((ROOT / 'production-before.json').read_text())
|
||||
assert module.snapshot() == before, 'Production changed: do not overwrite it'
|
||||
assert not module.owned_container(before['image'])
|
||||
assert shutil.which('aria2c') and shutil.which('ionice')
|
||||
assert shutil.disk_usage(ROOT).free >= source['size'] + RESERVE
|
||||
models = ROOT / 'models'
|
||||
assert not models.exists(), 'Existing model area: inspect/resume rather than recreating it'
|
||||
models.mkdir(mode=0o750)
|
||||
os.chown(models, 65534, 65534)
|
||||
record = dict(source=source, free_bytes=shutil.disk_usage(ROOT).free,
|
||||
required_bytes=source['size'], free_space_reserve_bytes=RESERVE,
|
||||
destination=str(models / source['filename']),
|
||||
no_additional_download_cache_copy=True, inference_performed=False)
|
||||
target = ROOT / 'model-plan.json'
|
||||
target.write_text(json.dumps(record, indent=2) + '\n')
|
||||
assert json.loads(target.read_text()) == record
|
||||
print(json.dumps(record), flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('action', choices=['plan', 'download'])
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
globals()[args.action]()
|
||||
except BaseException as error:
|
||||
# Never print redirect URLs, authentication data or full transport logs.
|
||||
if args.action == 'download' and OWNED_LOCK:
|
||||
write_status('failed', error_type=type(error).__name__, detail=str(error))
|
||||
raise
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside a future isolated GPU test container, only after separate Michael Go.
|
||||
|
||||
No production API, model stop/start or profile mutation is implemented here.
|
||||
The operator must drain/stop the original model beforehand and restore it after
|
||||
this process exits. The absolute deadline leaves the outer restoration reserve.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
parser.add_argument('--deadline', type=float, help='Absolute epoch deadline before restoration reserve')
|
||||
args = parser.parse_args()
|
||||
if not args.go or args.deadline is None:
|
||||
parser.error('Explicit Michael model-switch/test Go and absolute deadline required')
|
||||
assert time.time() < args.deadline <= time.time() + 720
|
||||
source = json.loads((ROOT / 'model-source.json').read_text())
|
||||
proof = json.loads((ROOT / 'model-verification.json').read_text())
|
||||
assert json.loads((ROOT / 'model-download.json').read_text())['state'] == 'verified'
|
||||
assert proof['sha256'] == source['sha256'] and proof['header_readable_by_pinned_build']
|
||||
assert (ROOT / 'models' / source['filename']).stat().st_size == source['size']
|
||||
assert not (ROOT / 'test-results.json').exists(), 'Never silently repeat a test'
|
||||
result: dict[str, Any] = dict(started=time.time(), deadline=args.deadline,
|
||||
production_modified_by_runner=False, passed=False)
|
||||
record = ROOT / 'test-runner-status.json'
|
||||
|
||||
def save(phase):
|
||||
result['phase'] = phase
|
||||
result['updated'] = time.time()
|
||||
record.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(record.read_text()) == result
|
||||
|
||||
save('loading one candidate; no production routes')
|
||||
python = ROOT / 'venv/bin/python'
|
||||
command = [ROOT / 'source/bin/basalt', 'serve', '--python', python,
|
||||
'--config', ROOT / 'test-config.json']
|
||||
with (ROOT / 'model-test-server.log').open('w') as output:
|
||||
server = subprocess.Popen(list(map(str, command)), cwd=ROOT / 'source',
|
||||
stdout=output, stderr=subprocess.STDOUT, start_new_session=True)
|
||||
try:
|
||||
load_deadline = min(args.deadline - 20, time.time() + 240)
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError('Owned Basalt server exited during load; inspect own server log')
|
||||
if time.time() >= load_deadline:
|
||||
raise TimeoutError('Load budget expired; restore original runtime')
|
||||
try:
|
||||
with urllib.request.urlopen('http://127.0.0.1:18320/props', timeout=2) as response:
|
||||
props = json.load(response)
|
||||
if not props['is_sleeping']:
|
||||
assert props['model_alias'] == 'athena-basalt-iq3xxs-test'
|
||||
assert props['total_slots'] == 2
|
||||
assert props['default_generation_settings']['n_ctx'] == 262144
|
||||
break
|
||||
except (OSError, urllib.error.URLError, KeyError):
|
||||
pass
|
||||
time.sleep(0.5)
|
||||
result['load_seconds'] = time.time() - result['started']
|
||||
save('short synthetic client; no tools executed')
|
||||
remaining = min(480, args.deadline - time.time() - 20)
|
||||
if remaining <= 0:
|
||||
raise TimeoutError('No test budget remains; restore original runtime')
|
||||
with (ROOT / 'test-client.log').open('w') as output:
|
||||
completed = subprocess.run([str(python), str(ROOT / 'test_client.py'), '--go'],
|
||||
cwd=ROOT, stdout=output, stderr=subprocess.STDOUT, timeout=remaining)
|
||||
assert completed.returncode == 0
|
||||
assert json.loads((ROOT / 'test-results.json').read_text())['passed']
|
||||
result['passed'] = True
|
||||
except BaseException as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
if server.poll() is None:
|
||||
os.killpg(server.pid, signal.SIGTERM)
|
||||
try:
|
||||
server.wait(timeout=15)
|
||||
except subprocess.TimeoutExpired:
|
||||
os.killpg(server.pid, signal.SIGKILL)
|
||||
server.wait(timeout=5)
|
||||
result['server_exit_code'] = server.poll()
|
||||
save('candidate stopped; outer operator must restore original Strata/Qwen')
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"server": {
|
||||
"model": "/opt/athena-deck-dev/basalt-candidate-9175e7a3211b/models/Qwen3.8-FN-GSQ-RCO-IQ3_XXS.basalt",
|
||||
"alias": "athena-basalt-iq3xxs-test",
|
||||
"parallel": 2,
|
||||
"slot-full-context": true,
|
||||
"host": "127.0.0.1",
|
||||
"port": 18320,
|
||||
"gpu": "auto"
|
||||
},
|
||||
"engine": {
|
||||
"max-context": 262144,
|
||||
"kv": "int8",
|
||||
"expert-cache": "auto",
|
||||
"prefill": "auto",
|
||||
"resident-experts": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"purpose": "Single short Basalt candidate test, prepared but not authorized to start by package preparation alone",
|
||||
"requires_new_explicit_model_switch_go": true,
|
||||
"production_restart_required": false,
|
||||
"production_profiles_must_not_be_modified": true,
|
||||
"gpu_uuid": "GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe",
|
||||
"gpu_name": "NVIDIA GeForce RTX 5080",
|
||||
"gpu_visibility": "Expose only the 5080 to the isolated candidate; auto selection must see one supported card",
|
||||
"unsupported_gpu": "RTX 3060, SM86, including peer tier",
|
||||
"cpu_mask": [0, 1, 2, 3, 6, 7, 8, 9],
|
||||
"production_container_cpu_limit": 12,
|
||||
"candidate_cpu_limit": 12,
|
||||
"candidate_ram_limit_gib": 52,
|
||||
"candidate_additional_swap": 0,
|
||||
"candidate_host_ram_headroom_guard_gib": 1.5,
|
||||
"slot_count": 2,
|
||||
"context_per_slot": 262144,
|
||||
"kv_type": "int8",
|
||||
"model_window_budget_seconds": 900,
|
||||
"load_budget_seconds": 240,
|
||||
"client_budget_seconds": 480,
|
||||
"restoration_reserved_seconds": 180,
|
||||
"network": "none; client and server use loopback inside one temporary container; no host ports",
|
||||
"start_conditions": [
|
||||
"Explicit Michael Go for the Qwen unload and short model test",
|
||||
"Model package size, SHA-256 and header verified",
|
||||
"Authenticated production drain confirms both active and waiting work are zero; unknown counters are not idle",
|
||||
"Normal supported model stop; no Deck, gateway or host restart",
|
||||
"Actual loaded configuration reports two slots of 262144; do not silently lower context if memory does not fit"
|
||||
],
|
||||
"workloads": ["solo 512 output tokens", "two simultaneous 512-token answers", "separate document markers and cached follow-ups", "long document marker retrieval", "strict JSON", "mock tool call and synthetic result; no real tools"],
|
||||
"sampling": {"temperature": 0, "seed": 42, "reasoning_effort": "none"},
|
||||
"reference_policy": "Reuse documented current Strata results, no old-engine rerun; Basalt 5080+RAM vs Strata 3060+5080 is not a controlled same-hardware engine A/B",
|
||||
"restoration": "Restore original Strata/Qwen profile and loaded speech state, compare protected settings and health; stop the test before the restoration reserve is consumed",
|
||||
"automatic_followup_variants": false,
|
||||
"prepared_only": true
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS offline tests with disposable synthetic directories; no Athena access."""
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
SPEC = importlib.util.spec_from_file_location('candidate', Path(__file__).with_name('candidate.py'))
|
||||
module = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(module)
|
||||
|
||||
|
||||
class CleanupTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.temp = tempfile.TemporaryDirectory(prefix='basalt-cleanup-')
|
||||
self.addCleanup(self.temp.cleanup)
|
||||
self.parent = Path(self.temp.name)
|
||||
self.root = self.parent / 'candidate'
|
||||
self.root.mkdir()
|
||||
module.dump(self.root / module.MARKER, module.marker(self.root))
|
||||
|
||||
def test_owned_tree_removed_and_external_symlink_target_preserved(self):
|
||||
external = self.parent / 'external'
|
||||
external.write_text('must survive')
|
||||
(self.root / 'nested').mkdir()
|
||||
(self.root / 'nested/file').write_text('synthetic')
|
||||
(self.root / 'outside-link').symlink_to(external)
|
||||
module.remove_tree(self.root, self.root)
|
||||
self.assertFalse(self.root.exists())
|
||||
self.assertEqual(external.read_text(), 'must survive')
|
||||
|
||||
def test_wrong_owner_refused(self):
|
||||
(self.root / module.MARKER).write_text(json.dumps({'owner': 'another-user'}))
|
||||
with self.assertRaisesRegex(RuntimeError, 'ownership'):
|
||||
module.remove_tree(self.root, self.root)
|
||||
self.assertTrue(self.root.exists())
|
||||
|
||||
def test_symlink_root_refused(self):
|
||||
link = self.parent / 'link'
|
||||
link.symlink_to(self.root, target_is_directory=True)
|
||||
with self.assertRaisesRegex(RuntimeError, 'symlinked'):
|
||||
module.remove_tree(link, link)
|
||||
self.assertTrue(self.root.exists())
|
||||
|
||||
def test_different_expected_root_refused(self):
|
||||
with self.assertRaisesRegex(RuntimeError, 'unexpected'):
|
||||
module.remove_tree(self.root, self.parent / 'elsewhere')
|
||||
|
||||
def test_marker_symlink_refused_without_following_it(self):
|
||||
marker = self.root / module.MARKER
|
||||
marker.unlink()
|
||||
external = self.parent / 'external'
|
||||
external.write_text('not an ownership marker')
|
||||
marker.symlink_to(external)
|
||||
with self.assertRaises(OSError):
|
||||
module.remove_tree(self.root, self.root)
|
||||
self.assertEqual(external.read_text(), 'not an ownership marker')
|
||||
|
||||
def test_mocked_nested_mount_refused(self):
|
||||
line = '1 2 0:1 / ' + str(self.root / 'borrowed') + ' rw - tmpfs tmpfs rw\n'
|
||||
with patch.object(module.Path, 'read_text', return_value=line):
|
||||
with self.assertRaisesRegex(RuntimeError, 'mount'):
|
||||
module.remove_tree(self.root, self.root)
|
||||
|
||||
def test_live_owned_child_refused_then_stopped_fixture_removed(self):
|
||||
process = subprocess.Popen([sys.executable, '-c', 'import time;time.sleep(30)'], cwd=self.root)
|
||||
try:
|
||||
with self.assertRaisesRegex(RuntimeError, 'process'):
|
||||
module.remove_tree(self.root, self.root)
|
||||
finally:
|
||||
process.terminate()
|
||||
process.wait(timeout=5)
|
||||
module.remove_tree(self.root, self.root)
|
||||
self.assertFalse(self.root.exists())
|
||||
|
||||
def test_check_maps_hardcoded_tmp_back_into_owned_candidate(self):
|
||||
before = {'image': 'existing-test-image'}
|
||||
module.dump(self.root / 'production-before.json', before)
|
||||
process = Mock(returncode=0)
|
||||
process.poll.return_value = 0
|
||||
with patch.object(module, 'ROOT', self.root), \
|
||||
patch.object(module, 'available', return_value=8192), \
|
||||
patch.object(module, 'snapshot', return_value=before), \
|
||||
patch.object(module, 'owned_container', return_value=None), \
|
||||
patch.object(module.subprocess, 'Popen', return_value=process) as launch:
|
||||
module.run_phase('check')
|
||||
command = launch.call_args.args[0]
|
||||
self.assertIn(f'type=bind,src={self.root / "tmp"},dst=/tmp', command)
|
||||
self.assertEqual(command[command.index('--network') + 1], 'none')
|
||||
self.assertEqual(command[command.index('--memory') + 1], '2g')
|
||||
self.assertEqual(command[command.index('--memory-swap') + 1], '2g')
|
||||
self.assertEqual(command[command.index('--pids-limit') + 1], '512')
|
||||
|
||||
def test_manifest_includes_nested_manifests_and_directory_symlinks(self):
|
||||
package = self.root / 'package'
|
||||
package.mkdir()
|
||||
(package / 'manifest.json').write_text('{}')
|
||||
(self.root / 'manifest.json').write_text('{}')
|
||||
(self.root / 'directory-link').symlink_to(package, target_is_directory=True)
|
||||
before = {'image': 'existing-test-image'}
|
||||
module.dump(self.root / 'production-before.json', before)
|
||||
module.dump(self.root / 'status.json', {
|
||||
'phase': 'built and CPU-checked; awaiting separate model-test Go',
|
||||
'commit': module.COMMIT, 'inference_performed': False})
|
||||
with patch.object(module, 'ROOT', self.root), \
|
||||
patch.object(module, 'snapshot', return_value=before), \
|
||||
patch.object(module, 'owned_container', return_value=None), \
|
||||
patch.object(module, 'rehearsal'):
|
||||
module.verify()
|
||||
entries = {row['path']: row for row in json.loads((self.root / 'manifest.json').read_text())['files']}
|
||||
self.assertIn('package/manifest.json', entries)
|
||||
self.assertNotIn('manifest.json', entries)
|
||||
self.assertTrue(entries['directory-link']['symlink'])
|
||||
self.assertNotIn('sha256', entries['directory-link'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,190 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inside the future isolated Basalt test container; never changes production.
|
||||
|
||||
Only --go permits HTTP/model requests. Preparation must not use that flag.
|
||||
All conversations and tool results below are explicitly synthetic fixtures.
|
||||
"""
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import fcntl
|
||||
import json
|
||||
from pathlib import Path
|
||||
import threading
|
||||
import time
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
|
||||
ROOT = Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
BASE = 'http://127.0.0.1:18320'
|
||||
MODEL = 'athena-basalt-iq3xxs-test'
|
||||
TOOL = {'type': 'function', 'function': {'name': 'lookup_order',
|
||||
'description': 'Synthetic test lookup; no real system.',
|
||||
'parameters': {'type': 'object', 'properties': {'order_id': {'type': 'string'}},
|
||||
'required': ['order_id'], 'additionalProperties': False}}}
|
||||
|
||||
|
||||
def parse_sse(lines, first_content=None) -> dict[str, Any]:
|
||||
result: dict[str, Any] = dict(content='', usage={}, timings={}, tool_calls=[], stream_complete=False,
|
||||
finish_reason=None)
|
||||
calls: dict[int, Any] = {}
|
||||
seen_content = False
|
||||
for line in lines:
|
||||
if not line.startswith(b'data:'):
|
||||
continue
|
||||
raw = line[5:].strip()
|
||||
if raw == b'[DONE]':
|
||||
result['stream_complete'] = True
|
||||
break
|
||||
item = json.loads(raw)
|
||||
if 'error' in item:
|
||||
raise RuntimeError(str(item['error']))
|
||||
result['usage'] = item.get('usage') or result['usage']
|
||||
result['timings'] = item.get('timings') or item.get('backend_timings') or result['timings']
|
||||
for choice in item.get('choices', []):
|
||||
delta = choice.get('delta', {})
|
||||
if not seen_content and (delta.get('content') or delta.get('tool_calls')):
|
||||
seen_content = True
|
||||
if first_content:
|
||||
first_content()
|
||||
result['content'] += delta.get('content') or ''
|
||||
result['finish_reason'] = choice.get('finish_reason') or result['finish_reason']
|
||||
for part in delta.get('tool_calls', []):
|
||||
target = calls.setdefault(part.get('index', 0), {'id': '', 'type': 'function',
|
||||
'function': {'name': '', 'arguments': ''}})
|
||||
target['id'] = part.get('id') or target['id']
|
||||
for key in ('name', 'arguments'):
|
||||
target['function'][key] += part.get('function', {}).get(key) or ''
|
||||
result['tool_calls'] = list(calls.values())
|
||||
assert result['stream_complete'], 'Incomplete SSE stream'
|
||||
assert result['usage'].get('completion_tokens', 0) > 0, 'Missing real output-token usage'
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--go', action='store_true')
|
||||
args = parser.parse_args()
|
||||
if not args.go:
|
||||
parser.error('Explicit Michael model-switch/test Go required before any HTTP request')
|
||||
assert json.loads((ROOT / 'model-download.json').read_text())['state'] == 'verified'
|
||||
lock = (ROOT / 'test-client.lock').open('a')
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
output = ROOT / 'test-results.json'
|
||||
assert not output.exists(), 'Existing test result: inspect, never silently repeat a model test'
|
||||
start = time.monotonic()
|
||||
deadline = start + 480
|
||||
result: dict[str, Any] = dict(started=time.time(), client_budget_seconds=480, model=MODEL,
|
||||
historical_reference_not_controlled=True, requests=[], groups=[], passed=False)
|
||||
|
||||
def save():
|
||||
result['elapsed_seconds'] = time.monotonic() - start
|
||||
output.write_text(json.dumps(result, indent=2) + '\n')
|
||||
assert json.loads(output.read_text()) == result
|
||||
|
||||
def get(path):
|
||||
with urllib.request.urlopen(BASE + path, timeout=8) as response:
|
||||
return json.load(response)
|
||||
|
||||
def request(label, messages, maximum=128, barrier=None, **extra) -> dict[str, Any]:
|
||||
if barrier:
|
||||
barrier.wait(timeout=10)
|
||||
began = time.monotonic()
|
||||
assert began < deadline, 'Client budget exhausted; restore original runtime'
|
||||
body = dict(model=MODEL, messages=messages, max_tokens=maximum, temperature=0,
|
||||
seed=42, reasoning_effort='none', stream=True,
|
||||
stream_options={'include_usage': True}, **extra)
|
||||
first = []
|
||||
req = urllib.request.Request(BASE + '/v1/chat/completions', data=json.dumps(body).encode(),
|
||||
headers={'Content-Type': 'application/json'})
|
||||
with urllib.request.urlopen(req, timeout=min(120, max(1, deadline - began))) as response:
|
||||
def lines():
|
||||
for line in response:
|
||||
if time.monotonic() >= deadline:
|
||||
raise TimeoutError('Client budget exhausted')
|
||||
yield line
|
||||
row = parse_sse(lines(), lambda: first.append(time.monotonic() - began))
|
||||
row.update(label=label, wall_seconds=time.monotonic() - began,
|
||||
ttft_seconds=first[0] if first else None)
|
||||
return row
|
||||
|
||||
def add(row):
|
||||
result['requests'].append(row)
|
||||
save()
|
||||
|
||||
def pair(label, conversations, maximum):
|
||||
barrier = threading.Barrier(2)
|
||||
began = time.monotonic()
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
|
||||
futures = [pool.submit(request, label + '-' + str(i), messages, maximum, barrier)
|
||||
for i, messages in enumerate(conversations)]
|
||||
rows = [future.result() for future in futures]
|
||||
wall = time.monotonic() - began
|
||||
tokens = sum(row['usage']['completion_tokens'] for row in rows)
|
||||
result['groups'].append(dict(label=label, wall_seconds=wall,
|
||||
output_tokens=tokens, end_to_end_output_tokens_per_second=tokens / wall))
|
||||
for row in rows:
|
||||
add(row)
|
||||
return rows
|
||||
|
||||
try:
|
||||
props = get('/props')
|
||||
assert props['model_alias'] == MODEL and props['total_slots'] == 2
|
||||
assert props['default_generation_settings']['n_ctx'] == 262144 and not props['is_sleeping']
|
||||
slots = get('/slots')
|
||||
assert len(slots) == 2 and all(row['n_ctx'] == 262144 and not row['is_processing'] for row in slots)
|
||||
result['verified_slots'] = slots
|
||||
short = [[{'role': 'system', 'content': f'Kurzmessung 0, Gespräch {i}. Schreibe auf Deutsch.'},
|
||||
{'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)]
|
||||
add(request('solo-512', short[0], 512))
|
||||
short[0][0]['content'] += ' Parallele Messung.'
|
||||
pair('parallel-512', short, 512)
|
||||
contexts = []
|
||||
for i, marker in enumerate(('ORION_029_A', 'VEGA_029_B')):
|
||||
facts = '\n'.join(f'Datensatz {n:05d}: Bereich Lager, Farbe blau, geprüft und freigegeben.' for n in range(320))
|
||||
contexts.append([{'role': 'system', 'content': 'Lies nur das eigene Dokument. Antworte kurz und exakt.'},
|
||||
{'role': 'user', 'content': f'Dokument {i}:\n{facts}\nGeheime Kennung: {marker}\nNenne ausschließlich die geheime Kennung.'}])
|
||||
cold = pair('fresh-context-pair', contexts, 128)
|
||||
for i, row in enumerate(cold):
|
||||
assert ('ORION_029_A', 'VEGA_029_B')[i] in row['content']
|
||||
assert ('VEGA_029_B', 'ORION_029_A')[i] not in row['content']
|
||||
following = [messages + [{'role': 'assistant', 'content': row['content']},
|
||||
{'role': 'user', 'content': 'Welche geheime Kennung stand in meinem Dokument? Nur die Kennung.'}]
|
||||
for messages, row in zip(contexts, cold)]
|
||||
cached = pair('cached-context-pair', following, 128)
|
||||
for i, row in enumerate(cached):
|
||||
assert ('ORION_029_A', 'VEGA_029_B')[i] in row['content']
|
||||
result['cache_slot_snapshot'] = get('/slots')
|
||||
text = '\n'.join(f'Archivzeile {n:05d}: Standort West, Kategorie Ersatzteile, Freigabe dokumentiert.' for n in range(2400))
|
||||
long = request('long-context-retrieval', [{'role': 'user', 'content':
|
||||
'Merke am Anfang: ALPHA_029.\n' + text + '\nMerke am Ende: OMEGA_029.\nNenne ausschließlich die beiden Merkwörter.'}])
|
||||
add(long)
|
||||
assert all(marker in long['content'] for marker in ('ALPHA_029', 'OMEGA_029'))
|
||||
row = request('json', [{'role': 'user', 'content':
|
||||
'Antworte ausschließlich als JSON mit exakt diesen Werten: {"ok":true,"marker":"ATHENA029"}'}])
|
||||
add(row)
|
||||
assert json.loads(row['content']) == {'ok': True, 'marker': 'ATHENA029'}
|
||||
messages = [{'role': 'user', 'content': 'Rufe lookup_order für die Bestellung TEST-029 auf. Erfinde kein Ergebnis.'}]
|
||||
row = request('mock-tool-call', messages, 256, tools=[TOOL], tool_choice='auto')
|
||||
add(row)
|
||||
assert len(row['tool_calls']) == 1
|
||||
call = row['tool_calls'][0]
|
||||
assert call['function']['name'] == 'lookup_order'
|
||||
assert json.loads(call['function']['arguments']) == {'order_id': 'TEST-029'}
|
||||
messages += [{'role': 'assistant', 'content': row['content'] or None, 'tool_calls': row['tool_calls']},
|
||||
{'role': 'tool', 'tool_call_id': call['id'], 'content': '{"order_id":"TEST-029","state":"READY"}'}]
|
||||
follow = request('mock-tool-result', messages, 256, tools=[TOOL], tool_choice='none')
|
||||
add(follow)
|
||||
assert 'READY' in follow['content'] and not follow['tool_calls']
|
||||
assert len(result['requests']) == 11
|
||||
result['passed'] = True
|
||||
except BaseException as error:
|
||||
result['error'] = type(error).__name__ + ': ' + str(error)
|
||||
raise
|
||||
finally:
|
||||
save()
|
||||
print(json.dumps({key: result[key] for key in ('passed', 'elapsed_seconds')}, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS-only synthetic protocol/config tests. No model or network requests."""
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
HERE = Path(__file__).parent
|
||||
SPEC = importlib.util.spec_from_file_location('basalt_test_client', HERE / 'test_client.py')
|
||||
assert SPEC is not None and SPEC.loader is not None
|
||||
client = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(client)
|
||||
|
||||
|
||||
def frame(data):
|
||||
return b'data: ' + json.dumps(data).encode() + b'\n'
|
||||
|
||||
|
||||
class ProtocolTests(unittest.TestCase):
|
||||
def test_synthetic_content_and_usage(self):
|
||||
first = []
|
||||
row = client.parse_sse([
|
||||
frame({'choices': [{'delta': {'content': 'fixture'}, 'finish_reason': 'stop'}]}),
|
||||
frame({'choices': [], 'usage': {'completion_tokens': 1, 'prompt_tokens': 2}}),
|
||||
b'data: [DONE]\n'], lambda: first.append(True))
|
||||
self.assertEqual(row['content'], 'fixture')
|
||||
self.assertEqual(first, [True])
|
||||
self.assertEqual(row['usage']['completion_tokens'], 1)
|
||||
|
||||
def test_synthetic_split_tool_arguments(self):
|
||||
row = client.parse_sse([
|
||||
frame({'choices': [{'delta': {'tool_calls': [{'index': 0, 'id': 'fixture-call',
|
||||
'function': {'name': 'lookup_order', 'arguments': '{"order_id":'}}]}}]}),
|
||||
frame({'choices': [{'delta': {'tool_calls': [{'index': 0,
|
||||
'function': {'arguments': '"TEST-029"}'}}]}, 'finish_reason': 'tool_calls'}]}),
|
||||
frame({'choices': [], 'usage': {'completion_tokens': 8}}), b'data: [DONE]\n'])
|
||||
call = row['tool_calls'][0]
|
||||
self.assertEqual(call['id'], 'fixture-call')
|
||||
self.assertEqual(call['function']['name'], 'lookup_order')
|
||||
self.assertEqual(json.loads(call['function']['arguments']), {'order_id': 'TEST-029'})
|
||||
|
||||
def test_incomplete_stream_is_not_accepted(self):
|
||||
with self.assertRaisesRegex(AssertionError, 'Incomplete'):
|
||||
client.parse_sse([frame({'choices': [], 'usage': {'completion_tokens': 1}})])
|
||||
|
||||
def test_missing_usage_is_not_a_success(self):
|
||||
with self.assertRaisesRegex(AssertionError, 'usage'):
|
||||
client.parse_sse([b'data: [DONE]\n'])
|
||||
|
||||
def test_no_go_refuses_before_http_or_model_files(self):
|
||||
process = subprocess.run([sys.executable, '-B', str(HERE / 'test_client.py')],
|
||||
capture_output=True, text=True)
|
||||
self.assertNotEqual(process.returncode, 0)
|
||||
self.assertIn('Explicit Michael model-switch/test Go required', process.stderr)
|
||||
|
||||
def test_prepared_config_and_total_window(self):
|
||||
config = json.loads((HERE / 'test-config.json').read_text())
|
||||
plan = json.loads((HERE / 'test-plan.json').read_text())
|
||||
source = json.loads((HERE / 'model-source.json').read_text())
|
||||
self.assertEqual(config['server']['alias'], client.MODEL)
|
||||
self.assertEqual(config['server']['parallel'], 2)
|
||||
self.assertTrue(config['server']['slot-full-context'])
|
||||
self.assertEqual(config['engine']['max-context'], 262144)
|
||||
self.assertEqual(config['engine']['kv'], 'int8')
|
||||
self.assertTrue(config['server']['model'].endswith('/models/' + source['filename']))
|
||||
self.assertEqual(sum(plan[key] for key in ('load_budget_seconds', 'client_budget_seconds',
|
||||
'restoration_reserved_seconds')), 900)
|
||||
self.assertTrue(plan['requires_new_explicit_model_switch_go'])
|
||||
self.assertTrue(plan['prepared_only'])
|
||||
|
||||
def test_runner_refuses_without_model_switch_go_and_deadline(self):
|
||||
process = subprocess.run([sys.executable, '-B', str(HERE / 'run_short_test.py')],
|
||||
capture_output=True, text=True)
|
||||
self.assertNotEqual(process.returncode, 0)
|
||||
self.assertIn('Explicit Michael model-switch/test Go and absolute deadline required', process.stderr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,127 @@
|
||||
"""Offline harness tests with deliberately synthetic HTTP fixtures, never model rates."""
|
||||
import contextlib
|
||||
import http.server
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
SPEC = importlib.util.spec_from_file_location('paired_client', Path(__file__).with_name('paired_client.py'))
|
||||
assert SPEC is not None and SPEC.loader is not None
|
||||
CLIENT = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(CLIENT)
|
||||
|
||||
|
||||
class ProtocolTests(unittest.TestCase):
|
||||
def test_same_window_overlaps(self):
|
||||
self.assertEqual(CLIENT.overlaps([dict(first_content_at=2, finished_at=8),
|
||||
dict(first_content_at=5, finished_at=10)]), 3)
|
||||
self.assertEqual(CLIENT.overlaps([dict(first_content_at=2, finished_at=4),
|
||||
dict(first_content_at=5, finished_at=10)]), 0)
|
||||
self.assertEqual(CLIENT.overlaps([]), 0)
|
||||
|
||||
def test_slower_guard_is_conservative_total_work(self):
|
||||
self.assertGreater(CLIENT.slower_budget(200), 200 * 1.1)
|
||||
with self.assertRaises(AssertionError):
|
||||
CLIENT.slower_budget(0)
|
||||
|
||||
def test_missing_go_never_opens_http(self):
|
||||
argv = ['paired_client.py', '--engine', 'basalt', '--deadline', str(time.time() + 60)]
|
||||
with patch.object(sys, 'argv', argv), patch.object(CLIENT.http.client, 'HTTPConnection') as connection:
|
||||
with contextlib.redirect_stderr(io.StringIO()), self.assertRaises(SystemExit) as error:
|
||||
CLIENT.main()
|
||||
self.assertEqual(error.exception.code, 2)
|
||||
connection.assert_not_called()
|
||||
|
||||
def test_real_deck_validator_accepts_no_thinking_request(self):
|
||||
from api_compat import normalize_chat, apply_reasoning_budget, CompatibilityError
|
||||
spec = importlib.util.spec_from_file_location('paired_strata_client',
|
||||
Path(__file__).with_name('paired_strata_client.py'))
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
body = module.make_body('flash-next-strata-iq3-dual',
|
||||
[{'role': 'user', 'content': 'Offline contract check'}], 504)
|
||||
with self.assertRaises(CompatibilityError):
|
||||
normalize_chat({**body, 'reasoning_budget_tokens': 0})
|
||||
normalized, _ = normalize_chat(body)
|
||||
effective = apply_reasoning_budget(normalized, {})
|
||||
self.assertEqual(effective['reasoning_effort'], 'none')
|
||||
self.assertEqual(effective['max_tokens'], 504)
|
||||
self.assertNotIn('reasoning_budget_tokens', effective)
|
||||
|
||||
def test_finished_response_survives_other_request_timeout(self):
|
||||
# Mock counts intentionally stand for the API contract only. There is
|
||||
# no real tokenizer/model/inference in this offline regression test.
|
||||
class Handler(http.server.BaseHTTPRequestHandler):
|
||||
def log_message(self, format, *args):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
value = dict(total_slots=2, default_generation_settings=dict(n_ctx=262144)) if self.path == '/props' else []
|
||||
body = json.dumps(value).encode()
|
||||
self.send_response(200)
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def do_POST(self):
|
||||
body = json.loads(self.rfile.read(int(self.headers['Content-Length'])))
|
||||
warm = body['max_tokens'] == 504
|
||||
slow = warm and body['messages'][0]['content'].endswith('B')
|
||||
self.send_response(200)
|
||||
self.end_headers()
|
||||
if slow:
|
||||
time.sleep(2)
|
||||
text = 'offline fixture answer' if warm else 'OK'
|
||||
tokens = 261632 if warm else 261500
|
||||
events = [dict(choices=[dict(delta=dict(content=text))]),
|
||||
dict(choices=[dict(delta={}, finish_reason='length' if warm else 'stop')],
|
||||
usage=dict(prompt_tokens=tokens, completion_tokens=504 if warm else 2,
|
||||
prompt_tokens_details=dict(cached_tokens=261501 if warm else 0)))]
|
||||
try:
|
||||
for event in events:
|
||||
self.wfile.write(b'data: ' + json.dumps(event).encode() + b'\n\n')
|
||||
self.wfile.flush()
|
||||
self.wfile.write(b'data: [DONE]\n\n')
|
||||
except (BrokenPipeError, ConnectionResetError):
|
||||
pass
|
||||
|
||||
with tempfile.TemporaryDirectory() as temp:
|
||||
root = Path(temp)
|
||||
docs = [dict(tag=tag, initial=[dict(role='user', content='preload ' + tag)],
|
||||
final=[dict(role='user', content='warm ' + tag)], initial_tokens=261500,
|
||||
final_tokens=261632) for tag in ('A', 'B')]
|
||||
(root / 'paired-fixtures.json').write_text(json.dumps(docs))
|
||||
server = http.server.ThreadingHTTPServer(('127.0.0.1', 0), Handler)
|
||||
thread = threading.Thread(target=server.serve_forever, daemon=True)
|
||||
thread.start()
|
||||
original = CLIENT.http.client.HTTPConnection
|
||||
def redirected(host, port, **kwargs):
|
||||
return original('127.0.0.1', server.server_port, **kwargs)
|
||||
argv = ['paired_client.py', '--go', '--engine', 'basalt', '--deadline', str(time.time() + 1)]
|
||||
try:
|
||||
with patch.object(CLIENT, 'ROOT', root), patch.object(sys, 'argv', argv), \
|
||||
patch.object(CLIENT.http.client, 'HTTPConnection', redirected), \
|
||||
contextlib.redirect_stdout(io.StringIO()):
|
||||
CLIENT.main()
|
||||
result = json.loads((root / 'paired-basalt.json').read_text())
|
||||
completed = [r for r in result['requests'] if r['phase'] == 'full-output' and r['tag'] == 'A']
|
||||
self.assertEqual(len(completed), 1)
|
||||
self.assertTrue(completed[0]['stream_complete'])
|
||||
self.assertEqual(completed[0]['usage']['completion_tokens'], 504)
|
||||
self.assertEqual(result['stop_reason'], 'hard_benchmark_deadline')
|
||||
self.assertFalse(result['passed'])
|
||||
finally:
|
||||
server.shutdown()
|
||||
server.server_close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,60 @@
|
||||
# Basalt-Deck-Anbindung: lokaler Entwicklungsstand
|
||||
|
||||
## Ergebnis
|
||||
|
||||
Eigene Basalt-Laufzeit und eigener Worker, Chat-Routing hinter derselben Deck-
|
||||
API, feste öffentliche Paketquelle, Modellkatalog-/Profil-/Preset-Validierung,
|
||||
per-Slot-API-Metadaten, Laufzeitseite und Backup-/Restore-Rezept implementiert.
|
||||
Strata bleibt erhalten. Kein Produktivwechsel, Modellstart, Neustart oder
|
||||
Verschieben des bestehenden Kandidaten durch diese Entwicklungsprüfung.
|
||||
|
||||
## Tatsächliche Prüfungen
|
||||
|
||||
```sh
|
||||
PYTHONWARNINGS=ignore::ResourceWarning python -m unittest \
|
||||
test_basalt test_strata test_model_management test_dashboard_data \
|
||||
test_backup test_execution_setup test_endpoint test_chat_test \
|
||||
test_reasoning_budget -q
|
||||
```
|
||||
|
||||
Letzter Lauf: **174 Tests bestanden**, 67.487 Sekunden. Die vorherige rote
|
||||
Backup-Fixture hatte zuerst eine willkürliche statt quellabgeleitete Modell-ID,
|
||||
anschließend ein geteiltes Python-Parameterobjekt für Profil und Preset.
|
||||
Beides in der Fixture korrigiert; keine Abschwächung der Backup-Validierung.
|
||||
Der gezielte Regressionstest und der gesamte obige Satz sind grün.
|
||||
Die TTS-Logzeilen dieses Laufs gehören ausschließlich zu synthetischen lokalen
|
||||
Tests einschließlich erwarteter Fehlerfälle, nicht zu Produktiv-TTS.
|
||||
|
||||
`git diff --check` und `node --check` für `profiles-ui.js`, `strata-ui.js`,
|
||||
`dashboard-ui.js`, `studio.js` und `app.js` bestanden.
|
||||
|
||||
Echte Browser-DOM-Prüfung mit tatsächlichem Editor-JavaScript und ausdrücklich
|
||||
synthetischer isolierter API: Basalt-Paket vorausgewählt, 5080 vorgeschlagen,
|
||||
Strata → llama.cpp → Basalt umgeschaltet, zugehörige Regler geprüft, zwei
|
||||
262144-Kontext-Slots eingegeben und Speicherpayload durch die wirkliche
|
||||
Python-`chat_parameters`-Validierung geprüft. Auch Basalt-Laufzeitseite,
|
||||
Installationsknopf, Paketstatus und Profilknopf geprüft. Keine produktiven
|
||||
POSTs und keine echte Modellantwort in diesem Browser-Test.
|
||||
|
||||
## Offene Grenzen / Aktivierungssperren
|
||||
|
||||
- Noch keine Installation/Aktivierung dieses Deck-Codes auf Athena, kein
|
||||
echter Modelltest durch den neuen Worker, kein qualifizierter nativer
|
||||
Gesamtbuild mit diesem neuen Installer und kein Fresh-Host-Vollrestore.
|
||||
- Das bestehende geprüfte Paket liegt weiterhin auf der Samsung 980 PRO,
|
||||
nicht auf dem `/data`-Datenträger WD Blue SN580. Der neue Downloadweg nutzt
|
||||
den gewöhnlichen Deck-Modellkatalog. Vor Aktivierung Katalog-Mount und
|
||||
verwaltete Übernahme auf der gewünschten Samsung ausdrücklich klären;
|
||||
kein ungeprüfter Zweitdownload oder versteckter Kandidaten-Pfad.
|
||||
- Zentrale Basalt-Live-/Summen-Tokenraten sind noch nicht angebunden.
|
||||
Inhaltsfreie Slots/Properties werden angezeigt; Basalts JSON-Request-
|
||||
Historie wird nicht als Dashboard-Metrik eingesammelt. Testchat-Timings
|
||||
bleiben separat verfügbar.
|
||||
- Zunächst nur Text. TTS-/STT-Betrieb und vorhandene Projektoren nicht geändert;
|
||||
Qwen-TTS oder Vision auf GPU sind ein eigener späterer Auftrag.
|
||||
- Produktionsaktivierung einschließlich notwendigem Deck/API-Neustart und
|
||||
Modellwechsel braucht ein separates Go und nachgewiesenen normalen Drain.
|
||||
Frühere Kandidatentests sind keine dauerhafte Aktivierungsfreigabe.
|
||||
|
||||
Native Voraussetzungen, feste Quellen, Speicherpolitik, Wiederherstellung und
|
||||
Rückfall: [Basalt-Rezept](../../../deploy/BASALT_NATIVE.md).
|
||||
@@ -0,0 +1,88 @@
|
||||
# Dashboard / Athena Pulse: Basalt-Telemetrie
|
||||
|
||||
## Stand: aktiviert; API-Funktionsprüfungen bestanden, GUI-Endabnahme offen
|
||||
|
||||
Nach Michaels ausdrücklichem Go und normaler Management-Anmeldung regulär
|
||||
drainiert: API gestoppt, aktive/wartende/TTS-wartende Anfragen jeweils null,
|
||||
kein Schedulerwechsel. Overlay auf dem laufenden TTS-RAM-Fix-Image gebaut,
|
||||
vollständigen isolierten Server-Konstruktor geprüft, anschließend aktiviert.
|
||||
Produktives Image `athena-deck-standalone:basalt-telemetry`, Zustand `healthy`.
|
||||
Alle sechs App-Dateihashes sowohl im Image als auch in der kanonischen Quelle
|
||||
geprüft. Profile, Endpoint-, Audio-, CPU- und Reasoning-Einstellungen unverändert.
|
||||
|
||||
Bestehendes Basalt-Profil wieder geladen, Antwort `BEREIT` nach 22,01 Sekunden.
|
||||
Danach vier begrenzte echte synthetische Chat-Aufrufe und ein Speech-Aufruf:
|
||||
beide Slots gleichzeitig, positive Einlese-/Generierungsraten und Cache-Reuse
|
||||
beobachtet. Folgeaufruf: 13827 Cache-Token. Die echten Antwort-Timings enthalten
|
||||
positive MTP-Draft-/Akzeptanzwerte. Anna lieferte 4,08 Sekunden 24-kHz-Mono-WAV.
|
||||
Dieser Prüfungssatz dauerte 13,51 Sekunden und ist kein Benchmark.
|
||||
Evidenz auf dem NAS: `/opt/data/profiles/athena-deck/cache/scratch/telemetry-live-acceptance.json`.
|
||||
Basalt auf 5080, Vision und TTS auf 3060 durch GPU-Prozessmetadaten bestätigt.
|
||||
|
||||
**Noch offen:** Der Neustart beendet normale Management-Sitzungen; anschließender
|
||||
Dashboard-Aufruf liefert HTTP 401. Erneute normale Anmeldung für die produktive
|
||||
GUI-Prüfung und das Ablesen der globalen Queue-/MTP-/Modellstartzähler erforderlich.
|
||||
Kein erneutes Aktivierungs-Go und kein weiterer Neustart nötig. Native Mac-
|
||||
Client- und vollständige Fresh-Host-/Restore-Abnahme bleiben ebenfalls offen.
|
||||
|
||||
## Implementierung und vorausgegangene Prüfungen
|
||||
|
||||
Ursache: Der bisherige Dashboard-Pfad setzte Basalt nicht auf den gemeinsamen
|
||||
Slot-/Metrikvertrag um; deshalb fehlten Anzeigen oder zeigten scheinbare Nullen.
|
||||
Basalts ursprüngliches JSON-`/metrics` enthält Requestverlauf und ist hierfür
|
||||
keine geeignete Quelle.
|
||||
|
||||
`basalt_serve.py` ergänzt den gepinnten Upstream-Server um ein authentifiziertes,
|
||||
inhaltsfreies `/telemetry`. `basalt_telemetry.py` liefert Slot 0/1, Belegung und
|
||||
Phasen, rollierende Generierungsrate, Engine-Prefill-Mittel sowie Cache-/MTP-
|
||||
und Tokenzähler. Abschlusszähler sind vom 500-Einträge-Verlauf unabhängig.
|
||||
Modellprozess-Generationen setzen sauber zurück; gleichzeitiger Requestabschluss
|
||||
oder Prozesswechsel beim Sampling wird ohne Doppelzählung behandelt. Unbekannte
|
||||
Werte werden nicht in Nullen oder unvollständige Lebenszeitsummen umgewandelt.
|
||||
|
||||
Dashboard und bestehendes `/v1/telemetry/speed` beziehen dieselbe Projektion.
|
||||
Pulse behält seinen bisherigen Schema-1-Vertrag und Backend-Gesamtscope.
|
||||
Keine Änderung am Plugin, anderen Hermes-Profilen oder der Mac-App erforderlich.
|
||||
Das ist eine Vertragsprüfung, noch keine native Mac-Client-Endabnahme.
|
||||
|
||||
## Tatsächlich ausgeführt
|
||||
|
||||
- 48 gezielte Python-Tests bestanden:
|
||||
`python -m unittest test_basalt_telemetry test_dashboard_data test_speed_telemetry test_basalt test_tts_ram test_tts -q`.
|
||||
- `node --check dashboard-ui.js` und `git diff --check` bestanden.
|
||||
- Bestehende eigene Pulse-Tests: 5 Python- und 2 Node-Tests bestanden.
|
||||
- Echte Browser-DOM-Prüfung mit dem tatsächlichen Dashboard-JavaScript und
|
||||
**ausschließlich synthetischen Daten**: beide Slotkarten, Generierungs- und
|
||||
Einleserate, aktive/wartende Anfragen, Cache, MTP und Tokenzähler angezeigt.
|
||||
Bei anschließend fehlender Telemetrie verschwinden die vorherigen Messwerte;
|
||||
unbekannte Anfragen und Raten erscheinen als `–`, nicht als erfundene Nullen.
|
||||
- `check_telemetry_mock.py` zweimal erfolgreich gegen die tatsächlich installierte
|
||||
gepinnte Upstream-`Service`-/Handler-Implementierung ausgeführt: HTTP 401 ohne
|
||||
Anmeldung, bestehende Chatroute weiterhin funktionstüchtig, numerische Zähler
|
||||
nach synthetischer Mock-Antwort, keine Test-Promptinhalte/Zugangsschlüssel im
|
||||
Telemetrieergebnis. Kein reales Modell, keine GPU-Inferenz, kein Neustart.
|
||||
|
||||
Der letzte Test lief in der **aktuellen Deck-Containerumgebung**, mit deren
|
||||
verwalteter Basalt-Python-Umgebung und CPU-Mock. Der anfängliche Aufruf desselben
|
||||
venv direkt auf dem Host scheiterte wegen fehlender Python-3.12-Standardbibliothek.
|
||||
Das ist keine native Host-/Fresh-Debian-Abnahme. Testskript und Launcher lagen
|
||||
isoliert unter `state/basalt-runtime/tmp/deck-telemetry-test`; installierter
|
||||
App-Code und Upstream-Checkout blieben unverändert.
|
||||
|
||||
## Ursprünglicher Aktivierungsplan (Go inzwischen erteilt und umgesetzt)
|
||||
|
||||
Separates Go für Deck/API-Aktivierung, regulären nachgewiesenen Drain und
|
||||
Wiederladen des bestehenden Basalt-/Qwen-Profils erforderlich. Vorher normale
|
||||
Management-Anmeldung herstellen; die Browserprüfung zeigte die Zugangsseite,
|
||||
kein gespeicherter Vault-Login vorhanden. Keine Admin-Umgehung.
|
||||
|
||||
Vorgesehene kurze Abnahme, erst nach Freigabe: drei begrenzte synthetische
|
||||
parallele Anfragen für beide Slots und Warteschlange, ein Cache-Folgeaufruf,
|
||||
Abgleich von Einlesen/Generierung/MTP/Modellstartzählern und Pulse-Vertrag.
|
||||
Maximal 15 Minuten Modelltestbudget, keine Benchmarks oder Variantenmatrix.
|
||||
Bestehende Profile, GPU-Aufteilung, Stimmen und Endpunktfreigaben erhalten.
|
||||
Danach den tatsächlich produktiven Stand und offene Client-/Restore-Grenzen
|
||||
hier nachtragen. Git-Publikation ersetzt diese Aktivierungsfreigabe nicht.
|
||||
|
||||
Native Installation, gemeinsame App-/Launcher-Umstellung und Rückfall:
|
||||
[Basalt-Rezept](../../../deploy/BASALT_NATIVE.md).
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS Hermes: four synthetic telemetry checks and one short speech check."""
|
||||
import concurrent.futures,importlib.util,io,json,threading,time,urllib.request,wave
|
||||
from pathlib import Path
|
||||
s=importlib.util.spec_from_file_location('managed_transport',Path(__file__).resolve().parent.parent/'basalt-candidate-2026-11-01/paired_transport.py');assert s and s.loader
|
||||
m=importlib.util.module_from_spec(s);s.loader.exec_module(m);KEY=m.key()
|
||||
BASE='http://192.168.1.212:8120';OUT=Path('/opt/data/profiles/athena-deck/cache/scratch/telemetry-live-acceptance.json')
|
||||
START=time.monotonic();samples=[];stop=threading.Event()
|
||||
def call(path,data=None,binary=False):
|
||||
assert time.monotonic()-START<900,'Short test budget exceeded'
|
||||
req=urllib.request.Request(BASE+path,data=json.dumps(data).encode() if data is not None else None,headers={'Authorization':'Bearer '+KEY,'Content-Type':'application/json'})
|
||||
with urllib.request.urlopen(req,timeout=180 if data is not None else 10) as r:return r.read() if binary else json.load(r)
|
||||
def poll():
|
||||
while not stop.is_set():
|
||||
try:samples.append(call('/v1/telemetry/speed'))
|
||||
except Exception as e:samples.append({'error':type(e).__name__})
|
||||
stop.wait(.15)
|
||||
def chat(messages):
|
||||
out=call('/v1/chat/completions',dict(model='flash-next-basalt',messages=messages,max_tokens=128,temperature=0,chat_template_kwargs={'enable_thinking':False}))
|
||||
assert out['choices'][0]['message'].get('content')
|
||||
return {'usage':out.get('usage'),'timings':out.get('timings')}
|
||||
def main():
|
||||
worker=threading.Thread(target=poll,daemon=True);worker.start()
|
||||
base='\n'.join(f'Datenzeile {i:04d}: alpha beta gamma delta epsilon, unveraenderte Testdaten.' for i in range(600))
|
||||
first=[{'role':'user','content':base+'\nSchreibe jetzt die Zahlen von 1 bis 300, mit Komma getrennt.'}]
|
||||
second=[{'role':'user','content':base+'\nSchreibe jetzt die Zahlen von 301 bis 600, mit Komma getrennt.'}]
|
||||
third=[{'role':'user','content':'Schreibe die Zahlen von 601 bis 900, mit Komma getrennt.'}]
|
||||
try:
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as pool:
|
||||
jobs=[pool.submit(chat,msg) for msg in (first,second,third)];results=[j.result() for j in jobs]
|
||||
follow=chat(first)
|
||||
finally:stop.set();worker.join(timeout=12)
|
||||
valid=[x for x in samples if x.get('available',True) and 'error' not in x]
|
||||
checks=dict(two_slots_observed=any(x.get('active_slots')==2 for x in valid),generation_observed=any((x.get('generation_tok_s') or 0)>0 for x in valid),prefill_observed=any((x.get('prefill_tok_s') or 0)>0 for x in valid),cache_reused=(follow.get('usage',{}).get('prompt_tokens_details',{}).get('cached_tokens') or 0)>0)
|
||||
result=dict(checks=checks,requests=results,cached_followup=follow,samples=samples,seconds=time.monotonic()-START)
|
||||
OUT.write_text(json.dumps(result,indent=2));print(json.dumps({'stage':'LLM acceptance','checks':checks,'seconds':result['seconds'],'evidence':str(OUT)}),flush=True)
|
||||
assert all(checks.values()),'One or more actual LLM telemetry checks failed'
|
||||
audio=call('/v1/audio/speech',dict(model='qwen-anna-gpu-3060',input='Anna ist bereit. Die Anzeige wurde aktualisiert.',voice='default',response_format='wav'),binary=True)
|
||||
with wave.open(io.BytesIO(audio),'rb') as w:voice=dict(rate=w.getframerate(),channels=w.getnchannels(),frames=w.getnframes(),seconds=w.getnframes()/w.getframerate())
|
||||
assert voice['rate']==24000 and voice['channels']==1 and voice['frames']>0
|
||||
result.update(tts=voice,seconds=time.monotonic()-START);OUT.write_text(json.dumps(result,indent=2));assert json.loads(OUT.read_text())['tts']==voice
|
||||
print(json.dumps({'stage':'Anna API passed','voice':voice,'total_seconds':result['seconds']}),flush=True)
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,122 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: exact app overlay + drained activation using validated Profiles.save.
|
||||
Requires separate Michael Go and prior normal authenticated GUI drain.
|
||||
"""
|
||||
import argparse
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
ROOT=Path('/opt/athena-deck-dev/basalt-deck-activation')
|
||||
BASE=Path('/opt/athena-deck-dev/runtime')
|
||||
STATE=BASE/'state'
|
||||
CANON=Path('/opt/athena-deck-dev/source')
|
||||
TARGET='0c25bfe00240414397c41a980ecbe4f0'
|
||||
SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json')
|
||||
IMAGE='athena-deck-standalone:basalt-vision-9175e7a'
|
||||
|
||||
def digest(path):
|
||||
with Path(path).open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
|
||||
|
||||
def installed():return json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
|
||||
def record(**updates):
|
||||
path=ROOT/'activation.json';data=json.loads(path.read_text()) if path.exists() else {}
|
||||
data.update(updated_at=time.time(),**updates);path.write_text(json.dumps(data,indent=2));path.chmod(0o600)
|
||||
assert json.loads(path.read_text())==data
|
||||
return data
|
||||
|
||||
def prepare():
|
||||
assert not (ROOT/'activation.json').exists()
|
||||
prep=json.loads((ROOT/'preparation.json').read_text());assert prep['phase']=='prepared; original production unchanged'
|
||||
info=installed();assert info['Image']==prep['image_before']
|
||||
app=ROOT/'image/app';files=[p for p in app.rglob('*') if p.is_file()];assert files
|
||||
assert not any(p.name=='vpn.auth' or 'vpn' in p.parts for p in files)
|
||||
# Preserve the actual installed launcher's changes, not an older local snapshot.
|
||||
original=(CANON/'deploy/install.py').read_text();anchor="FILES += ['cpu_partition.py']"
|
||||
assert anchor in original
|
||||
changed=original.replace(anchor,anchor+"\nFILES += ['basalt_runtime.py','basalt_worker.py','basalt_sources.json','deploy/install_basalt.py','deploy/BASALT_NATIVE.md']",1)
|
||||
before="'--pids-limit','256' if config.get('image_runtime') else '128'"
|
||||
after="'--pids-limit',str(config.get('pids_limit',256 if config.get('image_runtime') else 128))"
|
||||
assert before in changed;changed=changed.replace(before,after,1)
|
||||
(app/'deploy').mkdir(exist_ok=True);(app/'deploy/install.py').write_text(changed)
|
||||
names=sorted(str(p.relative_to(app)) for p in app.rglob('*') if p.is_file())
|
||||
baseline={n:digest(CANON/n) if (CANON/n).is_file() else None for n in names}
|
||||
base_tag=info['Config']['Image']
|
||||
assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',base_tag],text=True).strip()==info['Image']
|
||||
(ROOT/'image/Dockerfile').write_text('FROM '+base_tag+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
(ROOT/'image/.dockerignore').write_text('*\n!Dockerfile\n!app/\n!app/**\n')
|
||||
with (ROOT/'image-build.log').open('w') as out:subprocess.run(['docker','build','--network','none','--pull=false','-t',IMAGE,ROOT/'image'],check=True,stdout=out,stderr=subprocess.STDOUT,timeout=300)
|
||||
image_id=subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',IMAGE],text=True).strip()
|
||||
probe='from basalt_runtime import BasaltRuntime;from basalt_worker import BasaltWorker;from server import Server;print("Basalt image imports passed")'
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--cap-drop','ALL','--user','65534:65534','--memory','256m','--pids-limit','128','-e','NVIDIA_VISIBLE_DEVICES=void','--entrypoint','python3',image_id,'-B','-c',probe],check=True)
|
||||
assert installed()['Image']==info['Image'] and installed()['State']['StartedAt']==info['State']['StartedAt']
|
||||
settings={n:digest(STATE/n) for n in SETTINGS}
|
||||
profile=next(p for p in json.loads((STATE/'profiles.json').read_text()) if p['id']==TARGET)
|
||||
record(phase='image prepared; normal GUI drain required',image_before=info['Config']['Image'],image_id_before=info['Image'],image=IMAGE,image_id=image_id,files=names,baseline=baseline,settings_before=settings,profile_before=profile,manifest_before=json.loads((BASE/'installation.json').read_text()),inference_performed=False)
|
||||
print(json.dumps(dict(phase='image prepared',image_id=image_id,files=len(names))),flush=True)
|
||||
|
||||
def apply():
|
||||
r=json.loads((ROOT/'activation.json').read_text());assert r['phase'] in ('image prepared; normal GUI drain required','drained; old Deck stopped')
|
||||
info=installed();assert info['Image']==r['image_id_before']
|
||||
# The operator stores this fresh read-back only after the real normal GUI stop.
|
||||
d=json.loads((ROOT/'drained.json').read_text())
|
||||
assert d['state']=='stopped'
|
||||
if r['phase']=='image prepared; normal GUI drain required':assert time.time()-d['checked_at']<60
|
||||
else:assert info['State']['Running'] is False
|
||||
assert d['active_requests']==0 and type(d['active_requests']) is int
|
||||
for field in ('active_requests','waiting_requests','tts_waiting_requests'):assert type(d['scheduler'][field]) is int and d['scheduler'][field]==0
|
||||
assert d['scheduler']['switching'] is False
|
||||
assert not (STATE/'strata-worker/worker.json').exists()
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip()
|
||||
assert all(digest(STATE/n)==v for n,v in r['settings_before'].items() if n!='endpoint.json')
|
||||
for n,value in r['baseline'].items():assert (digest(CANON/n) if (CANON/n).is_file() else None)==value
|
||||
profiles_before=json.loads((STATE/'profiles.json').read_text())
|
||||
if info['State']['Running']:subprocess.run(['docker','stop','--timeout','45','athena-deck-dev'],check=True)
|
||||
record(phase='drained; old Deck stopped')
|
||||
# Validate and save through the maintained class, not a hand-written profile JSON patch.
|
||||
code='''import json,pathlib
|
||||
from catalog import Catalog
|
||||
from profiles import Profiles
|
||||
root=pathlib.Path('/var/lib/deck');store=Profiles(root/'profiles.json',Catalog(root/'models'))
|
||||
p=next(p for p in store.rows if p['id']=='0c25bfe00240414397c41a980ecbe4f0')
|
||||
params={**p['parameters'],'chat_runtime':'basalt','context':262144,'slots':2,'gpu_devices':['GPU-8ad38c6c-5a01-9d8e-1dfa-ed662ad78fbe'],'split_mode':'none','tensor_split':[],'load_mode':'none','gpu_offload':'auto','gpu_reserve_mode':'auto','gpu_reserve_mib':{},'vision_projector':'232f7c84e9cec16e19d86171c431f07fc3e9f8a633845bf1f8f5901539903743','vision_device':'GPU-4834d9d7-5b61-3004-1fb3-4ae49d482d4b'}
|
||||
saved=store.save(dict(id=p['id'],revision=p['revision'],name='Flash Next Basalt',api_id='flash-next-basalt',kind='chat',model_id='88b40b59c99641a51bc87bdab5198c3b8db4832a0325d2fd57c79294a26a236d',parameters=params))
|
||||
assert 'flash-next-strata-iq3-dual' in saved['api_aliases']
|
||||
actual=next(p for p in json.loads((root/'profiles.json').read_text()) if p['id']==saved['id']);assert actual==saved
|
||||
endpoint=json.loads((root/'endpoint.json').read_text());assert saved['id'] in endpoint['enabled_profiles'];endpoint['autostart']=True
|
||||
(root/'endpoint.json').write_text(json.dumps(endpoint))
|
||||
print(json.dumps({'profile':saved['name'],'api_id':saved['api_id'],'legacy_alias_kept':True,'slots':saved['parameters']['slots'],'context':saved['parameters']['context']}))
|
||||
'''
|
||||
mounts=[];manifest=r['manifest_before']
|
||||
for value in [manifest.get('strata_storage'),*manifest.get('strata_storage_mounts',[]),*manifest.get('external_model_roots',[])]:
|
||||
if not value:continue
|
||||
path=Path(value);assert path.is_absolute() and path.is_dir() and not {'vpn','vpn.auth','OpenVPN-KIT','GluetunVPN'} & set(path.parts)
|
||||
mounts+=['--mount','type=bind,src='+str(path)+',dst='+str(path)+',readonly']
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--cap-drop','ALL','--user','65534:65534','-e','NVIDIA_VISIBLE_DEVICES=void','--mount','type=bind,src='+str(STATE)+',dst=/var/lib/deck',*mounts,'--entrypoint','python3',r['image_id'],'-B','-c',code],check=True)
|
||||
# No other profile or audio policy is rewritten.
|
||||
now=json.loads((STATE/'profiles.json').read_text())
|
||||
assert [p for p in now if p['id']!=TARGET]==[p for p in profiles_before if p['id']!=TARGET]
|
||||
p=next(p for p in now if p['id']==TARGET);assert p['name']=='Flash Next Basalt' and p['parameters']['context']==262144
|
||||
for n in ('audio-policy.json','cpu-partition.json','reasoning-budget.json'):assert digest(STATE/n)==r['settings_before'][n]
|
||||
for n in r['files']:
|
||||
target=CANON/n;target.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(ROOT/'image/app'/n,target)
|
||||
spec=importlib.util.spec_from_file_location('deck_install',CANON/'deploy/install.py');assert spec is not None and spec.loader is not None
|
||||
installer=importlib.util.module_from_spec(spec);spec.loader.exec_module(installer)
|
||||
config=dict(r['manifest_before'],image=r['image'],previous_image=r['image_before'],pids_limit=2048)
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
installer.launch(config);installer.ready(config);installer.write_manifest(BASE,config)
|
||||
live=installed();assert live['Image']==r['image_id']
|
||||
record(phase='activated; short text/vision acceptance required',profile_after=p,pids_limit=2048,manifest_image=live['Image'])
|
||||
print(json.dumps(dict(activated=True,profile=p['name'],api_id=p['api_id'],legacy_alias='flash-next-strata-iq3-dual',slots=2,context_per_slot=262144)),flush=True)
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser();parser.add_argument('operation',choices=('prepare','apply'));parser.add_argument('--go',action='store_true');args=parser.parse_args()
|
||||
if not args.go:parser.error('Current Michael activation Go required')
|
||||
prepare() if args.operation=='prepare' else apply()
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host only: exact telemetry overlay, regular GUI drain, no profile edits."""
|
||||
import argparse,hashlib,importlib.util,json,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
ROOT=Path('/opt/athena-deck-dev/dashboard-telemetry-activation')
|
||||
BASE=Path('/opt/athena-deck-dev/runtime');STATE=BASE/'state';SOURCE=Path('/opt/athena-deck-dev/source')
|
||||
IMAGE='athena-deck-standalone:basalt-telemetry'
|
||||
FILES=('basalt_worker.py','basalt_serve.py','basalt_telemetry.py','dashboard_data.py','dashboard-ui.js','deploy/install.py')
|
||||
SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json')
|
||||
def info():return json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() if p.is_file() else None
|
||||
def save(data):
|
||||
p=ROOT/'activation.json';p.write_text(json.dumps(data,indent=2));p.chmod(0o600);assert json.loads(p.read_text())==data
|
||||
return data
|
||||
def installer():
|
||||
s=importlib.util.spec_from_file_location('deck_install',SOURCE/'deploy/install.py');assert s and s.loader
|
||||
m=importlib.util.module_from_spec(s);s.loader.exec_module(m);return m
|
||||
def healthy():
|
||||
end=time.monotonic()+90
|
||||
while info()['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()<end:time.sleep(1)
|
||||
assert info()['State']['Health']['Status']=='healthy'
|
||||
def prepare():
|
||||
assert not (ROOT/'activation.json').exists(),'Preparation already exists; inspect rather than overwrite'
|
||||
d=info();tag=d['Config']['Image'];assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',tag],text=True).strip()==d['Image']
|
||||
app=ROOT/'image/app';(app/'deploy').mkdir(parents=True,exist_ok=True)
|
||||
original=(SOURCE/'deploy/install.py').read_text();anchor="FILES += ['cpu_partition.py']";assert anchor in original
|
||||
(app/'deploy/install.py').write_text(original.replace(anchor,anchor+"\nFILES += ['basalt_serve.py','basalt_telemetry.py']",1))
|
||||
before={n:sha(SOURCE/n) for n in FILES};after={n:sha(app/n) for n in FILES};assert all(after.values())
|
||||
for n in FILES:
|
||||
(app/n).chmod(0o644)
|
||||
if before[n] is not None:
|
||||
p=ROOT/'before'/n;p.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(SOURCE/n,p)
|
||||
(ROOT/'image/Dockerfile').write_text('FROM '+tag+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
(ROOT/'image/.dockerignore').write_text('*\n!Dockerfile\n!app/\n!app/**\n')
|
||||
with (ROOT/'image-build.log').open('w') as out:subprocess.run(['docker','build','--network','none','--pull=false','-t',IMAGE,ROOT/'image'],stdout=out,stderr=subprocess.STDOUT,check=True,timeout=180)
|
||||
probe="""from pathlib import Path
|
||||
import tempfile
|
||||
from server import Server
|
||||
from basalt_telemetry import Counters
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
s=Server(0,state_dir=Path(tmp));s.endpoint.close();s.video.close();s.dashboard.close();s.server_close()
|
||||
print('Full isolated Server constructor passed; no production state or models')
|
||||
"""
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(STATE/'basalt-runtime/tmp')+',dst=/test-tmp','--entrypoint','python3',IMAGE,'-B','-c',probe],check=True,timeout=45)
|
||||
assert info()['State']['StartedAt']==d['State']['StartedAt']
|
||||
save(dict(phase='prepared',image_before=tag,image_id_before=d['Image'],started_before=d['State']['StartedAt'],source_before=before,source_after=after,config=json.loads((BASE/'installation.json').read_text()),settings={n:(STATE/n).read_text() for n in SETTINGS},prepared_at=time.time()))
|
||||
print('Image and full constructor verified; production unchanged')
|
||||
def apply():
|
||||
a=json.loads((ROOT/'activation.json').read_text());assert a['phase']=='prepared'
|
||||
d=json.loads((ROOT/'drained.json').read_text());assert time.time()-d['checked_at']<60 and d['state']=='stopped'
|
||||
assert type(d['active_requests']) is int and d['active_requests']==0
|
||||
assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests')) and d['scheduler']['switching'] is False
|
||||
assert info()['Image']==a['image_id_before'] and all(sha(SOURCE/n)==a['source_before'][n] for n in FILES)
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS if n!='endpoint.json')
|
||||
subprocess.run(['docker','stop','--timeout','45','athena-deck-dev'],check=True)
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip(),'Unexpected GPU work; no process will be killed'
|
||||
try:
|
||||
for n in FILES:shutil.copy2(ROOT/'image/app'/n,SOURCE/n)
|
||||
(STATE/'endpoint.json').write_text(a['settings']['endpoint.json'])
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
c=dict(a['config'],image=IMAGE,previous_image=a['image_before']);i=installer();i.launch(c);i.ready(c);healthy();i.write_manifest(BASE,c)
|
||||
assert all(sha(SOURCE/n)==a['source_after'][n] for n in FILES) and all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS)
|
||||
save(dict(a,phase='activated; live acceptance pending',activated_at=time.time()));print('Activated and healthy; profiles and all protected settings unchanged')
|
||||
except Exception:
|
||||
save(dict(a,phase='activation failed; inspect before rollback'));raise
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('operation',choices=('prepare','apply'));p.add_argument('--go',action='store_true');a=p.parse_args();assert a.go,'Explicit Michael Go required'
|
||||
prepare() if a.operation=='prepare' else apply()
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
"""CPU-only upstream mock; run in the worker's actual Python environment."""
|
||||
import argparse,json,os,signal,socket,subprocess,time,urllib.request,urllib.error
|
||||
from pathlib import Path
|
||||
p=argparse.ArgumentParser();p.add_argument('--python',required=True);p.add_argument('--source',required=True);p.add_argument('--launcher',required=True);a=p.parse_args()
|
||||
with socket.socket() as s:s.bind(('127.0.0.1',0));port=s.getsockname()[1]
|
||||
base='http://127.0.0.1:'+str(port);key='synthetic-telemetry-test-key'
|
||||
log=Path(a.launcher).parent/'mock-check.log'
|
||||
def request(path,data=None,auth=True):
|
||||
h={'Content-Type':'application/json'}
|
||||
if auth:h['Authorization']='Bearer '+key
|
||||
req=urllib.request.Request(base+path,data=json.dumps(data).encode() if data is not None else None,headers=h)
|
||||
with urllib.request.urlopen(req,timeout=5) as r:return json.load(r)
|
||||
with log.open('w') as out:
|
||||
process=subprocess.Popen([a.python,a.launcher,'--deck-source',a.source,'--mock-engine','--host','127.0.0.1','--port',str(port),'--api-key',key],stdout=out,stderr=subprocess.STDOUT,env=dict(os.environ,CUDA_VISIBLE_DEVICES='',NVIDIA_VISIBLE_DEVICES='void',PYTHONUNBUFFERED='1'),start_new_session=True)
|
||||
try:
|
||||
deadline=time.monotonic()+25
|
||||
while True:
|
||||
try:before=request('/telemetry');break
|
||||
except (OSError,ValueError):
|
||||
if process.poll() is not None or time.monotonic()>deadline:raise RuntimeError('Upstream mock did not start; inspect own mock-check.log') from None
|
||||
time.sleep(.1)
|
||||
assert before['schema_version']==1 and before['backend']=='basalt' and before['available']
|
||||
try:request('/telemetry',auth=False);raise AssertionError('Missing auth accepted')
|
||||
except urllib.error.HTTPError as e:assert e.code==401
|
||||
model=request('/v1/models')['data'][0]['id']
|
||||
response=request('/v1/chat/completions',dict(model=model,messages=[dict(role='user',content='SYNTHETIC_PRIVATE_MARKER')],max_tokens=16,stream=False))
|
||||
after=request('/telemetry');assert after['metrics']['requests_completed_total']==1
|
||||
assert after['metrics']['tokens_predicted_total']>0
|
||||
text=json.dumps(after);assert 'SYNTHETIC_PRIVATE_MARKER' not in text and key not in text and 'requests' not in after and 'history' not in after
|
||||
print(json.dumps(dict(real_upstream_mock=True,auth_401=True,existing_chat_route=True,numeric_counters=True,content_free=True,slots=len(after['slots']))),flush=True)
|
||||
finally:
|
||||
if process.poll() is None:
|
||||
os.killpg(process.pid,signal.SIGTERM)
|
||||
try:process.wait(timeout=5)
|
||||
except subprocess.TimeoutExpired:os.killpg(process.pid,signal.SIGKILL);process.wait()
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: correct owned overlay directory modes, constructor-test, finish activation."""
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import time
|
||||
ROOT=Path('/opt/athena-deck-dev/basalt-deck-activation')
|
||||
BASE=Path('/opt/athena-deck-dev/runtime')
|
||||
CANON=Path('/opt/athena-deck-dev/source')
|
||||
r=json.loads((ROOT/'activation.json').read_text())
|
||||
d=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
assert d['Image']==r['image_id'] and (d['State']['Health']['Status']=='unhealthy' or not d['State']['Running'])
|
||||
subprocess.run(['docker','stop','--timeout','10','athena-deck-dev'],check=True)
|
||||
assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',r['image_before']],text=True).strip()==r['image_id_before']
|
||||
(ROOT/'image/Dockerfile').write_text('FROM '+r['image_before']+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
with (ROOT/'image-repair.log').open('w') as out:subprocess.run(['docker','build','--network','none','--pull=false','-t',r['image'],ROOT/'image'],stdout=out,stderr=subprocess.STDOUT,check=True,timeout=180)
|
||||
image_id=subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',r['image']],text=True).strip()
|
||||
probe='''from pathlib import Path
|
||||
import tempfile
|
||||
from server import Server
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
s=Server(0,state_dir=Path(tmp))
|
||||
s.endpoint.close();s.video.close();s.dashboard.close();s.server_close()
|
||||
print('Full isolated Server constructor passed; no model or production state')
|
||||
'''
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(BASE/'state/basalt-runtime/tmp')+',dst=/test-tmp','--entrypoint','python3',image_id,'-B','-c',probe],check=True,timeout=45)
|
||||
spec=importlib.util.spec_from_file_location('deck_install',CANON/'deploy/install.py');assert spec and spec.loader
|
||||
installer=importlib.util.module_from_spec(spec);spec.loader.exec_module(installer)
|
||||
config=dict(r['manifest_before'],image=r['image'],previous_image=r['image_before'],pids_limit=2048)
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
installer.launch(config);installer.ready(config);installer.write_manifest(BASE,config)
|
||||
a=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0];assert a['Image']==image_id and a['State']['Running']
|
||||
p=next(p for p in json.loads((BASE/'state/profiles.json').read_text()) if p['id']=='0c25bfe00240414397c41a980ecbe4f0')
|
||||
r.update(phase='activated; short text/vision acceptance required',image_id=image_id,profile_after=p,pids_limit=2048,updated_at=time.time(),directory_modes_corrected=True,full_constructor_verified=True)
|
||||
p=ROOT/'activation.json';p.write_text(json.dumps(r,indent=2));assert json.loads(p.read_text())==r
|
||||
print(json.dumps(dict(activated=True,image_id=image_id,profile='Flash Next Basalt',slots=2,context_per_slot=262144)))
|
||||
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host only: owned runtime adoption + GPU-less SM86/120 vision build.
|
||||
No service/model stop, no production source replacement, no inference.
|
||||
"""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
BASE=Path('/opt/athena-deck-dev/runtime')
|
||||
STATE=BASE/'state'
|
||||
CAND=Path('/opt/athena-deck-dev/basalt-candidate-9175e7a3211b')
|
||||
ROOT=Path('/opt/athena-deck-dev/basalt-deck-activation')
|
||||
DEST=STATE/'basalt-runtime'
|
||||
VIEW=Path('/var/lib/deck/basalt-runtime')
|
||||
BLOCK={'vpn','vpn.auth','OpenVPN-KIT','GluetunVPN'}
|
||||
|
||||
def digest(path):
|
||||
with Path(path).open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
|
||||
|
||||
def ignored(directory,names):return [n for n in names if n in BLOCK or n in ('__pycache__','.pytest_cache')]
|
||||
|
||||
def chown_tree(root):
|
||||
for directory,dirs,files in os.walk(root,followlinks=False):
|
||||
dirs[:]=[n for n in dirs if n not in BLOCK]
|
||||
os.chown(directory,65534,65534)
|
||||
for name in files:
|
||||
if name not in BLOCK:os.chown(Path(directory)/name,65534,65534,follow_symlinks=False)
|
||||
|
||||
def save(phase,**values):
|
||||
path=ROOT/'preparation.json';data=json.loads(path.read_text()) if path.exists() else {}
|
||||
data.update(phase=phase,updated_at=time.time(),**values);path.write_text(json.dumps(data,indent=2));print(json.dumps(dict(phase=phase,**values)),flush=True)
|
||||
|
||||
def main():
|
||||
recipe=json.loads((ROOT/'basalt_sources.json').read_text());pin=recipe['model']
|
||||
assert not DEST.exists(),'Existing managed runtime: inspect instead of repeating'
|
||||
assert shutil.disk_usage(STATE).free>15*1024**3
|
||||
git=['git','-c','safe.directory='+str(CAND/'source'),'-C',str(CAND/'source')]
|
||||
assert subprocess.check_output(git+['rev-parse','HEAD'],text=True).strip()==recipe['code']
|
||||
assert not subprocess.check_output(git+['status','--porcelain','--untracked-files=no'],text=True).strip()
|
||||
info=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
save('copy managed public runtime; original worker stays loaded',image_before=info['Image'],started_before=info['State']['StartedAt'])
|
||||
shutil.copytree(CAND/'source',DEST/'source',symlinks=True,ignore=ignored)
|
||||
shutil.copytree(CAND/'venv',DEST/'venv',symlinks=True,ignore=ignored)
|
||||
shutil.copytree(STATE/'strata-runtime/cuda',DEST/'cuda',symlinks=True,ignore=ignored)
|
||||
# Relocate text launchers only. No candidate file is changed.
|
||||
for p in (DEST/'venv/bin').iterdir():
|
||||
if p.name in BLOCK or p.is_symlink() or not p.is_file():continue
|
||||
with p.open('rb') as f:first=f.read(2)
|
||||
if first==b'#!':
|
||||
data=p.read_bytes().replace(str(CAND/'venv').encode(),str(VIEW/'venv').encode());p.write_bytes(data)
|
||||
for name in ('tmp','home','cache'):(DEST/name).mkdir(exist_ok=True)
|
||||
chown_tree(DEST)
|
||||
source=CAND/'models'/pin['file'];ident=hashlib.sha256((pin['repo']+pin['revision']+pin['file']).encode()).hexdigest();target=STATE/'models'/ident
|
||||
assert source.stat().st_size==pin['size'] and source.stat().st_uid==65534
|
||||
assert source.stat().st_dev==(STATE/'models').stat().st_dev,'No cross-filesystem copy or silent slower-disk adoption'
|
||||
save('verify existing whole model pack; no download or duplicate',model_id=ident)
|
||||
assert digest(source)==pin['sha256']
|
||||
target.mkdir(mode=0o700);os.chown(target,65534,65534);os.link(source,target/'model.basalt')
|
||||
entry=dict(pin,kind='chat',downloaded_at=time.time(),state='downloaded',runtime_ready=False,upstream_hash_verified=True,runtime_metadata={})
|
||||
path=target/'entry.json';path.write_text(json.dumps(entry));os.chown(path,65534,65534)
|
||||
assert (target/'model.basalt').stat().st_ino==source.stat().st_ino
|
||||
save('compile independent SM86/120 vision sidecar; no GPU attached',model_id=ident)
|
||||
v=str(VIEW);cmake=v+'/venv/bin/cmake';nvcc=v+'/cuda/bin/nvcc';ninja=v+'/venv/bin/ninja'
|
||||
configure=[cmake,'-S',v+'/source/tools/vision','-B',v+'/build-vision','-G','Ninja','-DCMAKE_BUILD_TYPE=Release','-DBUILD_TESTING=OFF','-DCMAKE_CUDA_ARCHITECTURES=86;120','-DCMAKE_CUDA_COMPILER='+nvcc,'-DCUDAToolkit_ROOT='+v+'/cuda','-DCMAKE_MAKE_PROGRAM='+ninja]
|
||||
build=[cmake,'--build',v+'/build-vision','--target','basalt-vision','--parallel','1']
|
||||
import shlex
|
||||
script='set -e; '+shlex.join(configure)+'; '+shlex.join(build)+'; '+shlex.join([v+'/venv/bin/python','-m','pip','check'])+'; '+shlex.join([v+'/venv/bin/python','-m','serve.server','--help'])
|
||||
command=['docker','run','--rm','--name','athena-basalt-vision-build','--network','none','--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true','--user','65534:65534','--cpus','1','--cpu-shares','2','--memory','3g','--memory-swap','3g','--pids-limit','256','-e','NVIDIA_VISIBLE_DEVICES=void','-e','CUDA_VISIBLE_DEVICES=','-e','HOME='+v+'/home','-e','TMPDIR='+v+'/tmp','-e','LD_LIBRARY_PATH='+v+'/cuda/lib64:'+v+'/cuda/lib','--mount','type=bind,src='+str(DEST)+',dst='+v,'--mount','type=bind,src='+str(DEST/'tmp')+',dst=/tmp','--workdir',v+'/source','--entrypoint','nice',info['Image'],'-n','19','sh','-c',script]
|
||||
with (ROOT/'vision-build.log').open('w') as out:subprocess.run(command,stdout=out,stderr=subprocess.STDOUT,check=True,timeout=1200)
|
||||
cache=(DEST/'build-vision/CMakeCache.txt').read_text();assert 'CMAKE_CUDA_ARCHITECTURES:UNINITIALIZED=86;120' in cache
|
||||
assert (DEST/'source/bin/basalt-vision').is_file()
|
||||
marker=dict(commit=recipe['code'],version=recipe['version'],cuda='13.0',architectures=[120],vision_architectures=[86,120],origin='verified-candidate-adoption-plus-separate-vision-build',python='3.12.3',binary_sha256=digest(DEST/'source/bin/basalt'),vision_sha256=digest(DEST/'source/bin/basalt-vision'),inference_performed=False)
|
||||
path=DEST/'ready.json';path.write_text(json.dumps(marker,indent=2));os.chown(path,65534,65534)
|
||||
after=json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
assert after['Image']==info['Image'] and after['State']['StartedAt']==info['State']['StartedAt']
|
||||
save('prepared; original production unchanged',model_id=ident,vision_architectures=[86,120],managed_runtime=str(DEST),whole_model_sha256_verified=True,shared_inode=True)
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser();parser.add_argument('--go',action='store_true');args=parser.parse_args()
|
||||
if not args.go:parser.error('Current Michael activation Go required')
|
||||
main()
|
||||
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS/Hermes Python: four bounded synthetic acceptance requests, own managed key."""
|
||||
import concurrent.futures
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
import zlib
|
||||
import base64
|
||||
|
||||
ROOT=Path(__file__).resolve().parent
|
||||
spec=importlib.util.spec_from_file_location('athena_profile_transport',ROOT.parent/'basalt-candidate-2026-11-01/paired_transport.py');assert spec and spec.loader
|
||||
transport=importlib.util.module_from_spec(spec);spec.loader.exec_module(transport)
|
||||
KEY=transport.key()
|
||||
BASE='http://192.168.1.212:8120'
|
||||
MODEL='flash-next-basalt'
|
||||
START=time.monotonic()
|
||||
|
||||
def get(path):
|
||||
req=urllib.request.Request(BASE+path,headers={'Authorization':'Bearer '+KEY})
|
||||
with urllib.request.urlopen(req,timeout=15) as r:return json.load(r)
|
||||
|
||||
def chat(messages,tokens=40,model=MODEL):
|
||||
assert time.monotonic()-START<600,'Short acceptance budget exhausted'
|
||||
body=dict(model=model,messages=messages,max_tokens=tokens,temperature=0,chat_template_kwargs={'enable_thinking':False})
|
||||
req=urllib.request.Request(BASE+'/v1/chat/completions',data=json.dumps(body).encode(),headers={'Authorization':'Bearer '+KEY,'Content-Type':'application/json'})
|
||||
t=time.monotonic()
|
||||
try:
|
||||
with urllib.request.urlopen(req,timeout=240) as r:out=json.load(r)
|
||||
except urllib.error.HTTPError as exc:
|
||||
data=exc.read(8192).decode();raise RuntimeError('HTTP '+str(exc.code)+': '+data) from None
|
||||
text=out['choices'][0]['message'].get('content') or ''
|
||||
return dict(content=text,seconds=round(time.monotonic()-t,3),usage=out.get('usage'),timings=out.get('timings'))
|
||||
|
||||
def main():
|
||||
models=get('/v1/models')['data'];row=next(m for m in models if m['id']==MODEL)
|
||||
assert row['name']=='Flash Next Basalt' and row['parallel_slots']==2 and row['context_window']==262144 and row['context_scope']=='per_slot',row
|
||||
print(json.dumps(dict(stage='advertised',profile=row['name'],api_id=row['id'],slots=row['parallel_slots'],context_per_slot=row['context_window'])),flush=True)
|
||||
warm=chat([dict(role='user',content='Antworte nur mit dem Wort BEREIT.')]);assert 'BEREIT' in warm['content'].upper(),warm
|
||||
print(json.dumps(dict(stage='model loaded and text passed',seconds=warm['seconds'],content=warm['content'])),flush=True)
|
||||
props=get('/props?model='+MODEL)
|
||||
assert props['total_slots']==2 and props['default_generation_settings']['n_ctx']==262144 and props['modalities']['vision'] is True,props
|
||||
def one(marker):
|
||||
result=chat([dict(role='user',content='Schreibe ausschließlich diese Kennung: '+marker)])
|
||||
assert marker in result['content'],result
|
||||
return result
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:pair=list(pool.map(one,('BASALT_LINKS_7421','BASALT_RECHTS_8293')))
|
||||
print(json.dumps(dict(stage='parallel pair passed',answers=[r['content'] for r in pair])),flush=True)
|
||||
def chunk(name,payload):return struct.pack('>I',len(payload))+name+payload+struct.pack('>I',zlib.crc32(name+payload)&0xffffffff)
|
||||
size=128;raw=(b'\0'+bytes((255,0,0))*size)*size
|
||||
image=b'\x89PNG\r\n\x1a\n'+chunk(b'IHDR',struct.pack('>IIBBBBB',size,size,8,2,0,0,0))+chunk(b'IDAT',zlib.compress(raw))+chunk(b'IEND',b'')
|
||||
uri='data:image/png;base64,'+base64.b64encode(image).decode()
|
||||
vision=chat([dict(role='user',content=[dict(type='text',text='Welche Farbe hat dieses Bild? Antworte auf Deutsch mit genau einem Farbwort.'),dict(type='image_url',image_url={'url':uri})])],24)
|
||||
assert 'rot' in vision['content'].lower(),vision
|
||||
print(json.dumps(dict(stage='vision passed',answer=vision['content'],seconds=vision['seconds'])),flush=True)
|
||||
legacy=get('/props?model=flash-next-strata-iq3-dual');assert legacy['total_slots']==2 and legacy['modalities']['vision'] is True
|
||||
result=dict(profile='Flash Next Basalt',api_id=MODEL,legacy_alias='flash-next-strata-iq3-dual',slots=2,context_per_slot=262144,vision=True,warm=warm,parallel=pair,vision_result=vision,elapsed_seconds=round(time.monotonic()-START,3),scope='Four short synthetic requests, not a benchmark or full-context fill')
|
||||
out=Path('/opt/data/profiles/athena-deck/cache/scratch/basalt-live-acceptance.json');out.write_text(json.dumps(result,indent=2));print('Acceptance evidence: '+str(out),flush=True)
|
||||
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,68 @@
|
||||
# Git publication: Basalt, GPU speech and shared Qwen owner
|
||||
|
||||
## Scope
|
||||
|
||||
Michael requested publication of the accumulated Athena Deck working tree on
|
||||
3 November 2026. The reviewed starting set contains 40 modified tracked files
|
||||
and 131 new files. Publish the coupled integration together: the server,
|
||||
profile/backup schemas and scheduler changes depend on the new runtime and
|
||||
speech modules. This record is additional to that starting set.
|
||||
|
||||
The change set includes:
|
||||
|
||||
- Pinned Basalt runtime/model recipe, native build instructions, optional
|
||||
separate vision worker, profile selection and backup/restore integration.
|
||||
- Numeric, content-free Basalt dashboard/Pulse telemetry, slots and counters.
|
||||
- Explicit Qwen-ASR GPU selection and scheduler admission, with the corrected
|
||||
model-vocabulary prefix; existing CPU behavior remains available.
|
||||
- Anna preset binding to the existing private reference and shared Qwen
|
||||
TTS/atelier ownership, queue admission, cancellation and residency handling.
|
||||
- Strata 0.2.9 recipe, controlled historical candidate/comparison evidence,
|
||||
activation/restoration procedures, regression tests and current-system docs.
|
||||
|
||||
Historical maintenance clients are execution-environment-specific. Their
|
||||
presence in Git is not permission to rerun a historical activation, model
|
||||
comparison, unloading operation or restoration. They retain their original
|
||||
explicit-Go and bounded-maintenance-window requirements.
|
||||
|
||||
## Publication checks actually performed
|
||||
|
||||
- Fetched `origin/main` before review; initial local and remote-tracking heads
|
||||
agree at `4e404d0`.
|
||||
- Full local synthetic suite: **784 tests passed**, 108.958 seconds, using the
|
||||
existing own `$TMPDIR/shared-qwen-tests/bin/python` environment. No production
|
||||
model inference or live management write was performed for publication.
|
||||
- Python AST parsing: **94** changed/new Python files passed.
|
||||
- JSON parsing: **44** changed/new JSON files passed.
|
||||
- `node --check`: all **8** changed JavaScript files passed.
|
||||
- `git diff --check` passed before documentation changes; repeat against the
|
||||
final staged set before committing.
|
||||
- Examined all 171 starting paths for private-key blocks, common provider keys,
|
||||
literal credentials and bearer/CLI secrets. Additional JSON credential-field
|
||||
and CLI-argument traversal covered 38,494 nodes. The only textual credential
|
||||
hits are the explicit `synthetic-service-secret` fixture; the JSON `token`
|
||||
field is a GPU device UUID. No detected live access credential is published.
|
||||
- Only ordinary UTF-8 source, recipes, documentation and historical test
|
||||
evidence occur in the starting set. No model weights, voice references,
|
||||
runtime environments or private state archives are included. Candidate
|
||||
full-context inputs are generated synthetic archives, not production chats.
|
||||
- No forbidden VPN file, configuration or VPN container was accessed. The
|
||||
inspection uses the explicit Git status paths, not a host-wide inventory.
|
||||
|
||||
The detailed publication inventory, source hashes and current test log remain
|
||||
in the specialist's own workspace report directory, outside the repository.
|
||||
No secret-bearing operator backup was created.
|
||||
|
||||
## Unchanged limitations
|
||||
|
||||
Publication is not deployment and supplies no new activation permission.
|
||||
Existing live-activation claims belong to their individual maintenance records;
|
||||
this publication reruns only local synthetic regressions and syntax checks.
|
||||
|
||||
See [the shared Qwen record](shared-qwen/README.md) for the still-pending real
|
||||
Anna → atelier → Anna GPU acceptance, and
|
||||
[the Basalt native recipe](../../deploy/BASALT_NATIVE.md) for installation and
|
||||
restore requirements. Fresh-Debian native end-to-end installation and complete
|
||||
encrypted fresh-host restore remain unverified. The 3060-only coexistence
|
||||
investigation and the requested Hermes vision-tool rollout are separate tasks;
|
||||
this commit does not claim they have been completed.
|
||||
@@ -0,0 +1,49 @@
|
||||
# TTS-Korrektur und aktuelle Endpunktabnahme
|
||||
|
||||
## Tatsächlich produktiv geprüft
|
||||
|
||||
- Vorhandene Qwen3-TTS-12Hz-1.7B-Base-Gewichte und faster-qwen3-tts 0.3.0
|
||||
weiterverwendet, private Anna-Referenz lokal eingebunden; kein neuer Dienst.
|
||||
- Profil `Qwen 1.7B Anna GPU 3060`, API-ID `qwen-anna-gpu-3060`,
|
||||
Profil-ID `5b67537ab825493786861b278ae26cbe`, `tts_voice=Anna`, `speed=1`.
|
||||
- Nach Michaels Endpunktauftrag ausschließlich dieses TTS-Profil freigegeben;
|
||||
Kikiri Anna CPU deaktiviert, nicht gelöscht. CPU-Qwen-Profile erhalten.
|
||||
- RAM-Korrektur nach neuem ausdrücklichem Go und normalem GUI-Drain aktiviert.
|
||||
Der anfängliche Health-Check wartete fälschlich nicht auf Dockers `starting`;
|
||||
danach tatsächliches `healthy`, App-/Quellhash und unveränderte gespeicherte
|
||||
Profile sowie Endpoint-, Audio-, CPU- und Reasoning-Einstellungen bestätigt.
|
||||
- Laufendes Image: `athena-deck-standalone:qwen-tts-ram-fix`.
|
||||
|
||||
## RAM-Zulassung
|
||||
|
||||
45 gezielte Tests bestanden, darunter zuvor rote Tests für residenten Betrieb,
|
||||
Kaltstart, Vorladen, zu wenig RAM, Reservierungsfreigabe und fehlende Gewichte.
|
||||
Kaltstartbedarf: Dateigröße plus 1 GiB Policy-Reserve, hier 4,592 GiB.
|
||||
Residenter Betrieb: 0,5 GiB Policy-Reserve. Keine Hersteller- oder vermessenen
|
||||
RSS-Mindestwerte. VRAM-/Scheduler-Schutz unverändert.
|
||||
|
||||
**Echte geschützte `/v1/audio/speech`-Aufrufe, nicht nur direkter Worker:**
|
||||
|
||||
| Modellname im Request | Ergebnis | Audiodauer | HTTP-Gesamtzeit |
|
||||
|---|---|---:|---:|
|
||||
| `qwen-anna-gpu-3060`, `voice=default` | HTTP 200, 24-kHz-Mono-WAV | 3,84 s | 14,65 s |
|
||||
| `tts`, Stimme aus Profil | HTTP 200, 24-kHz-Mono-WAV | 4,72 s | 3,63 s |
|
||||
|
||||
Diese zwei Aufrufe sind eine Funktionsabnahme, kein neuer Geschwindigkeits-
|
||||
benchmark. Separater Warm-Streaming-Test: [REALTIME_RESULTS.md](REALTIME_RESULTS.md).
|
||||
Basalt anschließend geladen und mit kurzer BEREIT-Probe bestätigt. Beobachtet:
|
||||
Basalt-Vision auf 3060, TTS-Python auf 3060 (4596 MiB), Basalt auf 5080.
|
||||
|
||||
## Aufräumen
|
||||
|
||||
Die fünf ausschließlich für den verworfenen Q8-GPU-Umbau angelegten lokalen
|
||||
Code-/Lock-Dateien entfernt. Die zusätzliche, unbenutzte CUDA-Umgebung unter
|
||||
`qwen-native-runtime/gpu` samt eigener Installerkopie entfernt. Vorhandene
|
||||
CPU-Laufzeit-ID `47e0dc1973604351872f74263f7e191e` unverändert geprüft.
|
||||
Keine fremden Git-Änderungen, Modelle oder privaten Stimmen gelöscht.
|
||||
|
||||
## Noch nicht abgeschlossen
|
||||
|
||||
Das anschließend beauftragte Dashboard-/Athena-Pulse-Telemetrieupdate ist eine
|
||||
separate Entwicklung. Native vollständige Fresh-Host-/Restore-Abnahme und
|
||||
Mac-Client-Endabnahme sind durch diese TTS-API-Prüfung nicht erbracht.
|
||||
@@ -0,0 +1,33 @@
|
||||
# Kurzer Echtzeittest · Qwen 1.7B / eigene Anna / RTX 3060
|
||||
|
||||
Zwei aufeinanderfolgende synthetische Streaming-Durchläufe mit demselben bereits
|
||||
residenten Worker der produktiv vorhandenen faster-qwen3-tts-0.3.0-Laufzeit.
|
||||
Keine Installation, kein Neustart, keine Änderung der Standardstimme oder
|
||||
Endpunktfreigabe. Basalt auf 5080 und sein Vision-Sidecar auf 3060 blieben geladen.
|
||||
|
||||
| Lauf | Audio | Erzeugung | Erster PCM-Block | Echtzeitfaktor Audio/Erzeugung |
|
||||
|---|---:|---:|---:|---:|
|
||||
| 1 | 10,16 s | 6,18 s | 0,283 s | 1,65× |
|
||||
| 2 | 13,52 s | 7,42 s | 0,223 s | 1,82× |
|
||||
|
||||
Zusammen 23,68 s Audio in 13,593728 s Erzeugungszeit: 1,74198× Echtzeit,
|
||||
RTF 0,57406. Beide warmen Läufe schneller als Echtzeit.
|
||||
Das separate anfängliche Laden dauerte 19,35712 s und ist nicht in diesen
|
||||
warmen Zahlen enthalten. Der Kaltstart ist somit nicht sofort sprechbereit.
|
||||
|
||||
Die Messung beobachtet den existierenden Worker direkt und die atomar
|
||||
veröffentlichten PCM-Dateien mit 10-ms-Polling. Sie misst keine HTTP-/Netzwerk-
|
||||
oder Playerlatenz und ist kein Langzeit-, Parallelitäts- oder Qualitätsbenchmark.
|
||||
Harness: `realtime.py`, Ausführung in Deck mit Python 3.12; Modellprozess nutzt
|
||||
unverändert die vorhandene GPU-Python-Umgebung. Kein neuer Dienst.
|
||||
|
||||
Private Rohdaten auf Athena:
|
||||
`/opt/athena-deck-dev/runtime/state/tts-tests/anna-gpu-realtime.json`.
|
||||
Job-IDs: `791a6207ef4a45f88b5bb5f8a13d2075`,
|
||||
`8cd0bdffed0a42228c7a464a2b2e9cf9`.
|
||||
Keine Audio-/Referenzdaten in Git.
|
||||
|
||||
Nach dem Test: ausschließlich Basalt-Vision auf 3060 (1702 MiB) und Basalt auf
|
||||
5080 (15264 MiB) beobachtet; der eigene Testworker beendet.
|
||||
Endpoint-, Audio-Policy-, CPU-Partition- und Reasoning-Einstellungen stimmen
|
||||
bytegenau mit dem gesicherten Stand vor der Anna-Aktivierung überein.
|
||||
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena-host scoped image overlay; explicit Go and regular fresh GUI drain required."""
|
||||
import argparse,hashlib,importlib.util,json,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
ROOT=Path('/opt/athena-deck-dev/qwen-anna-gpu-activation');BASE=Path('/opt/athena-deck-dev/runtime');STATE=BASE/'state';CANON=Path('/opt/athena-deck-dev/source')
|
||||
FILES=['tts_worker.py','tts_runtime.py','tts_test.py','profiles.py','backup.py','endpoint.py','profiles-ui.js','tts-ui.js']
|
||||
IMAGE='athena-deck-standalone:qwen-anna-existing-gpu'
|
||||
SETTINGS=['profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json']
|
||||
def inspect():return json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
def digest(path):return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
def run(args,**kwargs):return subprocess.run(list(map(str,args)),check=True,**kwargs)
|
||||
def mounts(config):
|
||||
out=['--mount','type=bind,src='+str(STATE)+',dst=/var/lib/deck']
|
||||
for p in dict.fromkeys([config.get('strata_storage'),*config.get('strata_storage_mounts',[]),*config.get('external_model_roots',[])]):
|
||||
if not p:continue
|
||||
path=Path(p);assert path.is_absolute() and path.is_dir() and not {'vpn','vpn.auth','OpenVPN-KIT','GluetunVPN'}&set(path.parts)
|
||||
out+=['--mount','type=bind,src='+p+',dst='+p+',readonly']
|
||||
return out
|
||||
|
||||
def prepare():
|
||||
info=inspect();config=json.loads((BASE/'installation.json').read_text());app=ROOT/'image/app';assert all((app/n).is_file() for n in FILES)
|
||||
tag=info['Config']['Image'];assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',tag],text=True).strip()==info['Image']
|
||||
(ROOT/'image/Dockerfile').write_text('FROM '+tag+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
with (ROOT/'build.log').open('w') as f:run(['docker','build','--network','none','--pull=false','-t',IMAGE,ROOT/'image'],stdout=f,stderr=subprocess.STDOUT,timeout=180)
|
||||
tmp=ROOT/'test-tmp';tmp.mkdir(exist_ok=True);tmp.chmod(0o777)
|
||||
probe='from server import Server;from pathlib import Path;import tempfile\nwith tempfile.TemporaryDirectory() as d:\n s=Server(0,state_dir=Path(d));s.endpoint.close();s.video.close();s.dashboard.close();s.server_close()\nprint("Full isolated Server constructor passed")'
|
||||
run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(tmp)+',dst=/test-tmp','--entrypoint','python3',IMAGE,'-B','-c',probe],timeout=45)
|
||||
before=ROOT/'source-before';before.mkdir(exist_ok=True)
|
||||
for n in FILES:shutil.copy2(CANON/n,before/n)
|
||||
data=dict(phase='prepared',image_before=tag,image_id_before=info['Image'],started_before=info['State']['StartedAt'],config=config,baseline={n:digest(CANON/n) for n in FILES},settings={n:(STATE/n).read_text() for n in SETTINGS})
|
||||
path=ROOT/'activation.json';path.write_text(json.dumps(data,indent=2));path.chmod(0o600)
|
||||
assert inspect()['Image']==info['Image'] and inspect()['State']['StartedAt']==info['State']['StartedAt'];print('Image and full constructor prepared; production unchanged',flush=True)
|
||||
|
||||
def apply():
|
||||
data=json.loads((ROOT/'activation.json').read_text());assert data['phase']=='prepared'
|
||||
d=json.loads((ROOT/'drained.json').read_text());assert time.time()-d['checked_at']<60 and d['state']=='stopped' and type(d['active_requests']) is int and d['active_requests']==0
|
||||
assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests')) and d['scheduler']['switching'] is False
|
||||
assert inspect()['Image']==data['image_id_before'];assert all(digest(CANON/n)==h for n,h in data['baseline'].items())
|
||||
assert all((STATE/n).read_text()==text for n,text in data['settings'].items() if n!='endpoint.json')
|
||||
old_profiles=json.loads(data['settings']['profiles.json']);old_endpoint=json.loads(data['settings']['endpoint.json']);assert old_endpoint['autostart'] is True
|
||||
run(['docker','stop','--timeout','45','athena-deck-dev']);activated=False
|
||||
try:
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip()
|
||||
code="""from pathlib import Path
|
||||
from catalog import Catalog
|
||||
from profiles import Profiles
|
||||
r=Path('/var/lib/deck');s=Profiles(r/'profiles.json',Catalog(r/'models'));old=next(p for p in s.rows if p['id']=='16387088f1ac4a5bae8ca037932f9f58')
|
||||
assert not any(p.get('api_id')=='qwen-anna-gpu-3060' for p in s.rows)
|
||||
p=s.save(dict(id=None,revision=0,name='Qwen 1.7B Anna GPU 3060',api_id='qwen-anna-gpu-3060',kind='audio',model_id=old['model_id'],parameters={'speed':1,'tts_voice':'Anna'}));print('Saved Anna profile '+p['id'])
|
||||
"""
|
||||
common=['docker','run','--rm','--network','none','--user','65534:65534','--cap-drop','ALL',*mounts(data['config'])]
|
||||
run([*common,'-e','NVIDIA_VISIBLE_DEVICES=void','--entrypoint','python3',IMAGE,'-B','-c',code],timeout=30)
|
||||
run([*common,'--gpus','device=GPU-4834d9d7-5b61-3004-1fb3-4ae49d482d4b','--memory','12g','--pids-limit','1024','-e','NVIDIA_DRIVER_CAPABILITIES=compute,utility','--mount','type=bind,src='+str(ROOT/'scripts')+',dst=/accept,readonly','--entrypoint','python3',IMAGE,'-B','/accept/check.py'],timeout=240)
|
||||
now=json.loads((STATE/'profiles.json').read_text());extra=[p for p in now if p.get('api_id')=='qwen-anna-gpu-3060'];assert len(extra)==1
|
||||
assert [p for p in now if p['id']!=extra[0]['id']]==old_profiles
|
||||
assert all((STATE/n).read_text()==data['settings'][n] for n in SETTINGS if n not in ('profiles.json','endpoint.json'))
|
||||
# Restore the original endpoint publication/autostart exactly; no default voice change.
|
||||
(STATE/'endpoint.json').write_text(data['settings']['endpoint.json'])
|
||||
for n in FILES:shutil.copy2(ROOT/'image/app'/n,CANON/n)
|
||||
spec=importlib.util.spec_from_file_location('deck_install',CANON/'deploy/install.py');installer=importlib.util.module_from_spec(spec);spec.loader.exec_module(installer)
|
||||
config=dict(data['config'],image=IMAGE,previous_image=data['image_before'])
|
||||
run(['docker','rm','athena-deck-dev']);installer.launch(config);installer.ready(config);installer.write_manifest(BASE,config)
|
||||
activated=True;data.update(phase='activated and GPU tested; restore chat model',profile=extra[0],finished_at=time.time());(ROOT/'activation.json').write_text(json.dumps(data,indent=2));print(json.dumps(dict(activated=True,profile=extra[0]['name'],api_id=extra[0]['api_id'],standard_voice_unchanged=True)),flush=True)
|
||||
finally:
|
||||
if not activated:
|
||||
current=json.loads((STATE/'profiles.json').read_text());assert [p for p in current if p.get('api_id')!='qwen-anna-gpu-3060']==old_profiles
|
||||
(STATE/'profiles.json').write_text(data['settings']['profiles.json']);(STATE/'endpoint.json').write_text(data['settings']['endpoint.json'])
|
||||
# Before image replacement the original stopped container is retained.
|
||||
for n in FILES:shutil.copy2(ROOT/'source-before'/n,CANON/n)
|
||||
try:live=inspect()
|
||||
except subprocess.CalledProcessError:live=None
|
||||
if live is None:
|
||||
spec=importlib.util.spec_from_file_location('deck_restore',CANON/'deploy/install.py');assert spec and spec.loader
|
||||
installer=importlib.util.module_from_spec(spec);spec.loader.exec_module(installer)
|
||||
installer.launch(data['config']);installer.ready(data['config']);installer.write_manifest(BASE,data['config'])
|
||||
elif not live['State']['Running']:run(['docker','start','athena-deck-dev'])
|
||||
print('Activation failed; original settings/container restored. Verify health.',flush=True)
|
||||
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('operation',choices=['prepare','apply']);p.add_argument('--go',action='store_true');a=p.parse_args();assert a.go,'Current explicit Michael Go required'
|
||||
prepare() if a.operation=='prepare' else apply()
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Short real Anna test, using only the existing GPU environment and model."""
|
||||
import json,sys,time,wave,subprocess,struct,math
|
||||
from pathlib import Path
|
||||
sys.path.insert(0,'/app')
|
||||
from catalog import Catalog
|
||||
from profiles import Profiles
|
||||
from tts_runtime import TTSRuntime
|
||||
from tts_test import TTSTests
|
||||
root=Path('/var/lib/deck');profiles=Profiles(root/'profiles.json',Catalog(root/'models'));runtime=TTSRuntime(root/'tts-runtime')
|
||||
worker=TTSTests(root/'tts-tests',profiles,runtime);profiles.tts_blockers=worker.blockers;worker.policy='per_request'
|
||||
# No HTTP listener or second service: the authenticated production endpoint must
|
||||
# have been normally drained before this isolated, bounded acceptance is invoked.
|
||||
p=next(p for p in profiles.rows if p['api_id']=='qwen-anna-gpu-3060')
|
||||
t=time.monotonic();gpu_seen=False;peak=0
|
||||
try:
|
||||
job=worker.start(p['id'],'Hallo Michael. Hier spricht Anna auf deiner Athena.',streaming=True)
|
||||
while worker.job_status(job['id'])['state']=='running':
|
||||
if time.monotonic()-t>180:raise TimeoutError('Anna short acceptance exceeded 180 seconds')
|
||||
rows=subprocess.check_output(['nvidia-smi','--query-compute-apps=gpu_uuid,used_gpu_memory','--format=csv,noheader,nounits'],text=True)
|
||||
for line in rows.splitlines():
|
||||
gpu,memory=map(str.strip,line.split(','))
|
||||
if gpu=='GPU-4834d9d7-5b61-3004-1fb3-4ae49d482d4b':gpu_seen=True;peak=max(peak,int(memory))
|
||||
time.sleep(.2)
|
||||
result=worker.job_status(job['id']);assert result['state']=='complete',result
|
||||
path=root/'tts-tests'/job['id']/'result.wav'
|
||||
with wave.open(str(path)) as f:
|
||||
assert f.getframerate()==24000 and f.getnchannels()==1 and f.getsampwidth()==2
|
||||
pcm=f.readframes(f.getnframes());frames=f.getnframes()
|
||||
rms=math.sqrt(sum(n[0]*n[0] for n in struct.iter_unpack('<h',pcm))/(len(pcm)//2));assert rms>1
|
||||
assert gpu_seen and peak>1024
|
||||
chunks=list((path.parent).glob('chunk-*.pcm'));assert chunks
|
||||
out=dict(ok=True,profile=p['name'],api_id=p['api_id'],profile_id=p['id'],voice=p['parameters']['tts_voice'],model='Qwen3-TTS-12Hz-1.7B-Base',gpu='RTX 3060',gpu_observed=True,peak_mib=peak,job_id=job['id'],duration=frames/24000,rms=rms,seconds=time.monotonic()-t,first_chunk_seconds=result.get('first_chunk_seconds'),chunks=len(chunks),wav=str(path))
|
||||
(root/'tts-tests'/'anna-gpu-acceptance.json').write_text(json.dumps(out,indent=2));print(json.dumps(out),flush=True)
|
||||
finally:worker.stop()
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: single-file TTS admission correction, explicit maintenance Go."""
|
||||
import argparse,hashlib,importlib.util,json,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
ROOT=Path('/opt/athena-deck-dev/qwen-tts-ram-fix');BASE=Path('/opt/athena-deck-dev/runtime');STATE=BASE/'state';SOURCE=Path('/opt/athena-deck-dev/source');IMAGE='athena-deck-standalone:qwen-tts-ram-fix'
|
||||
SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json')
|
||||
def info():return json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
def installer():
|
||||
spec=importlib.util.spec_from_file_location('deck_install',SOURCE/'deploy/install.py');assert spec and spec.loader
|
||||
module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module);return module
|
||||
|
||||
def prepare():
|
||||
d=info();tag=d['Config']['Image'];assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',tag],text=True).strip()==d['Image']
|
||||
(ROOT/'Dockerfile').write_text('FROM '+tag+'\nUSER root\nCOPY tts_test.py /app/tts_test.py\nUSER 65534:65534\n')
|
||||
with (ROOT/'build.log').open('w') as f:subprocess.run(['docker','build','--network','none','--pull=false','-t',IMAGE,ROOT],check=True,stdout=f,stderr=subprocess.STDOUT,timeout=180)
|
||||
probe='from tts_test import TTSTests; assert hasattr(TTSTests,"_check_ram");print("TTS RAM image imports passed")'
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','--entrypoint','python3',IMAGE,'-B','-c',probe],check=True,timeout=25)
|
||||
shutil.copy2(SOURCE/'tts_test.py',ROOT/'tts_test.before.py')
|
||||
out=dict(phase='prepared',image_before=tag,image_id_before=d['Image'],started_before=d['State']['StartedAt'],source_before=sha(SOURCE/'tts_test.py'),source_after=sha(ROOT/'tts_test.py'),config=json.loads((BASE/'installation.json').read_text()),settings={n:(STATE/n).read_text() for n in SETTINGS})
|
||||
p=ROOT/'activation.json';p.write_text(json.dumps(out,indent=2));p.chmod(0o600)
|
||||
assert info()['State']['StartedAt']==d['State']['StartedAt'];print('RAM-fix image prepared; original live process unchanged')
|
||||
|
||||
def apply():
|
||||
a=json.loads((ROOT/'activation.json').read_text());assert a['phase']=='prepared'
|
||||
d=json.loads((ROOT/'drained.json').read_text());assert time.time()-d['checked_at']<60 and d['state']=='stopped' and type(d['active_requests']) is int and d['active_requests']==0
|
||||
assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests')) and d['scheduler']['switching'] is False
|
||||
assert info()['Image']==a['image_id_before'] and sha(SOURCE/'tts_test.py')==a['source_before']
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS if n!='endpoint.json')
|
||||
subprocess.run(['docker','stop','--timeout','45','athena-deck-dev'],check=True)
|
||||
try:
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip()
|
||||
shutil.copy2(ROOT/'tts_test.py',SOURCE/'tts_test.py');(STATE/'endpoint.json').write_text(a['settings']['endpoint.json'])
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
config=dict(a['config'],image=IMAGE,previous_image=a['image_before']);i=installer();i.launch(config);i.ready(config);i.write_manifest(BASE,config)
|
||||
deadline=time.monotonic()+90
|
||||
while info()['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()<deadline:time.sleep(1)
|
||||
assert info()['State']['Health']['Status']=='healthy' and sha(SOURCE/'tts_test.py')==a['source_after']
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS)
|
||||
a.update(phase='activated; live API acceptance required',finished_at=time.time());(ROOT/'activation.json').write_text(json.dumps(a,indent=2));print('RAM fix activated; all saved profiles and settings unchanged')
|
||||
except Exception:
|
||||
shutil.copy2(ROOT/'tts_test.before.py',SOURCE/'tts_test.py');(STATE/'endpoint.json').write_text(a['settings']['endpoint.json'])
|
||||
print('Activation failure; source restored. Inspect live state before further action.',flush=True);raise
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('mode',choices=('prepare','apply'));p.add_argument('--go',action='store_true');a=p.parse_args();assert a.go,'Separate Michael maintenance Go required'
|
||||
prepare() if a.mode=='prepare' else apply()
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena: run in live Deck with Python 3.12; two warm direct-worker measurements.
|
||||
No service restart, scheduler switch, package install or production policy change.
|
||||
"""
|
||||
import json,time,uuid,wave,subprocess,sys
|
||||
from pathlib import Path
|
||||
sys.path.insert(0,'/app')
|
||||
from tts_runtime import TTSRuntime
|
||||
from tts_test import TTSTests
|
||||
from image_test import probe,cgroup_headroom
|
||||
root=Path('/var/lib/deck');gpu_id='GPU-4834d9d7-5b61-3004-1fb3-4ae49d482d4b'
|
||||
gpu=next(g for g in probe() if g['uuid']==gpu_id and 'RTX 3060' in g['name'])
|
||||
assert gpu['free_mib']>=7000,'Insufficient free VRAM; no other model will be evicted'
|
||||
headroom=cgroup_headroom();assert headroom is None or headroom>=8*1024**3,'Insufficient RAM headroom'
|
||||
# Refuse coexistence with an unknown 3060 workload; the resident Basalt vision
|
||||
# sidecar is the only expected peer. Never stop any existing process.
|
||||
apps=subprocess.check_output(['nvidia-smi','--query-compute-apps=gpu_uuid,process_name','--format=csv,noheader'],text=True)
|
||||
for line in apps.splitlines():
|
||||
device,name=map(str.strip,line.split(',',1))
|
||||
if device==gpu_id:assert 'vision' in name.lower(),'3060 occupied by another workload'
|
||||
runtime=TTSRuntime(root/'tts-runtime');runtime.anna_reference()
|
||||
# Assert exact existing backend before _ensure; don't trigger its repair/install path.
|
||||
python,_=runtime.paths()
|
||||
subprocess.run([str(python),'-c','from importlib.metadata import version;assert version("faster-qwen3-tts")=="0.3.0"'],check=True)
|
||||
worker=TTSTests(root/'tts-tests',None,runtime);rows=[];start=time.monotonic()
|
||||
try:
|
||||
process=worker._ensure(gpu);load_seconds=time.monotonic()-start
|
||||
print(json.dumps(dict(stage='loaded',load_seconds=load_seconds,gpu=gpu_id)),flush=True)
|
||||
texts=[
|
||||
'Hallo Michael. Ich bin Anna und spreche jetzt auf deiner Athena. Dieser kurze Test prüft, ob meine Stimme schneller erzeugt wird, als du sie anhören kannst.',
|
||||
'Das Sprachmodell und der Bildbetrachter bleiben dabei geladen. Für die Sprachausgabe verwenden wir die vorhandene Grafikkarte. Gemessen werden der erste Audioblock und die Zeit für den gesamten gesprochenen Text.'
|
||||
]
|
||||
for index,text in enumerate(texts,1):
|
||||
directory=root/'tts-tests'/uuid.uuid4().hex;directory.mkdir(mode=0o700)
|
||||
started=time.monotonic();first=None
|
||||
process.stdin.write(json.dumps(dict(output=str(directory),text=text,speaker='Anna',language='German',speed=1,streaming=True))+'\n');process.stdin.flush()
|
||||
while not (directory/'result.json').is_file():
|
||||
if first is None and (directory/'chunk-000000.pcm').is_file():first=time.monotonic()-started
|
||||
if process.poll() is not None:raise RuntimeError('Own TTS worker terminated')
|
||||
if time.monotonic()-started>90:raise TimeoutError('Bounded warm generation exceeded 90 seconds')
|
||||
time.sleep(.01)
|
||||
elapsed=time.monotonic()-started;result=json.loads((directory/'result.json').read_text());assert result['ok'],result
|
||||
if first is None and (directory/'chunk-000000.pcm').exists():first=elapsed
|
||||
with wave.open(str(directory/'result.wav')) as f:
|
||||
assert f.getnchannels()==1 and f.getframerate()==24000 and f.getnframes()>0
|
||||
duration=f.getnframes()/f.getframerate()
|
||||
assert first is not None and process.poll() is None
|
||||
row=dict(run=index,audio_seconds=duration,generation_seconds=elapsed,first_audio_seconds=first,rtf=elapsed/duration,realtime_speed=duration/elapsed,job_id=directory.name)
|
||||
rows.append(row);print(json.dumps(row),flush=True)
|
||||
out=dict(model='Qwen3-TTS-12Hz-1.7B-Base',voice='Anna',gpu=gpu_id,load_seconds=load_seconds,runs=rows,scope='Two sequential warm direct-worker streaming measurements; no API/network/player latency',total_audio_seconds=sum(r['audio_seconds'] for r in rows),total_generation_seconds=sum(r['generation_seconds'] for r in rows))
|
||||
out['aggregate_realtime_speed']=out['total_audio_seconds']/out['total_generation_seconds'];out['aggregate_rtf']=out['total_generation_seconds']/out['total_audio_seconds']
|
||||
(root/'tts-tests'/'anna-gpu-realtime.json').write_text(json.dumps(out,indent=2));print(json.dumps(out),flush=True)
|
||||
finally:worker.stop()
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS Hermes: bounded Basalt restoration, Anna WAV, real GPU-ASR transcript."""
|
||||
import importlib.util,io,json,time,urllib.request,wave
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent
|
||||
s=importlib.util.spec_from_file_location('managed_transport',ROOT/'basalt-candidate-2026-11-01/paired_transport.py');assert s and s.loader
|
||||
m=importlib.util.module_from_spec(s);s.loader.exec_module(m);KEY=m.key();BASE='http://192.168.1.212:8120';START=time.monotonic()
|
||||
OUT=Path('/opt/data/profiles/athena-deck/cache/scratch/qwen-asr-gpu-acceptance.json')
|
||||
def call(path,data=None,content_type='application/json',binary=False):
|
||||
assert time.monotonic()-START<900,'15-minute acceptance budget exceeded'
|
||||
if isinstance(data,dict):data=json.dumps(data).encode()
|
||||
req=urllib.request.Request(BASE+path,data=data,headers={'Authorization':'Bearer '+KEY,'Content-Type':content_type})
|
||||
with urllib.request.urlopen(req,timeout=180) as r:return r.read() if binary else json.load(r)
|
||||
def main():
|
||||
result={}
|
||||
d=call('/v1/chat/completions',dict(model='flash-next-basalt',messages=[dict(role='user',content='Antworte nur mit BEREIT.')],max_tokens=16,temperature=0,chat_template_kwargs={'enable_thinking':False}))
|
||||
assert 'BEREIT' in (d['choices'][0]['message'].get('content') or '').upper();result['basalt_restored']=True;print('Basalt restored and actual answer verified',flush=True)
|
||||
phrase='Der blaue Schlüssel liegt auf dem Tisch.'
|
||||
audio=call('/v1/audio/speech',dict(model='qwen-anna-gpu-3060',voice='default',input=phrase,response_format='wav'),binary=True)
|
||||
with wave.open(io.BytesIO(audio),'rb') as w:result['anna']=dict(rate=w.getframerate(),channels=w.getnchannels(),seconds=w.getnframes()/w.getframerate())
|
||||
assert result['anna']['rate']==24000 and result['anna']['channels']==1;print('Anna real speech API passed',flush=True)
|
||||
boundary='asr-acceptance-fixture';body=f'--{boundary}\r\nContent-Disposition: form-data; name="file"; filename="synthetic-reference.wav"\r\nContent-Type: audio/wav\r\n\r\n'.encode()+audio+b'\r\n'
|
||||
for name,value in [('model','qwen3-asr-3060'),('language','de')]:body+=f'--{boundary}\r\nContent-Disposition: form-data; name="{name}"\r\n\r\n{value}\r\n'.encode()
|
||||
body+=f'--{boundary}--\r\n'.encode();t=time.monotonic();d=call('/v1/audio/transcriptions',body,'multipart/form-data; boundary='+boundary)
|
||||
text=d.get('text','');assert isinstance(text,str) and 'blau' in text.lower() and 'tisch' in text.lower() and 'Transcribe audio' not in text,text
|
||||
result.update(asr_text=text,asr_seconds=time.monotonic()-t,total_seconds=time.monotonic()-START,scope='One short synthetic speech/transcription, not a benchmark; GPU process placement must be checked separately')
|
||||
OUT.write_text(json.dumps(result,indent=2));assert json.loads(OUT.read_text())==result;print(json.dumps(result),flush=True)
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: GPU-ASR overlay; requires explicit Go and regular GUI drain."""
|
||||
import argparse,hashlib,importlib.util,json,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
ROOT=Path('/opt/athena-deck-dev/asr-gpu-activation');BASE=Path('/opt/athena-deck-dev/runtime');STATE=BASE/'state';SOURCE=Path('/opt/athena-deck-dev/source');IMAGE='athena-deck-standalone:qwen-asr-gpu'
|
||||
FILES=('profiles.py','profiles-ui.js','backup.py','stt.py','inference.py','server.py','audio_policy.py','video.py','video_comfy.py','deploy/QWEN_ASR_GPU.md','deploy/qwen-asr-3060-profile.json','deploy/install.py')
|
||||
SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json')
|
||||
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() if p.is_file() else None
|
||||
def info():return json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
def save(a):
|
||||
p=ROOT/'activation.json';p.write_text(json.dumps(a,indent=2));p.chmod(0o600);assert json.loads(p.read_text())==a
|
||||
|
||||
def prepare():
|
||||
assert not (ROOT/'activation.json').exists()
|
||||
d=info();tag=d['Config']['Image'];assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',tag],text=True).strip()==d['Image']
|
||||
app=ROOT/'image/app';original=(SOURCE/'deploy/install.py').read_text();anchor="FILES += ['cpu_partition.py']";assert anchor in original
|
||||
(app/'deploy/install.py').write_text(original.replace(anchor,anchor+"\nFILES += ['deploy/QWEN_ASR_GPU.md','deploy/qwen-asr-3060-profile.json']",1))
|
||||
before={n:sha(SOURCE/n) for n in FILES};after={n:sha(app/n) for n in FILES};assert all(after.values())
|
||||
for n in FILES:
|
||||
(app/n).chmod(0o644)
|
||||
if before[n]:
|
||||
p=ROOT/'before'/n;p.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(SOURCE/n,p)
|
||||
(ROOT/'image/Dockerfile').write_text('FROM '+tag+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
(ROOT/'image/.dockerignore').write_text('*\n!Dockerfile\n!app/\n!app/**\n')
|
||||
with (ROOT/'build.log').open('w') as f:subprocess.run(['docker','build','--network','none','--pull=false','-t',IMAGE,ROOT/'image'],stdout=f,stderr=subprocess.STDOUT,check=True,timeout=180)
|
||||
probe="from pathlib import Path;import tempfile;from server import Server;from stt import qwen_asr_request;assert 'Transcribe audio' not in str(qwen_asr_request(b'fixture','de'));t=tempfile.TemporaryDirectory();s=Server(0,state_dir=Path(t.name));s.endpoint.close();s.video.close();s.dashboard.close();s.server_close();t.cleanup();print('Isolated full Server and ASR protocol passed')"
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(STATE/'basalt-runtime/tmp')+',dst=/test-tmp','--entrypoint','python3',IMAGE,'-B','-c',probe],check=True,timeout=45)
|
||||
assert info()['State']['StartedAt']==d['State']['StartedAt']
|
||||
save(dict(phase='prepared',image_before=tag,image_id_before=d['Image'],started_before=d['State']['StartedAt'],source_before=before,source_after=after,config=json.loads((BASE/'installation.json').read_text()),settings={n:(STATE/n).read_text() for n in SETTINGS}))
|
||||
print('GPU-ASR image prepared and constructor verified; production unchanged')
|
||||
def apply():
|
||||
a=json.loads((ROOT/'activation.json').read_text());assert a['phase']=='prepared';d=json.loads((ROOT/'drained.json').read_text());assert time.time()-d['checked_at']<60 and d['state']=='stopped' and type(d['active_requests']) is int and d['active_requests']==0
|
||||
assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests')) and d['scheduler']['switching'] is False
|
||||
assert info()['Image']==a['image_id_before'] and all(sha(SOURCE/n)==a['source_before'][n] for n in FILES)
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS if n!='endpoint.json')
|
||||
subprocess.run(['docker','stop','--timeout','45','athena-deck-dev'],check=True)
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip()
|
||||
for n in FILES:
|
||||
(SOURCE/n).parent.mkdir(parents=True,exist_ok=True);shutil.copy2(ROOT/'image/app'/n,SOURCE/n)
|
||||
(STATE/'endpoint.json').write_text(a['settings']['endpoint.json'])
|
||||
code="""import json,pathlib,os
|
||||
from types import SimpleNamespace
|
||||
from catalog import Catalog
|
||||
from profiles import Profiles
|
||||
from runtime import Runtime
|
||||
from inference import Scheduler
|
||||
from stt import STT
|
||||
from endpoint import Endpoint
|
||||
class RegistrationCatalog(Catalog):
|
||||
def _save_history(self):pass
|
||||
root=pathlib.Path(os.environ.get('DECK_ASR_STATE','/var/lib/deck'));catalog=RegistrationCatalog(root/'models');profiles=Profiles(root/'profiles.json',catalog)
|
||||
worker=SimpleNamespace(status=lambda:{'state':'stopped'},stop=lambda:None);scheduler=Scheduler(worker);stt=STT(profiles,catalog,Runtime(root/'runtime'));stt.acquire=scheduler.stt_reservation;profiles.stt_blockers=stt.blockers
|
||||
data=json.loads(pathlib.Path('/app/deploy/qwen-asr-3060-profile.json').read_text());assert not any(p.get('api_id')==data['api_id'] for p in profiles.rows);p=profiles.save(data)
|
||||
ep=Endpoint(root,profiles,worker,scheduler,SimpleNamespace(status=lambda:{'job':None}),SimpleNamespace(read=lambda:None),8108);ep.stt=stt
|
||||
for old in profiles.rows:
|
||||
if old['kind']=='stt' and old['id']!=p['id'] and old['id'] in ep.config['enabled_profiles']:ep.enable({'id':old['id'],'enabled':False})
|
||||
ep.enable({'id':p['id'],'enabled':True});actual=json.loads((root/'endpoint.json').read_text());assert p['id'] in actual['enabled_profiles'];assert json.loads((root/'profiles.json').read_text())[-1]['parameters']['stt_device']==data['parameters']['stt_device']
|
||||
print('GPU-ASR profile saved and published via maintained classes; no model loaded')
|
||||
"""
|
||||
mounts=[]
|
||||
for v in [a['config'].get('strata_storage'),*a['config'].get('strata_storage_mounts',[]),*a['config'].get('external_model_roots',[])]:
|
||||
if not v:continue
|
||||
p=Path(v);assert p.is_absolute() and p.is_dir() and not {'vpn','vpn.auth','OpenVPN-KIT','GluetunVPN'}&set(p.parts);mounts+=['--mount','type=bind,src='+str(p)+',dst='+str(p)+',readonly']
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','--mount','type=bind,src='+str(STATE)+',dst=/var/lib/deck',*mounts,'--entrypoint','python3',IMAGE,'-B','-c',code],check=True,timeout=45)
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS if n not in ('endpoint.json','profiles.json'))
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
spec=importlib.util.spec_from_file_location('deck_install',SOURCE/'deploy/install.py');assert spec and spec.loader;i=importlib.util.module_from_spec(spec);spec.loader.exec_module(i);c=dict(a['config'],image=IMAGE,previous_image=a['image_before']);i.launch(c);i.ready(c)
|
||||
end=time.monotonic()+90
|
||||
while info()['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()<end:time.sleep(1)
|
||||
assert info()['State']['Health']['Status']=='healthy';i.write_manifest(BASE,c);assert all(sha(SOURCE/n)==a['source_after'][n] for n in FILES)
|
||||
a.update(phase='activated; GPU-ASR functional acceptance pending',activated_at=time.time());save(a);print('GPU-ASR activated and healthy; restore Basalt and check real ASR now')
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('operation',choices=('prepare','apply'));p.add_argument('--go',action='store_true');a=p.parse_args();assert a.go,'Explicit Michael Go required'
|
||||
prepare() if a.operation=='prepare' else apply()
|
||||
@@ -0,0 +1,78 @@
|
||||
# Qwen-ASR: Präfixkorrektur und erfolgreiche API-Abnahme
|
||||
|
||||
## Ergebnis
|
||||
|
||||
`athena-deck-standalone:qwen-asr-protocol-fix` ist aktiviert und healthy.
|
||||
Die Korrektur in `stt.qwen_asr_request` verwendet für Deutsch/Englisch den
|
||||
trainierten Marker `<asr_text>` anstelle von `<|asr_text|>`. Der Parser bleibt
|
||||
mit beiden Schreibweisen kompatibel. Keine neuen Gewichte, Downloads,
|
||||
Laufzeiten, Profile oder Geräteeinstellungen.
|
||||
|
||||
Die vorherige GPU-Aktivierung hatte die Residenz korrekt hergestellt, aber
|
||||
noch keine erfolgreiche Transkription: Die erste echte Prüfung lieferte leeren
|
||||
Text. Das wurde nicht als funktionierendes STT abgenommen.
|
||||
|
||||
## Tatsächlich ausgeführte Prüfungen
|
||||
|
||||
- 81 lokale Tests: `python -m unittest test_qwen_asr_protocol test_stt_gpu
|
||||
test_audio_residency test_endpoint -q`.
|
||||
- Neues Overlay auf dem tatsächlich laufenden, anhand seiner Image-ID geprüften
|
||||
GPU-ASR-Image; nur `stt.py` und die damalige GPU-ASR-Rezeptdokumentation.
|
||||
- Isolierter vollständiger `Server`-Konstruktor und exakte Deutsch-/Englisch-
|
||||
Präfixassertionen im neuen Image, ohne Produktivzustand und ohne GPU-Zugriff.
|
||||
- Normales angemeldetes Management: API-Stopp nur bei explizit null aktiven und
|
||||
wartenden Anfragen, einschließlich TTS-/STT-Warteschlangen. Danach frischer
|
||||
Nachweis `state=stopped`, sämtliche Zähler null, `switching=false`.
|
||||
- Nach Aktivierung Image-/Quellhashes und alle fünf geschützten Einstellungsdateien
|
||||
geprüft. Nach der echten Abnahme nochmals Einstellungen und installierte
|
||||
Quellhashes geprüft. Keine Profiländerung und keine doppelte Registrierung.
|
||||
- Basalt per echter API-Antwort wiederhergestellt.
|
||||
- Anna per echter Speech-API: 2,56 Sekunden Mono-WAV, 24 kHz.
|
||||
- Diese synthetische Sprachdatei per echter Transkriptions-API mit
|
||||
`model=qwen3-asr-3060`, `language=de` erkannt:
|
||||
**Der blaue Schlüssel liegt auf dem Tisch.**
|
||||
- Gemessene Zeit dieses einzelnen ASR-Aufrufs: 0,446880 Sekunden;
|
||||
gesamte Wiederherstellung und Prüfung: 37,616686 Sekunden. Kein Benchmark.
|
||||
- NVIDIA-Prozessmetadaten nachgewiesen: Qwen-ASR auf RTX 3060 mit 1996 MiB;
|
||||
Anna 4596 MiB und Basalt-Vision 1702 MiB ebenfalls dort. Basalt auf RTX 5080.
|
||||
|
||||
## Ausführungsorte und Wiederholungsschutz
|
||||
|
||||
- Athena-Hostskript: `docs/maintenance/qwen-asr-protocol-fix.py`, dort installiert
|
||||
unter `/opt/athena-deck-dev/asr-protocol-fix/activate.py`.
|
||||
- NAS-Abnahmeclient: `docs/maintenance/qwen-asr-gpu-accept.py` mit dem vorhandenen
|
||||
profilgebundenen Hermes-Transport. Er löst nur die verwaltete Athena-API-
|
||||
Identität auf; keine Credentials ausgeben oder kopieren.
|
||||
- Das neue Korrekturverzeichnis enthält das private Aktivierungsprotokoll,
|
||||
Vorher-Quellkopien, Imagebau und frischen Drain-Nachweis. Die alte
|
||||
`/opt/athena-deck-dev/asr-gpu-activation`-Aktivierung bleibt unberührt.
|
||||
- Bei einem Tool-Roundtrip war der erste Drain-Beleg älter als 60 Sekunden;
|
||||
der Sicherheitsguard hat korrekt vor dem Containerstopp abgebrochen.
|
||||
Danach frischen regulären GET-Nachweis und SSH-Übertragung/Anwendung in
|
||||
derselben Browser-Ausführung gekoppelt, über den zuvor verifizierten
|
||||
absoluten `athena-ssh`-Helfer. Keine Lockerung der Frische- oder Leerlaufprüfung.
|
||||
- Keine erneute Aktivierung ohne neues zulässiges Wartungsfenster. Nicht das
|
||||
initiale GPU-Profilregistrierungsskript erneut ausführen. Ein Management-Login
|
||||
ist kein Deployment-Go; das vorhandene Go wurde nur für diesen unveränderten
|
||||
Korrektur- und Abnahmeumfang verwendet.
|
||||
|
||||
## Nativ, Restore und Rückfall
|
||||
|
||||
Es ändern sich nur Python-Adapterlogik und Dokumentation; die native
|
||||
Reproduktion, festen Modell-/Projektorquellen, CUDA-Zuordnung und Zustandswurzel
|
||||
bleiben wie in `deploy/QWEN_ASR_GPU.md`. Keine neue Containerabhängigkeit.
|
||||
Das vollständige native Debian-Installations-/Restore-Ende-zu-Ende-Ziel bleibt
|
||||
weiterhin offen. Aktuelle Abnahme ist die laufende Containerinstallation,
|
||||
keine native Neuinstallation oder Wiederherstellung.
|
||||
|
||||
Vorheriges Image und ursprüngliche Quellen sind im geschützten
|
||||
Aktivierungsverzeichnis erhalten. Ein späterer Rückfall benötigt regulären
|
||||
Drain und gesonderte Freigabe; er würde den bekannten Präfixfehler wiederbringen.
|
||||
Einstellungsdateien müssen dafür nicht geändert werden. Die nachträglich
|
||||
aktualisierten Repository-Dokumente beschreiben den Abnahmeausgang; das Image
|
||||
enthält die beim Bau eingefrorene Vorab-Rezeptversion. Anwendungscode wurde
|
||||
nach dem geprüften Imagebau nicht verändert.
|
||||
|
||||
Noch nicht geprüft: Michaels Mikrofonaufnahme, Hermes-/Mac-Clientzustellung,
|
||||
andere Sprachen, lange Aufnahmen und Lastbetrieb. Keine weitere Modellinferenz
|
||||
nur zur Dokumentationsvervollständigung starten.
|
||||
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: narrow ASR-prefix correction, retained explicit maintenance Go."""
|
||||
import argparse,hashlib,importlib.util,json,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
ROOT=Path('/opt/athena-deck-dev/asr-protocol-fix');BASE=Path('/opt/athena-deck-dev/runtime');STATE=BASE/'state';SOURCE=Path('/opt/athena-deck-dev/source');IMAGE='athena-deck-standalone:qwen-asr-protocol-fix'
|
||||
FILES=('stt.py','deploy/QWEN_ASR_GPU.md')
|
||||
SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json')
|
||||
def info():return json.loads(subprocess.check_output(['docker','inspect','athena-deck-dev'],text=True))[0]
|
||||
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
def save(a):
|
||||
p=ROOT/'activation.json';p.write_text(json.dumps(a,indent=2));p.chmod(0o600)
|
||||
assert json.loads(p.read_text())==a
|
||||
|
||||
def prepare():
|
||||
assert not (ROOT/'activation.json').exists(),'Never overwrite an activation record'
|
||||
d=info();tag=d['Config']['Image'];assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',tag],text=True).strip()==d['Image']
|
||||
live=subprocess.check_output(['docker','exec','athena-deck-dev','python3','-B','-c','from pathlib import Path;import hashlib;print(hashlib.sha256(Path("/app/stt.py").read_bytes()).hexdigest())'],text=True).strip()
|
||||
assert live==sha(SOURCE/'stt.py'),'Canonical source and current image disagree'
|
||||
before={n:sha(SOURCE/n) for n in FILES};after={n:sha(ROOT/'app'/n) for n in FILES}
|
||||
for n in FILES:
|
||||
target=ROOT/'before'/n;target.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(SOURCE/n,target)
|
||||
(ROOT/'app'/n).chmod(0o644)
|
||||
(ROOT/'Dockerfile').write_text('FROM '+tag+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
(ROOT/'.dockerignore').write_text('*\n!Dockerfile\n!app/\n!app/**\n')
|
||||
with (ROOT/'build.log').open('w') as f:subprocess.run(['docker','build','--network','none','--pull=false','-t',IMAGE,ROOT],check=True,stdout=f,stderr=subprocess.STDOUT,timeout=180)
|
||||
probe="from pathlib import Path;import tempfile;from server import Server;from stt import qwen_asr_request;assert qwen_asr_request(b'fixture','de')['messages'][-1]['content']=='language German<asr_text>';assert qwen_asr_request(b'fixture','en')['messages'][-1]['content']=='language English<asr_text>';t=tempfile.TemporaryDirectory();s=Server(0,state_dir=Path(t.name));s.endpoint.close();s.video.close();s.dashboard.close();s.server_close();t.cleanup();print('Corrected protocol and isolated full Server constructor passed')"
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(STATE/'basalt-runtime/tmp')+',dst=/test-tmp','--entrypoint','python3',IMAGE,'-B','-c',probe],check=True,timeout=45)
|
||||
assert info()['State']['StartedAt']==d['State']['StartedAt']
|
||||
save(dict(phase='prepared',image_before=tag,image_id_before=d['Image'],started_before=d['State']['StartedAt'],source_before=before,source_after=after,config=json.loads((BASE/'installation.json').read_text()),settings={n:(STATE/n).read_text() for n in SETTINGS}))
|
||||
print('Correction image built and full constructor passed; production unchanged',flush=True)
|
||||
|
||||
def apply():
|
||||
a=json.loads((ROOT/'activation.json').read_text());assert a['phase']=='prepared'
|
||||
d=json.loads((ROOT/'drained.json').read_text());assert 0<=time.time()-d['checked_at']<60 and d['state']=='stopped'
|
||||
assert type(d['active_requests']) is int and d['active_requests']==0
|
||||
assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests','stt_waiting_requests')) and d['scheduler']['switching'] is False
|
||||
assert info()['Image']==a['image_id_before'] and all(sha(SOURCE/n)==a['source_before'][n] for n in FILES)
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS if n!='endpoint.json')
|
||||
subprocess.run(['docker','stop','--timeout','45','athena-deck-dev'],check=True)
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip()
|
||||
for n in FILES:shutil.copy2(ROOT/'app'/n,SOURCE/n)
|
||||
(STATE/'endpoint.json').write_text(a['settings']['endpoint.json'])
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
spec=importlib.util.spec_from_file_location('deck_install',SOURCE/'deploy/install.py');assert spec and spec.loader
|
||||
module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module)
|
||||
config=dict(a['config'],image=IMAGE,previous_image=a['image_before']);module.launch(config);module.ready(config)
|
||||
deadline=time.monotonic()+90
|
||||
while info()['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()<deadline:time.sleep(1)
|
||||
assert info()['State']['Health']['Status']=='healthy';module.write_manifest(BASE,config)
|
||||
assert all(sha(SOURCE/n)==a['source_after'][n] for n in FILES)
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS)
|
||||
verify='from pathlib import Path;import hashlib,json;print(json.dumps({n:hashlib.sha256((Path("/app")/n).read_bytes()).hexdigest() for n in '+repr(FILES)+'}))'
|
||||
image_hashes=json.loads(subprocess.check_output(['docker','exec','athena-deck-dev','python3','-B','-c',verify],text=True))
|
||||
assert image_hashes==a['source_after']
|
||||
a.update(phase='activated; actual transcription acceptance pending',activated_at=time.time());save(a)
|
||||
print('ASR protocol correction activated, healthy, image/source hashes and all protected settings verified',flush=True)
|
||||
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('operation',choices=('prepare','apply'));p.add_argument('--go',action='store_true');args=p.parse_args();assert args.go,'Existing explicit Michael maintenance Go required'
|
||||
prepare() if args.operation=='prepare' else apply()
|
||||
@@ -0,0 +1,147 @@
|
||||
# Shared Qwen owner: Anna-TTS und Stimmatelier
|
||||
|
||||
## Stand
|
||||
|
||||
**Produktiv aktiviert**, nach „Bitte live schalten“ und regulärem angemeldetem
|
||||
Drain mit explizit null aktiven/wartenden Aufträgen. Deck läuft als
|
||||
`athena-deck-standalone:shared-qwen`, Atelier ebenfalls aktualisiert; beide
|
||||
healthy. Image-/Quell-/Helperhashes, sämtliche geschützten Einstellungen und
|
||||
die UI-Sandbox sind verifiziert. Basalt antwortet wieder und Anna erzeugt Audio.
|
||||
Keine Profile oder API-Freigaben geändert. Anna, ASR und Vision sind auf der
|
||||
RTX 3060, Basalt auf der RTX 5080 resident.
|
||||
|
||||
Die echte Atelier-GPU-Abnahme bleibt offen: Die erwartungsgemäß nach dem Neustart
|
||||
abgelaufene Verwaltungsanmeldung liefert HTTP 401. Das Voice-Profil ist nicht
|
||||
für API-Token freigegeben und wird nicht zur Testumgehung veröffentlicht.
|
||||
Browser ist an der normalen Loginseite, kein Vault-Login vorhanden. Nach
|
||||
Michaels Anmeldung dieselbe Go-Freigabe für die kurze Abnahme nutzen; kein
|
||||
weiterer Neustart und keine erneute Aktivierung erforderlich.
|
||||
|
||||
## Verhalten
|
||||
|
||||
- Das bestehende Voice-Profil `Qwen1.7B Stimmklonen` bleibt als separates
|
||||
Atelierprofil mit eigener Referenz und optionalem Transkript erhalten.
|
||||
- Qwen-Atelieraufträge delegieren an `TTSTests.start_clone`, nicht an einen
|
||||
zweiten `qwen_clone_worker`. Fehlende gemeinsame Anbindung führt zum Fehler,
|
||||
nicht zu einem stillen zweiten Modellstart.
|
||||
- Beide Oberflächen senden bei expliziter Qwen-Profilwahl
|
||||
`POST /api/v1/voice/select`. Dieser Befehl hält einen bereits geladenen
|
||||
TTS-Owner resident, startet aber kein Modell und keine Inferenz. Er ändert
|
||||
weder Betriebsart, Standardstimme noch Endpoint-Publikation. API-Token dürfen
|
||||
nur freigegebene Voice-Profile auswählen; normale Verwaltungsrechte und der
|
||||
Same-Origin-Control-Guard bleiben erhalten.
|
||||
- Klonen verwendet die bestehende TTS-FIFO-Zulassung und denselben persistenten
|
||||
Worker. Kein exklusiver Voice-Lease, kein LLM-/TTS-/ASR-Entladen beim Start.
|
||||
Aktive Nicht-Chat-GPU-Jobs dürfen nicht parallel durch TTS umgangen werden.
|
||||
- Ein erfolgreicher Atelierauftrag hält den gemeinsamen Owner auch ohne
|
||||
öffentliche TTS-Freigabe resident. Der In-Memory-Pin verhindert implizites
|
||||
`per_request`-Entladen bei folgenden regulären TTS-Aufträgen. Explizites
|
||||
Entladen, das ausdrücklich angeforderte Entladen bei `per_request`-Konfiguration
|
||||
und reguläre exklusive Betriebsartwechsel bleiben zuständig und löschen den Pin.
|
||||
- Annas Owner-Profil-ID bleibt erhalten. Bei Kaltstart wird ein passendes
|
||||
veröffentlichtes Audio-Profil als Owner aufgelöst; das Voice-Profil ersetzt
|
||||
nicht Annas TTS-Publikation. Kaltstart benutzt die bestehenden VRAM-/RAM-Guards,
|
||||
residente Ausführung berücksichtigt gemeinsam genutzte GPU-Belegung.
|
||||
- Der Worker erzeugt einen auftragsspezifischen VoiceClonePrompt. Mit Transkript
|
||||
wird ICL, ohne Transkript x-vector-only benutzt. Referenz und Prompt ersetzen
|
||||
keine Preset-Einträge. Seed-Verwendung ist in `torch.random.fork_rng` gekapselt.
|
||||
- Abbruch eines wartenden Atelierauftrags cancelt nicht Anna. Ein laufender
|
||||
Auftrag wird ausgedient und sein Ergebnis verworfen, statt den gemeinsamen
|
||||
Prozess zu töten. Ein wirklich hängender Worker wird am bestehenden Zeitlimit
|
||||
weiterhin beendet, bevor seine Ressourcenzulassung freigegeben wird; dies ist
|
||||
Fehlerbehandlung, kein normaler Profilwechsel.
|
||||
- Referenz-WAV wird privat im Shared-TTS-Auftragsverzeichnis abgelegt und nach
|
||||
Abschluss entfernt. Text/Referenztranskript/Embeddings werden nicht im Jobstatus
|
||||
oder Git gespeichert. Die fertige WAV bleibt über die bisherigen Atelier-
|
||||
Ergebnisrouten abrufbar.
|
||||
- OmniVoice, VoxCPM und andere separate Modelle bleiben im exklusiven Pfad.
|
||||
|
||||
## Tatsächliche Prüfung
|
||||
|
||||
- Vollständige Suite: **784 Tests, OK**, 107,576 Sekunden.
|
||||
- Zusätzliche Shared-Tests führen einen echten persistenten Python-Unterprozess
|
||||
mit synthetischem WAV-Protokoll aus: Anna → Atelier → Anna hat denselben PID;
|
||||
kein zweiter Voice-Prozess, kein exklusiver Lease und kein Chat-Stop.
|
||||
- Geprüft: Auswahl ohne Kaltstart, Residency-Pin, automatische AudioPolicy ohne
|
||||
öffentliche TTS-Freigabe, Folge-Anna bei `per_request`, Referenzbereinigung,
|
||||
Cancel in der Queue und während Ausführung, Request-lokale Konditionierung,
|
||||
unverändertes Anna-Preset und Verwaltungs-/API-Auswahlberechtigungen.
|
||||
- Vollständiger isolierter `Server`-Konstruktor und tatsächliche Shared-Owner-
|
||||
Verdrahtung geprüft, ohne produktiven Zustand oder Modelle.
|
||||
- `node --check` für `voice-ui.js` und `deploy/stimmatelier/app.js`, sowie
|
||||
`git diff --check` für den Änderungsscope erfolgreich.
|
||||
- Beide tatsächlichen UIs in echtem Browser gegen Loopback-Fixture geprüft:
|
||||
Qwen bleibt auswählbar, GPU ist an den Shared-3060-Owner gebunden, OmniVoice
|
||||
bleibt separat. Nur Auswahl-Pin-POSTs, **keine** Modell-/Modus-/Unload-Aufrufe.
|
||||
Der temporäre Fixture-Server wurde danach beendet.
|
||||
- Pinned faster-qwen3-tts-API in der tatsächlich laufenden Container-Python-
|
||||
Umgebung nur introspektiert, nicht instanziiert oder modellgetestet. Der
|
||||
entsprechende Venv-Interpreter auf dem Host fand das Paket nicht, weil die
|
||||
Host-/Container-Interpreterauflösung nicht gleich ist; daraus wurde keine
|
||||
fehlende Runtime abgeleitet.
|
||||
|
||||
NAS-Testumgebung: eigene kurzlebige Venv unter
|
||||
`$TMPDIR/shared-qwen-tests`, Python 3.14, NumPy 2.5.4 und cryptography 50.0.2.
|
||||
Hermes-Python und produktive TTS-Umgebung wurden nicht uminstalliert. Die ersten
|
||||
Suite-Läufe scheiterten ausschließlich an fehlenden Testabhängigkeiten; der
|
||||
abschließende vollständige Lauf oben ist maßgeblich. Rohlog liegt im eigenen
|
||||
Scratch als `qwen-shared-verified.log`.
|
||||
|
||||
## Nativ, Update, Restore und Rückfall
|
||||
|
||||
Keine neuen Gewichte, Pakete, Dienste, Profilmigrationen oder Backup-Schlüssel.
|
||||
Das bestehende native TTS-Rezept mit festem Base-Modell und faster-qwen3-tts
|
||||
bleibt maßgeblich. Neue Funktionen befinden sich in den bereits installierten
|
||||
Deck-Modulen. Dienstbenutzer benötigt weiterhin Schreibrechte unter der
|
||||
konfigurierten Zustandswurzel und Zugriff auf die ausgewählte RTX 3060.
|
||||
|
||||
Beim genehmigten Update wurden die zusammengehörigen Module
|
||||
`audio_policy.py`, `inference.py`, `tts_test.py`, `tts_worker.py`,
|
||||
`voxcpm_test.py`, `server.py`, `voice-ui.js` gemeinsam eingespielt. Die optionale
|
||||
registrierte Stimmatelier-Oberfläche erhielt zusätzlich die neue
|
||||
`deploy/stimmatelier/app.js`; ihr vorhandener Installations-/Updateweg bleibt
|
||||
bestehen. Kein Docker-exec-spezifischer Worker ist Voraussetzung des nativen
|
||||
Produkts. Vorher exakte Live-/Imagequellen vergleichen, isolierten Start prüfen
|
||||
und vor Aktivierung regulär authentifiziert drainen. Der abgeschlossene
|
||||
Aktivierungsdatensatz liegt auf Athena unter
|
||||
`/opt/athena-deck-dev/shared-qwen-activation-v2/activation.json`. Nicht erneut
|
||||
prepare/apply ausführen. Die dortige Funktion `verify` ist eine reine
|
||||
Nachprüfung mit Aktualisierung des Auditstatus, kein weiterer Neustart.
|
||||
|
||||
Die Live-Oberfläche enthielt neuere Seed-VC-/Abbruchfunktionen als die im
|
||||
Deck-Image mitgelieferte Quellkopie. Diese wurden bytegenau übernommen und nur
|
||||
um Shared-Qwen ergänzt; vorhandene Funktionen wurden nicht zurückgestuft.
|
||||
Public-Asset-Transfer erfolgte direkt über SSH-stdout in Dateien, mit
|
||||
Quell-/Zielhashvergleich: gerenderte Toolausgaben können numerische Literale
|
||||
maskieren und sind deshalb keine zuverlässige Kopiervorlage. Der erste
|
||||
vorbereitete Kandidat wurde nie aktiviert; v2 wurde nach Node-Syntaxprüfung,
|
||||
isoliertem Image-Start und Browserprüfung aktiviert.
|
||||
|
||||
Docker ordnete beim UI-Neuanlegen die Env-Liste um. Die abschließende Prüfung
|
||||
vergleicht eindeutige Namen/Werte statt Listenreihenfolge; sämtliche Werte sind
|
||||
gleich. Alle anderen Sandbox-/Startparameter wurden exakt verglichen. Der
|
||||
kanonische UI-Tag bleibt für die vorhandene Backup-Rezeptvalidierung erhalten;
|
||||
vorheriges Image und alte Quellen sind gesichert. Die neue Helper-Bauvorlage
|
||||
enthält dasselbe app.js; kein Helperdienst wurde dafür neu gestartet.
|
||||
|
||||
Vor einem späteren Rückfall zuerst drainen und vorherige zusammengehörige
|
||||
App-/Atelier-Dateien wiederherstellen. Profile und private Stimmen bleiben
|
||||
unverändert. Nach Rückfall würde das alte Atelier wieder separat laden; deshalb
|
||||
nicht als weiterhin gemeinsam nutzbar darstellen.
|
||||
|
||||
Pin und laufende Jobs sind flüchtiger Prozesszustand, keine neue persistente
|
||||
Benutzereinstellung. Nach Restore werden bestehende Profile, AudioPolicy,
|
||||
private gespeicherte Stimmen und Nutzdaten wie bisher benötigt; Anna kann aus
|
||||
seiner vorhandenen Vorladepräferenz warm werden. Keine privaten Referenzen in
|
||||
Git übernehmen. Vollständiger nativer Fresh-Debian-/Restore-Ende-zu-Ende-Test
|
||||
bleibt offen.
|
||||
|
||||
Noch offen vor vollständiger Live-Abnahme: echte kurze GPU-Folge
|
||||
Anna → Atelier → Anna mit synthetischer Referenz, Worker-PID/VRAM-Vergleich,
|
||||
Annas tatsächliche Stimmenidentität und Clientwiedergabe. Basalt und die erste
|
||||
Anna-Ausgabe sind bereits real geprüft; eine synthetische Ryan-Referenz ist
|
||||
vorbereitet. Dateien und Ausgangs-PIDs liegen nur im eigenen Scratch unter
|
||||
`shared-qwen-acceptance/`. Nach regulärer erneuter Anmeldung `accept_gui.py`
|
||||
ausschließlich in browser_exec ausführen, anschließend Anna und PIDs prüfen.
|
||||
Keine zusätzliche API-Publikation und kein weiterer Neustart erforderlich.
|
||||
Mock-WAVs beweisen Orchestrierung, nicht Audioqualität oder CUDA-Spitzenbelegung.
|
||||
@@ -0,0 +1,31 @@
|
||||
"""Run ONLY inside browser_exec with an authenticated Deck browser session.
|
||||
|
||||
Uses normal same-origin atelier HTTP and a synthetic reference produced by
|
||||
restore.py. Never extracts a cookie, reads a password, publishes a profile,
|
||||
changes a mode or restarts/unloads a worker. No CLI execution environment.
|
||||
"""
|
||||
import base64,json,time
|
||||
from pathlib import Path
|
||||
OUT=Path('/opt/data/profiles/athena-deck/cache/scratch/shared-qwen-acceptance')
|
||||
probe=js("(async()=>{const r=await fetch('/api/v1/voice');return {http:r.status,type:r.headers.get('content-type')};})()")
|
||||
assert probe['http']==200 and 'application/json' in probe['type'],'Normal management login required; no test started'
|
||||
goto_url('http://192.168.1.212:8108/stimmatelier/');wait_for_load()
|
||||
selection=js("(async()=>{const r=await fetch('/api/v1/profiles');if(!r.ok)throw Error('Normal login required');const d=await r.json();const p=d.profiles.find(p=>p.kind==='voice'&&p.runnable&&p.model?.repo==='Qwen/Qwen3-TTS-12Hz-1.7B-Base');if(!p)throw Error('No runnable Qwen clone profile');const select=document.querySelector('#profile');select.value=p.id;select.dispatchEvent(new Event('change',{bubbles:true}));return {id:p.id,name:p.name};})()")
|
||||
encoded=base64.b64encode((OUT/'reference.wav').read_bytes()).decode()
|
||||
meta=json.loads((OUT/'restoration.json').read_text())
|
||||
request=dict(profile_id=selection['id'],text='Die gemeinsame Stimme wird im Atelier getestet.',device='3060',language='German',reference_text=meta['reference_text'])
|
||||
expression="(async()=>{const raw=atob("+json.dumps(encoded)+"),bytes=Uint8Array.from(raw,c=>c.charCodeAt(0));const data=new FormData();const fields="+json.dumps(request)+";for(const [k,v]of Object.entries(fields))data.set(k,v);data.set('file',new File([bytes],'synthetic-reference.wav',{type:'audio/wav'}));const r=await fetch('/api/v1/voice/start',{method:'POST',headers:{'X-Athena-Deck':'1'},body:data});const d=await r.json();if(!r.ok)throw Error(d.error||'Atelier request failed');return {id:d.id,state:d.state,profile_id:d.profile_id};})()"
|
||||
job=js(expression);print('Actual authenticated shared-Qwen job started:',job)
|
||||
deadline=time.monotonic()+180
|
||||
while time.monotonic()<deadline:
|
||||
state=js("(async()=>{const r=await fetch('/api/v1/voice');if(!r.ok)throw Error('Management session lost');const d=await r.json();return {job:d.job,shared:d.shared_tts,mode:d.mode};})()")
|
||||
current=state['job'];assert current and current['id']==job['id'],'Another voice job replaced the result; stop instead of accepting it'
|
||||
if current['state']!='running':break
|
||||
time.sleep(.3)
|
||||
else:raise RuntimeError('Bounded atelier check timed out; do not interrupt active work automatically')
|
||||
assert current['state']=='complete',current
|
||||
assert current.get('shared_tts') is True and state['shared']['loaded'] is True and state['mode']=='llm',state
|
||||
playback=js("(async()=>{const r=await fetch('/api/v1/voice/audio?id="+job['id']+"');if(!r.ok)throw Error('Output not available');const b=new Uint8Array(await r.arrayBuffer());const signature=String.fromCharCode(...b.slice(0,4));if(signature!=='RIFF')throw Error('Not WAV');const j="+json.dumps(current)+";await showResult('voice',j,selected());return {wav:true,bytes:b.length,playerReady:!!document.querySelector('#output').src,downloadReady:!!document.querySelector('#download').href};})()")
|
||||
result=dict(stage='actual shared atelier generation passed; final Anna/PID check pending',profile=selection,job=current,shared=state['shared'],mode=state['mode'],output=playback)
|
||||
p=OUT/'atelier.json';p.write_text(json.dumps(result,indent=2));assert json.loads(p.read_text())==result
|
||||
print(json.dumps(result))
|
||||
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Athena host: authorized shared-Qwen Deck + existing static atelier update."""
|
||||
import argparse,difflib,hashlib,importlib.util,json,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
ROOT=Path('/opt/athena-deck-dev/shared-qwen-activation-v2');BASE=Path('/opt/athena-deck-dev/runtime');STATE=BASE/'state';SOURCE=Path('/opt/athena-deck-dev/source');HELPER=Path('/opt/athena-deck-docker-helper/stimmatelier/app.js')
|
||||
IMAGE='athena-deck-standalone:shared-qwen';UI_STAGE='athena-stimmatelier:shared-qwen-candidate';UI_NAME='athena-stimmatelier'
|
||||
FILES=('audio_policy.py','inference.py','tts_test.py','tts_worker.py','voxcpm_test.py','server.py','voice-ui.js','deploy/stimmatelier/app.js','deploy/stimmatelier/index.html')
|
||||
SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json')
|
||||
HOST_KEYS=('NetworkMode','ReadonlyRootfs','CapDrop','CapAdd','SecurityOpt','PidsLimit','Memory','MemorySwap','NanoCpus','RestartPolicy','PortBindings','Mounts','LogConfig','Tmpfs')
|
||||
def info(name='athena-deck-dev'):return json.loads(subprocess.check_output(['docker','inspect',name],text=True))[0]
|
||||
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
def save(a):
|
||||
p=ROOT/'activation.json';p.write_text(json.dumps(a,indent=2));p.chmod(0o600);assert json.loads(p.read_text())==a
|
||||
|
||||
def image_hashes(name,files):
|
||||
code='from pathlib import Path;import hashlib,json;print(json.dumps({n:hashlib.sha256((Path("/app")/n).read_bytes()).hexdigest() for n in '+repr(tuple(files))+'}))'
|
||||
return json.loads(subprocess.check_output(['docker','exec',name,'python3','-B','-c',code],text=True))
|
||||
|
||||
def build(context,tag):
|
||||
with (context/'build.log').open('w') as f:subprocess.run(['docker','build','--network','none','--pull=false','-t',tag,context],check=True,stdout=f,stderr=subprocess.STDOUT,timeout=180)
|
||||
|
||||
def prepare():
|
||||
assert not (ROOT/'activation.json').exists()
|
||||
d=info();ui=info(UI_NAME)
|
||||
for x in (d,ui):assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',x['Config']['Image']],text=True).strip()==x['Image']
|
||||
h=ui['HostConfig'];assert h['NetworkMode']=='none' and h['ReadonlyRootfs'] and h['CapDrop']==['ALL'] and not h.get('CapAdd') and not h.get('DeviceRequests') and not h.get('Devices') and not h.get('Privileged')
|
||||
assert h.get('Mounts')==[dict(Type='bind',Source=str(STATE/'stimmatelier-ui'),Target='/data')]
|
||||
assert ui['Config']['User']=='65534:65534' and ui['Config']['Entrypoint']==['python3','/app/app.py'] and not ui['Config']['Cmd']
|
||||
before={n:sha(SOURCE/n) for n in FILES};after={n:sha(ROOT/'app'/n) for n in FILES}
|
||||
assert image_hashes('athena-deck-dev',FILES)==before
|
||||
ui_hashes=image_hashes(UI_NAME,['app.js','index.html'])
|
||||
assert sha(HELPER)==ui_hashes['app.js'] and sha(HELPER.parent/'index.html')==ui_hashes['index.html']
|
||||
assert after['deploy/stimmatelier/index.html']==ui_hashes['index.html'],'Preserve the actual live atelier markup'
|
||||
diff=[]
|
||||
for n in FILES:
|
||||
p=ROOT/'before'/n;p.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(SOURCE/n,p)
|
||||
(ROOT/'app'/n).chmod(0o644)
|
||||
diff.extend(difflib.unified_diff((SOURCE/n).read_text().splitlines(True),(ROOT/'app'/n).read_text().splitlines(True),fromfile=n+' (live)',tofile=n+' (candidate)'))
|
||||
(ROOT/'candidate.diff').write_text(''.join(diff));shutil.copy2(HELPER,ROOT/'helper-app.before.js')
|
||||
(ROOT/'Dockerfile').write_text('FROM '+d['Config']['Image']+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n')
|
||||
(ROOT/'.dockerignore').write_text('*\n!Dockerfile\n!app/\n!app/**\n')
|
||||
build(ROOT,IMAGE)
|
||||
probe="from pathlib import Path;import tempfile;from server import Server;from stt import qwen_asr_request;t=tempfile.TemporaryDirectory();s=Server(0,state_dir=Path(t.name));assert s.voxcpm_tests.shared_tts is s.tts_tests;assert s.tts_tests.acquire==s.scheduler.tts_reservation;assert '<asr_text>' in qwen_asr_request(b'fixture','de')['messages'][-1]['content'];s.endpoint.close();s.video.close();s.dashboard.close();s.server_close();t.cleanup();print('Shared Qwen image: full isolated constructor and preserved ASR passed')"
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(STATE/'basalt-runtime/tmp')+',dst=/test-tmp','--entrypoint','python3',IMAGE,'-B','-c',probe],check=True,timeout=45)
|
||||
u=ROOT/'ui';u.mkdir();shutil.copy2(ROOT/'app/deploy/stimmatelier/app.js',u/'app.js')
|
||||
(u/'Dockerfile').write_text('FROM '+ui['Config']['Image']+'\nUSER root\nCOPY app.js /app/app.js\nUSER 65534:65534\n');build(u,UI_STAGE)
|
||||
subprocess.run(['docker','run','--rm','--network','none','--read-only','--entrypoint','python3',UI_STAGE,'-B','-c',"import ast;from pathlib import Path;ast.parse(Path('/app/app.py').read_text());assert 'voice/select' in Path('/app/app.js').read_text();print('Static atelier candidate checked')"],check=True,timeout=20)
|
||||
assert info()['State']['StartedAt']==d['State']['StartedAt'] and info(UI_NAME)['Id']==ui['Id']
|
||||
image_id=subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',IMAGE],text=True).strip();ui_image_id=subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',UI_STAGE],text=True).strip()
|
||||
save(dict(phase='prepared',image_before=d['Config']['Image'],image_id_before=d['Image'],image_id_after=image_id,ui_image_id_after=ui_image_id,started_before=d['State']['StartedAt'],source_before=before,source_after=after,config=json.loads((BASE/'installation.json').read_text()),settings={n:(STATE/n).read_text() for n in SETTINGS},ui_before=ui,ui_before_hashes=ui_hashes))
|
||||
print('Both images prepared; protected live processes unchanged',flush=True)
|
||||
|
||||
def launch_ui(a):
|
||||
old=a['ui_before'];h=old['HostConfig'];c=old['Config']
|
||||
args=['docker','run','-d','--name',UI_NAME,'--network','none','--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true','--restart',h['RestartPolicy']['Name'],'--pids-limit',str(h['PidsLimit']),'--memory',str(h['Memory']),'--memory-swap',str(h['MemorySwap']),'--cpus',str(h['NanoCpus']/1e9),'--user',c['User'],'--workdir',c['WorkingDir'],'--hostname',c['Hostname'],'--mount','type=bind,src='+str(STATE/'stimmatelier-ui')+',dst=/data']
|
||||
if h.get('LogConfig',{}).get('Type'):
|
||||
args+=['--log-driver',h['LogConfig']['Type']]
|
||||
for k,v in h['LogConfig'].get('Config',{}).items():args+=['--log-opt',k+'='+v]
|
||||
for k,v in c.get('Labels',{}).items():args+=['--label',k+'='+v]
|
||||
for v in c.get('Env',[]):args+=['-e',v]
|
||||
args += [c['Image']] # The overlay inherits the complete original entrypoint/Cmd.
|
||||
subprocess.run(args,check=True,stdout=subprocess.DEVNULL)
|
||||
|
||||
def apply():
|
||||
a=json.loads((ROOT/'activation.json').read_text());assert a['phase']=='prepared'
|
||||
d=json.loads((ROOT/'drained.json').read_text());assert 0<=time.time()-d['checked_at']<60 and d['state']=='stopped' and type(d['active_requests']) is int and d['active_requests']==0
|
||||
assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests','stt_waiting_requests')) and d['scheduler']['switching'] is False
|
||||
assert info()['Image']==a['image_id_before'] and info(UI_NAME)['Id']==a['ui_before']['Id']
|
||||
assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',IMAGE],text=True).strip()==a['image_id_after']
|
||||
assert subprocess.check_output(['docker','image','inspect','--format','{{.Id}}',UI_STAGE],text=True).strip()==a['ui_image_id_after']
|
||||
assert all(sha(SOURCE/n)==a['source_before'][n] for n in FILES) and sha(HELPER)==a['ui_before_hashes']['app.js']
|
||||
assert all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS if n!='endpoint.json')
|
||||
subprocess.run(['docker','stop','--timeout','45','athena-deck-dev'],check=True)
|
||||
assert not subprocess.check_output(['nvidia-smi','--query-compute-apps=pid','--format=csv,noheader,nounits'],text=True).strip()
|
||||
for n in FILES:shutil.copy2(ROOT/'app'/n,SOURCE/n)
|
||||
(STATE/'endpoint.json').write_text(a['settings']['endpoint.json'])
|
||||
subprocess.run(['docker','rm','athena-deck-dev'],check=True)
|
||||
spec=importlib.util.spec_from_file_location('deck_install',SOURCE/'deploy/install.py');assert spec and spec.loader;module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module)
|
||||
config=dict(a['config'],image=IMAGE,previous_image=a['image_before']);module.launch(config);module.ready(config)
|
||||
deadline=time.monotonic()+90
|
||||
while info()['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()<deadline:time.sleep(1)
|
||||
assert info()['State']['Health']['Status']=='healthy';module.write_manifest(BASE,config)
|
||||
# Keep the registered canonical UI tag so existing backup validation remains valid.
|
||||
subprocess.run(['docker','tag',a['ui_before']['Image'],'athena-stimmatelier:before-shared-qwen'],check=True)
|
||||
subprocess.run(['docker','tag',UI_STAGE,a['ui_before']['Config']['Image']],check=True)
|
||||
subprocess.run(['docker','stop','--timeout','15',UI_NAME],check=True);subprocess.run(['docker','rm',UI_NAME],check=True);launch_ui(a)
|
||||
shutil.copy2(ROOT/'app/deploy/stimmatelier/app.js',HELPER)
|
||||
deadline=time.monotonic()+90
|
||||
while info(UI_NAME)['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()<deadline:time.sleep(1)
|
||||
verify()
|
||||
|
||||
def verify():
|
||||
a=json.loads((ROOT/'activation.json').read_text())
|
||||
assert info()['Image']==a['image_id_after'] and info()['State']['Health']['Status']=='healthy'
|
||||
actual=info(UI_NAME);assert actual['State']['Health']['Status']=='healthy'
|
||||
assert actual['Image']==a['ui_image_id_after']
|
||||
for k in HOST_KEYS:assert actual['HostConfig'].get(k)==a['ui_before']['HostConfig'].get(k),k
|
||||
old_env=a['ui_before']['Config']['Env'];new_env=actual['Config']['Env']
|
||||
pairs=lambda rows:dict(v.split('=',1) for v in rows)
|
||||
assert len(pairs(old_env))==len(old_env) and len(pairs(new_env))==len(new_env) and pairs(old_env)==pairs(new_env),'Environment values changed'
|
||||
for k in ('Labels','User','WorkingDir','Entrypoint','Cmd','Hostname'):assert actual['Config'].get(k)==a['ui_before']['Config'].get(k),k
|
||||
assert image_hashes('athena-deck-dev',FILES)==a['source_after'] and image_hashes(UI_NAME,['app.js'])['app.js']==a['source_after']['deploy/stimmatelier/app.js']
|
||||
assert sha(HELPER)==a['source_after']['deploy/stimmatelier/app.js'] and all((STATE/n).read_text()==a['settings'][n] for n in SETTINGS)
|
||||
a.update(phase='activated; shared GPU acceptance pending',activated_at=time.time());save(a)
|
||||
print('Deck and atelier activated healthy; source/image/helper hashes, UI sandbox and all protected settings verified',flush=True)
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('operation',choices=('prepare','apply','verify'));p.add_argument('--go',action='store_true');args=p.parse_args();assert args.go,'Retained explicit Michael activation Go required'
|
||||
{'prepare':prepare,'apply':apply,'verify':verify}[args.operation]()
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS: copy only two public live UI assets byte-exactly for a safe merge.
|
||||
|
||||
Never handles credentials, recordings or model data. Avoid copying rendered
|
||||
terminal text: numeric literals can be masked by tool-output redaction.
|
||||
"""
|
||||
import hashlib,json,shlex,subprocess,os
|
||||
from pathlib import Path
|
||||
root=Path(os.environ['TMPDIR'])/'shared-qwen-live-ui';root.mkdir(exist_ok=True)
|
||||
code="import sys;from pathlib import Path;sys.stdout.buffer.write((Path('/app')/sys.argv[1]).read_bytes())"
|
||||
for name in ('app.js','index.html'):
|
||||
command='docker exec athena-stimmatelier python3 -B -c '+shlex.quote(code)+' '+shlex.quote(name)
|
||||
raw=subprocess.check_output(['athena-ssh',command],timeout=20)
|
||||
(root/name).write_bytes(raw)
|
||||
expected=subprocess.check_output(['athena-ssh','docker exec athena-stimmatelier python3 -B -c '+shlex.quote("from pathlib import Path;import hashlib;print(hashlib.sha256((Path('/app')/"+repr(name)+").read_bytes()).hexdigest())")],text=True,timeout=20).strip()
|
||||
assert hashlib.sha256((root/name).read_bytes()).hexdigest()==expected
|
||||
print(json.dumps({'byte_exact_live_assets_verified':True,'directory':str(root)}))
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS-side scoped source transport over the supplied Athena SSH helper.
|
||||
|
||||
Payload goes over stdin, not a giant shell argument. No keys are read or logged.
|
||||
"""
|
||||
import base64,hashlib,json,shlex,subprocess
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parents[3]
|
||||
FILES=('audio_policy.py','inference.py','tts_test.py','tts_worker.py','voxcpm_test.py','server.py','voice-ui.js','deploy/stimmatelier/app.js','deploy/stimmatelier/index.html')
|
||||
paths={'activate.py':ROOT/'docs/maintenance/shared-qwen/activate.py',**{'app/'+n:ROOT/n for n in FILES}}
|
||||
subprocess.run(['node','--check',str(ROOT/'voice-ui.js')],check=True)
|
||||
subprocess.run(['node','--check',str(ROOT/'deploy/stimmatelier/app.js')],check=True)
|
||||
payload={}
|
||||
for name,path in paths.items():
|
||||
data=path.read_bytes();payload[name]={'data':base64.b64encode(data).decode(),'sha256':hashlib.sha256(data).hexdigest()}
|
||||
remote="""import sys,json,base64,hashlib
|
||||
from pathlib import Path
|
||||
r=Path('/opt/athena-deck-dev/shared-qwen-activation-v2')
|
||||
assert not (r/'activation.json').exists()
|
||||
r.mkdir(mode=0o700,exist_ok=True)
|
||||
for name,value in json.load(sys.stdin).items():
|
||||
assert not Path(name).is_absolute() and '..' not in Path(name).parts
|
||||
p=r/name;p.parent.mkdir(parents=True,exist_ok=True);p.write_bytes(base64.b64decode(value['data']));p.chmod(0o644)
|
||||
assert hashlib.sha256(p.read_bytes()).hexdigest()==value['sha256']
|
||||
print('Allowlisted shared-Qwen source transfer verified')
|
||||
"""
|
||||
subprocess.run(['athena-ssh','python3 -B -c '+shlex.quote(remote)],input=json.dumps(payload).encode(),check=True,timeout=60)
|
||||
subprocess.run(['athena-ssh','python3 -B /opt/athena-deck-dev/shared-qwen-activation-v2/activate.py prepare --go'],check=True,timeout=240)
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS-only loopback UI fixture. No production API, models or credentials."""
|
||||
import argparse,json
|
||||
from http.server import BaseHTTPRequestHandler,ThreadingHTTPServer
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parents[3]
|
||||
rows=[dict(id='clone',name='Qwen1.7B Stimmklonen',kind='voice',runnable=True,model={'repo':'Qwen/Qwen3-TTS-12Hz-1.7B-Base'}),dict(id='omni',name='OmniVoice Studio',kind='voice',runnable=True,model={'repo':'k2-fsa/OmniVoice'}),dict(id='cpu',name='Qwen CPU',kind='audio',runnable=True,model={'repo':'Serveurperso/Qwen3-TTS-GGUF'}),dict(id='stt',name='Synthetic STT',kind='stt',runnable=True,model={'repo':'test/stt'})]
|
||||
rows.append(dict(id='seed',name='Existing Seed-VC',kind='voice',runnable=True,model={'repo':'Plachta/Seed-VC'}))
|
||||
requests=[]
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
def log_message(self,*args):pass
|
||||
def send(self,data,mime='application/json',status=200):
|
||||
if not isinstance(data,bytes):data=json.dumps(data).encode()
|
||||
self.send_response(status);self.send_header('Content-Type',mime);self.send_header('Content-Length',str(len(data)));self.end_headers();self.wfile.write(data)
|
||||
def do_POST(self):
|
||||
requests.append(['POST',self.path])
|
||||
if self.path=='/api/v1/voice/select':return self.send({'shared_tts':True,'loaded':True})
|
||||
self.send({'error':'Writes forbidden in isolated fixture'},status=405)
|
||||
def do_GET(self):
|
||||
requests.append(['GET',self.path])
|
||||
if self.path=='/api/v1/profiles':return self.send({'profiles':rows})
|
||||
if self.path=='/api/v1/audio-policy':return self.send({'settings':{'stt':{'profile_id':'stt'}}})
|
||||
if self.path=='/api/v1/voice':return self.send({'mode':'llm','job':None,'shared_tts':{'loaded':True,'gpu_uuid':'synthetic','warming':False,'profile_id':'anna'}})
|
||||
if self.path=='/audit':return self.send({'requests':requests})
|
||||
if self.path=='/voice':return self.send(b'<!doctype html><html><meta charset="utf-8"><title>Isolated shared Qwen UI</title><body><main></main><script>window.DeckLinks={url:(p,s)=>s};</script><script src="/voice-ui.js"></script><script>document.querySelector("main").innerHTML=VoiceUI.html();VoiceUI.bind();</script></body></html>','text/html')
|
||||
files={'/voice-ui.js':ROOT/'voice-ui.js','/atelier/':ROOT/'deploy/stimmatelier/index.html','/atelier/app.js':ROOT/'deploy/stimmatelier/app.js','/atelier/style.css':ROOT/'deploy/stimmatelier/style.css'}
|
||||
if self.path in files:
|
||||
path=files[self.path];return self.send(path.read_bytes(),'text/html' if path.suffix=='.html' else 'text/css' if path.suffix=='.css' else 'application/javascript')
|
||||
self.send({'error':'not found'},status=404)
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser();p.add_argument('--port',type=int,default=18764);args=p.parse_args();server=ThreadingHTTPServer(('127.0.0.1',args.port),Handler);print('Isolated UI fixture ready',flush=True)
|
||||
try:server.serve_forever()
|
||||
finally:server.server_close()
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python3
|
||||
"""NAS: bounded model restoration and synthetic shared-Qwen GUI references.
|
||||
No management bypass or profile-publication change. Credentials stay in memory.
|
||||
"""
|
||||
import importlib.util,io,json,os,subprocess,time,urllib.request,wave
|
||||
from pathlib import Path
|
||||
HERE=Path(__file__).resolve().parent
|
||||
spec=importlib.util.spec_from_file_location('managed_transport',HERE.parent/'basalt-candidate-2026-11-01/paired_transport.py');assert spec and spec.loader
|
||||
transport=importlib.util.module_from_spec(spec);spec.loader.exec_module(transport)
|
||||
KEY=transport.key();START=time.monotonic();BASE='http://192.168.1.212:8120';OUT=Path(os.environ['TMPDIR'])/'shared-qwen-acceptance';OUT.mkdir(mode=0o700,exist_ok=True)
|
||||
def call(path,data,binary=False):
|
||||
assert time.monotonic()-START<900,'Bounded acceptance window exceeded'
|
||||
req=urllib.request.Request(BASE+path,data=json.dumps(data).encode(),headers={'Authorization':'Bearer '+KEY,'Content-Type':'application/json'})
|
||||
with urllib.request.urlopen(req,timeout=180) as r:return r.read() if binary else json.load(r)
|
||||
def speech(name,voice,text):
|
||||
data=call('/v1/audio/speech',dict(model='qwen-anna-gpu-3060',voice=voice,input=text,response_format='wav'),True)
|
||||
with wave.open(io.BytesIO(data)) as w:meta=dict(rate=w.getframerate(),channels=w.getnchannels(),seconds=w.getnframes()/w.getframerate())
|
||||
assert meta['rate']==24000 and meta['channels']==1 and meta['seconds']>0
|
||||
p=OUT/name;p.write_bytes(data);p.chmod(0o600);return meta
|
||||
|
||||
def gpu_snapshot():
|
||||
raw=subprocess.check_output(['athena-ssh','nvidia-smi --query-compute-apps=gpu_uuid,pid,process_name,used_gpu_memory --format=csv,noheader,nounits'],text=True,timeout=15)
|
||||
result=[]
|
||||
for line in raw.splitlines():
|
||||
gpu,pid,path,mib=[s.strip() for s in line.split(',')]
|
||||
role='tts' if '/tts-runtime/' in path else 'vision' if path.endswith('basalt-vision') else 'chat' if path.endswith('/basalt') else 'stt' if path.endswith('llama-server') else 'other'
|
||||
result.append(dict(gpu=gpu,pid=int(pid),role=role,mib=int(mib)))
|
||||
return result
|
||||
|
||||
def main():
|
||||
result={}
|
||||
response=call('/v1/chat/completions',dict(model='flash-next-basalt',messages=[dict(role='user',content='Antworte nur mit BEREIT.')],temperature=0,max_tokens=16,chat_template_kwargs={'enable_thinking':False}))
|
||||
assert 'BEREIT' in (response['choices'][0]['message'].get('content') or '').upper();result['basalt_restored']=True;print('Basalt restored and actual answer verified',flush=True)
|
||||
result['anna_before']=speech('anna-before.wav','default','Die gemeinsame Stimme wird im Atelier getestet.');print('Anna speech API passed',flush=True)
|
||||
result['reference_text']='Dies ist eine synthetische Referenz für den Stimmtest.'
|
||||
result['reference']=speech('reference.wav','Ryan',result['reference_text']);print('Synthetic Ryan reference prepared; no default voice changed',flush=True)
|
||||
result['gpu_before_clone']=gpu_snapshot();assert len([r for r in result['gpu_before_clone'] if r['role']=='tts'])==1
|
||||
result.update(stage='models restored; authenticated atelier acceptance pending',seconds=time.monotonic()-START)
|
||||
p=OUT/'restoration.json';p.write_text(json.dumps(result,indent=2));assert json.loads(p.read_text())==result
|
||||
print(json.dumps(result),flush=True)
|
||||
if __name__=='__main__':main()
|
||||
@@ -0,0 +1,102 @@
|
||||
# Strata 0.1.55: neue Linux-Optimierungen an/aus
|
||||
|
||||
## Ergebnis und Betriebszustand
|
||||
|
||||
**Ursprünglicher Betrieb wiederhergestellt und geprüft.** Qwen, TTS und STT sind
|
||||
geladen, Deck gesund. Produktionscontainer und Startzeit, Profil-/Endpunkt-/Audio-/
|
||||
CPU-/Reasoning-Hashes sowie die vollständige freigegebene Worker-Konfiguration
|
||||
sind unverändert. Keine Testcontainer mehr vorhanden, keine neue Einstellung
|
||||
produktiv übernommen. Die bisherigen neuen Linux-Defaults bleiben aktiv.
|
||||
|
||||
Die vollständige geplante A–B–B–A-Reihenfolge ist **nicht abgeschlossen**:
|
||||
A, B und B lieferten je neun vollständige synthetische Antworten. Während der
|
||||
Wiederholung lief der Vordergrund-Werkzeugaufruf trotz angeforderter längerer
|
||||
Laufzeit nach 420 Sekunden aus. Der Docker-Client endete mit SIGPIPE (-13), der
|
||||
isolierte Container lief zunächst weiter. Nach Zustandsprüfung ausschließlich
|
||||
den verifizierten eigenen Container gestoppt, seine Entfernung und freie GPUs
|
||||
nachgelesen, anschließend den regulären Endpunkt über die angemeldete GUI
|
||||
wieder gestartet. Eine kleine echte Anfrage lud und prüfte das Originalprofil.
|
||||
**Kein Neustart der Testserie, keine zusätzlichen Tuningvarianten.**
|
||||
|
||||
Gesamtes Modell-/Wartungsfenster einschließlich Wiederherstellung:
|
||||
**663,355 Sekunden**, innerhalb des zugesagten 900-Sekunden-Limits. Die
|
||||
abgebrochene vierte Referenz verhindert eine vollständige Kontrolle von Drift
|
||||
und Reihenfolgeeffekten; die Zahlen sind eine begrenzte Orientierung, kein
|
||||
statistisch abgesicherter Nachweis kleiner Unterschiede.
|
||||
|
||||
## Vergleich
|
||||
|
||||
Beide Varianten nutzen denselben festen Quellcommit
|
||||
`c62d5e3a15b40ea51c96aae9e8d36928965f53ab`, Engine **0.1.55**, IQ3_XXS,
|
||||
3060 → 5080, Split 16, zwei Slots à 262144 Tokens, Gruppen `auto`, Batch-MTP aus,
|
||||
Solo-MTP an, dieselben Reserven und dieselbe CPU-/Vision-Konfiguration.
|
||||
|
||||
- **A:** elf neue Linux-Schalter nicht explizit gesetzt; echte Anbieterdefaults.
|
||||
- **B:** dieselben elf Schalter explizit auf `0`.
|
||||
- Die tatsächlichen Werte wurden aus der Umgebung des jeweils verifizierten
|
||||
eigenen Engine-Kindprozesses gelesen und mit der erwarteten Variante verglichen.
|
||||
- Das unveränderte gelernte Expertenprofil und Runtime-/Modellpfade waren read-only.
|
||||
- Zwei GPUs in einem isolierten kurzlebigen Container, ohne Netzwerk und externe
|
||||
Ports, UID/GID 65534, 59 GiB RAM ohne zusätzlichen Swap, gleiche CPU-Zuordnung.
|
||||
- Gemessene Expertenallokation gleich: 5655/4917 GPU-Cache-Slots,
|
||||
30,76 GiB residente Experten im RAM. Keine stillen Budget-/Splitänderungen.
|
||||
|
||||
| Lastfall | A: Defaults an, ein Block | B: aus, zwei Blöcke; Median | Einordnung |
|
||||
|---|---:|---:|---|
|
||||
| Solo, 512 Ausgabetokens, Backend-Decode | 61,5 Token/s | 61,45 Token/s | Praktisch gleich |
|
||||
| Parallel, 2 × 512 Ausgabetokens, gemeinsame Gesamtzeit | 12,8005 s | 13,1114 s | Aus benötigt 2,43 % mehr Zeit |
|
||||
| Derselbe parallele Durchsatz, Ende-zu-Ende | 80,00 Token/s | 78,10 Token/s | Aus liefert 2,37 % weniger |
|
||||
| Zwei frische Dokumente, gemeinsame Gesamtzeit | 13,1723 s | 13,4300 s | Aus benötigt 1,96 % mehr Zeit |
|
||||
| Zwei gecachte Folgeturns mit je 512 Ausgabetokens | 11,1598 s | 11,4394 s | Aus benötigt 2,51 % mehr Zeit |
|
||||
| Frisches Dokument mit 30041 Eingabetokens, Prefill | 1779,6 Token/s | 1773,4 Token/s | Praktisch gleich |
|
||||
|
||||
In allen abgeschlossenen Blöcken: vollständige Streams, getrennte Suchmarken,
|
||||
Cache-Wiederverwendung, beide Marken im langen Dokument und exaktes JSON
|
||||
bestanden. Das ist keine breite Qualitätsprüfung oder Langzeitabnahme.
|
||||
Die niedrigeren absoluten Solozahlen gegenüber der vorherigen Kurzabnahme sind
|
||||
kein weiterer Versionsvergleich: hier lief ein frischer isolierter Testprozess,
|
||||
nicht dieselbe damalige API-Messung. A gegen B innerhalb dieses Laufs ist die
|
||||
maßgebliche Gegenüberstellung.
|
||||
|
||||
**Empfehlung:** Linux-Defaults beibehalten. Kein Hinweis, dass Abschalten auf
|
||||
Athena schneller wäre. Der kleine Parallelvorteil ist wegen des unvollständigen
|
||||
Wiederholungsschemas nicht als allgemein bewiesener Gewinn zu vermarkten.
|
||||
|
||||
## Zusätzlicher beobachteter Befund, noch kein Folgeauftrag
|
||||
|
||||
Bei der langen 30K-Anfrage meldet die Engine in beiden Varianten:
|
||||
|
||||
> layer-major off for this prompt: no VRAM for a super-chunk (891 MiB free)
|
||||
|
||||
Der schnellere Layer-major-Prefillpfad ist grundsätzlich aktiviert, fällt aber
|
||||
bei dieser Anfrage wegen des tatsächlichen VRAM-Spielraums zurück. Das ist ein
|
||||
konkreter Ansatz für eine spätere, gesondert freigegebene Untersuchung von
|
||||
Cache-/Prefill-Speicherbudgets, kein Beweis für einen bestimmten Speedgewinn.
|
||||
Reserven, Cachegrößen oder Kontextlimits wurden dafür **nicht geändert**.
|
||||
|
||||
## Nachweise und Ausführungsumgebungen
|
||||
|
||||
- [Sanitisierte Rohmessungen aller Blöcke einschließlich Teilversuch](evidence/results.json).
|
||||
- [Programmgesteuerte Zusammenfassung und Differenzen](evidence/summary.json).
|
||||
- [Historischer Host-/Client-Abbruchbefund](evidence/host.json).
|
||||
- [Tatsächlicher Wiederherstellungsnachweis](evidence/restoration.json).
|
||||
- Private vollständige eigene Testlogs und Antworten auf Athena unter
|
||||
`/opt/athena-deck-dev/runtime/state/strata-linux-ab-20261101/`.
|
||||
- `experiment.py`: `prepare`/`run` auf dem Athena-Host, `worker` im eigenen
|
||||
Testcontainer; Hostskript unter `/opt/athena-deck-dev/strata-linux-ab-20261101/`.
|
||||
- `restore.py`: Athena-Host, genau eine autorisierte Wiederherstellungsanfrage;
|
||||
API-Identität nur im Speicher über den vorhandenen profilbezogenen SSH-Transport.
|
||||
- `test_experiment.py`: NAS, ausschließlich Offline-/Mock-Tests, keine Verbindung
|
||||
zu Athena. Vor dem Modelllauf vier Tests bestanden. Nach dem beobachteten
|
||||
Client-Abbruch wurde Cleanup auch bei beendetem Docker-Client in `finally`
|
||||
ergänzt; dessen Mock-Tests ersetzen keinen erneuten Modelltest. Die gespeicherten
|
||||
Messungen stammen vom Lauf vor dieser nachträglichen Controllerkorrektur.
|
||||
Danach bestanden alle sechs Offline-/Mock-Tests; keine zusätzliche Inferenz.
|
||||
|
||||
Dieses Experiment installiert keine neue Laufzeit, Dienste oder Abhängigkeiten
|
||||
und ändert keine nativen Restore-Pins oder privaten Profile. Die bereits
|
||||
gepinnten nativen Strata-/CUDA-/Modellrezepte bleiben maßgeblich; keine
|
||||
Docker-Voraussetzung für das native Produkt aus dem Testtransport ableiten.
|
||||
Ein vollständiger frischer Debian-/verschlüsselter Ende-zu-Ende-Restore ist
|
||||
weiterhin eine getrennte offene Abnahme. Jede weitere Inferenz, Umschaltung
|
||||
oder Aktivierung benötigt einen neuen konkreten Auftrag.
|
||||
Loaded 100 of 172 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user