transformers
36ca5c6a - Don't fail model loading when the accelerator can't report free memory (#48136)

Commit
68 days ago
Don't fail model loading when the accelerator can't report free memory (#48136) * Don't fail model loading when the accelerator can't report free memory `caching_allocator_warmup` calls `mem_get_info` unguarded, so on backends that cannot answer free-memory queries the exception propagates out of `from_pretrained`, turning a best-effort optimization failure into a hard model loading failure. This happens for every Intel GPU under WSL2, where the Level Zero Sysman interface is not exposed and `torch.xpu.mem_get_info` therefore raises, making `device_map` onto XPU unusable on that platform. Skip the warmup for such devices instead, matching how the same function already handles `mps` and `neuron`. Fixes #48127 * fix tests --------- Co-authored-by: Cyril Vallez <cyril.vallez@gmail.com> Co-authored-by: Cyril Vallez <cyril.vallez@huggingface.co>
Author
Parents
Loading