Fix: KV-Schaetzung kalibriert + Brain-Fit-Check brain-spezifisch
- fit.estimate_memory_gb: KV-Cache jetzt sqrt-skaliert (nicht linear mit Gesamt-Params),
kalibriert an Hermes-14B@128K ~19GB KV -> realistische Footprints (vorher massive Ueberschaetzung).
- agent.hermes_brain_info Budget: prueft jetzt Brain (immer resident) + groesstes on-demand-Modell
<= GTT-Budget (fast/vision duerfen verdraengt werden) -> brain-spezifische, aussagekraeftige Warnung.
- Cockpit: Budget-Zeile + Confirm-Warnung entsprechend ("Brain ~X GB + groesstes on-demand ~Y GB").
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -15,10 +15,13 @@ QUANT_BYTES_PER_PARAM = {
|
||||
|
||||
|
||||
def estimate_memory_gb(params_b: float, quant: str, ctx: int) -> float:
|
||||
"""Geschätzter Speicherbedarf in GB (Gewichte + Kontext-KV)."""
|
||||
"""Geschätzter Speicherbedarf in GB (Gewichte + Kontext-KV).
|
||||
KV-Cache skaliert NICHT linear mit den Gesamt-Parametern (er hängt an
|
||||
Layern × KV-Heads, gedämpft durch GQA) → sqrt-Skalierung, kalibriert am
|
||||
gemessenen Punkt Hermes-4-14B @ 128K ≈ 19 GB KV."""
|
||||
bpp = QUANT_BYTES_PER_PARAM.get(quant.upper(), 0.65)
|
||||
weights = params_b * bpp
|
||||
context_vram = (ctx / 8192) * (max(params_b, 7) / 7) * 0.8
|
||||
context_vram = (ctx / 8192) * (max(params_b, 7) / 7) ** 0.5 * 0.84
|
||||
return weights + context_vram
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user