• Stefy Lanza (nextime / spora )'s avatar
    longcat: the INT8 build must not take the host down (v0.2.65) · 2564719c
    Stefy Lanza (nextime / spora ) authored
    Run against the real weights for the first time, it exhausted all 54 GB of RAM
    and all 4 GB of swap. MemAvailable reached 0 and I killed it to keep the server
    alive — the production container was two minutes from being the thing the OOM
    killer chose.
    
    It had loaded all six fp32 shards (13m42s) and reached "quantising every Linear to
    INT8". The peak is not the bf16 model alone: the INT8 copies are built while the
    originals are still referenced, and save_quantized_state_dict then materialises a
    full state dict on top. Roughly 2x bf16, not 1x.
    
    Three changes:
    
    - It now REFUSES when the host cannot take it, with the numbers: "~42 GB needed,
      34 GB available". Estimated from the shards on disk (fp32, so bf16 is half)
      times 1.5, plus 4 GB for the interpreter and torch. min_free_gb overrides it for
      someone who knows better. A job that can kill the server should not be reachable
      from a button without this.
    - The load streams through a meta-device skeleton (low_cpu_mem_usage=True) instead
      of building a second full copy while loading.
    - gc.collect() between the phases, and the model is dropped before the save
      returns — the replaced bf16 weights are ~13 GB of garbage at exactly the moment
      the save wants to allocate.
    
    What this means on THIS host, honestly: 42 GB needed against 54 GB total with the
    server using ~20 GB. It will now refuse rather than try. Quantising here needs the
    server stopped, or a lower-peak implementation that never materialises the whole
    model (quantise shard by shard, write as it goes) — which is the real fix and is
    not in this commit.
    
    22 tests.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_0182DhR1eFNPQyGmDrpHbedY
    2564719c
Name
Last commit
Last update
..
assets Loading commit data...
audiocraft_service.py Loading commit data...
canary_service.py Loading commit data...
character_studio.py Loading commit data...
crisperwhisper_service.py Loading commit data...
docker_leak_audit.py Loading commit data...
gen_township_fighters.py Loading commit data...
h3_common.py Loading commit data...
h3_service.py Loading commit data...
longcat_common.py Loading commit data...
longcat_quantize.py Loading commit data...
longcat_service.py Loading commit data...
longcat_train.py Loading commit data...
lora_train_worker.py Loading commit data...
manual_multimodal_test_client.py Loading commit data...
melotts_service.py Loading commit data...
mux_service.py Loading commit data...
parler_tts_service.py Loading commit data...
pyannote_service.py Loading commit data...
review_outputs.py Loading commit data...
runpod_model_test.py Loading commit data...
video_dubber.py Loading commit data...
video_editor.py Loading commit data...
videogen.py Loading commit data...
xtts_service.py Loading commit data...