[aoti] Initial Metal support (#153959)

An example generated file: P1816629015

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153959
Approved by: https://github.com/malfet, https://github.com/desertfire
ghstack dependencies: #153964
This commit is contained in:
angelayi
2025-05-21 08:34:22 -07:00
committed by PyTorch MergeBot
parent 918ae5d361
commit 28bcd9eb30
9 changed files with 163 additions and 15 deletions

View File

@ -2475,7 +2475,7 @@ def is_gpu(device: Optional[str]) -> bool:
def device_need_guard(device: str) -> bool:
return is_gpu(device)
return device != "mps" and is_gpu(device) # TODO: MPS does not expose streams now
def needs_fallback_due_to_atomic_add_limitations(dtype: torch.dtype) -> bool: