a load's own VRAM reservation must not be charged against it
An eviction freed 16.3 GB and the load that triggered it saw 0.0 GB.
23:58:05 Loading 'image:…pornmaster…': need 30.9 GB VRAM, have 2.9 GB free
— evicting models to make room
23:58:05 unloading active model 'FLUX.2-klein-4B' (measured 17.24 GB)
23:59:23 ⚠ Eviction freed 13.4 GB (now 16.3 GB free, needed 30.9 GB)
23:59:25 needs ~32.9 GB host RAM (30.9 GB footprint against 0.0 GB free
VRAM spills 30.9 GB to the host, plus 2.0 GB to stage it), and
only 27.8 GB is available — short by 5.1 GB. Refusing the load.
Two seconds after eviction reported 16.3 GB free, admission read 0.0, and no
other load intervened — the next one starts a second later. `_get_free_vram_gb`
subtracted every in-flight reservation, including the one belonging to the load
being judged: `max(0, 16.3 - 30.9)`.
A reservation exists so OTHER loads do not count VRAM already spoken for.
Subtracted from the reserving load's own view it says the room it just reserved
does not exist, so the whole footprint looks like a host spill, the host-RAM
budget refuses it, and the eviction that preceded it cost another model its
residency and bought nothing. That is where 17.24 GB of resident FLUX pipeline
went, twice over, in the hour that ended in the first OOM kill.
`exclude_key` leaves one model's own reservation out of the subtraction, and the
admission path passes its own key. Every other caller — eviction, sizing,
placement — keeps the conservative figure, which is correct for them: they are
deciding on behalf of a load that has not reserved anything yet.
Verified by reproducing the arithmetic: with the old view the need is 32.9 GB
and the shortfall 5.1 GB, matching the server's own message to the decimal;
with the load's reservation excluded the same load needs 18.6 GB and is
admitted.
NOT the fix that was proposed first. Checking admission BEFORE evicting would
have been worse: at that point 2.9 GB were free, so it would have refused
sooner. Eviction HELPS the host-RAM verdict by shrinking the spill — more free
VRAM, less spill, smaller host requirement, monotonically. It only has to be
visible to the load that paid for it. A test pins that ordering claim so the
earlier idea cannot be reintroduced as an improvement.
Co-Authored-By:
Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T3rZozi1Ehk96NG1WesgC
Showing
Please
register
or
sign in
to comment