Instead of c10::Allocator to make it more compatible with torch.accelerator APIs, that route all torch.accelerator.memory_* cals thru at::getDeviceAllocator, which does
dynamic_cast<DeviceAllocator*>(c10::GetAllocator(device)).
Test Plan:
python -c "import torch;x = torch.rand(1024, 1024, device='mps'); print(torch.mps.current_allocated_memory()); del x; torch.accelerator.empty_cache(); print(torch.accelerator.memory_allocated())"
Should allow next iterations of #184326 to land successfully on MacOS
This change was authored with the assistance of Claude (Claude Code).
Pull Request resolved: #186748
Approved by: https://github.com/Skylion007
SOCIAL SHARE CARD GENERATOR