A CPU-only 8 GB Windows host died with an access violation inside the DAC
encoder while preparing a voice-clone prompt (#3340).
- Check free RAM plus swap against the measured encode cost before a CPU
encode, and raise a MemoryError subclass with an actionable message.
- Run the tokenizer encode in inference mode; the clone-prompt cache calls
it outside generate(), so autograd kept every activation (+27% peak).
- Treat a host-RAM failure in the prompt precompute like a GPU OOM: raise
instead of repeating the same encode through the inline path.
- is_host_oom recognizes MemoryError subclasses.