Summary
It would be great if SAM 3 exposed a backend-agnostic inference path so the model can run on devices other than CUDA GPUs (Apple Silicon / MPS, CPU-only servers, TPU via XLA, etc.). Right now the repo assumes CUDA everywhere, so even image-only inference fails on machines without NVIDIA GPUs.
Use case
I (and likely many others) want to use SAM 3 for bulk auto-labeling images when preparing YOLO datasets. Those labeling jobs often run on whatever hardware is already available—e.g., a MacBook Pro M3 with the Metal build of PyTorch. Because SAM 3 hard-requires CUDA 12.6, there is no way to try the model without renting a remote GPU, which makes lightweight labeling workflows much harder.
Current blockers
These are some spots that make CUDA mandatory today:
- The README lists "CUDA-compatible GPU with CUDA 12.6 or higher" as a prerequisite and only shows CUDA install commands (
README.md:58-79).
- Core preprocessing helpers unconditionally move tensors to CUDA (e.g.
load_image_as_single_frame_video calls .cuda() on the image, mean, and std tensors in sam3/model/io_utils.py:93-112). On a PyTorch build compiled without CUDA, importing these utilities throws Torch not compiled with CUDA enabled.
- The video inference stack wraps methods with
@torch.autocast(device_type="cuda") and raises if self.device.type != "cuda" (sam3/model/sam3_video_inference.py:797-810), so even if most of the model could run on CPU/MPS, execution aborts immediately.
- Multi-GPU support is hard-coded to NCCL + CUDA tensors (
sam3/model/sam3_video_predictor.py:420-433), again preventing CPU or other backends.
- Performance-critical helpers require CUDA-only extensions such as
torch_generic_nms and Triton kernels built with TORCH_CUDA_ARCH_LIST (sam3/perflib/nms.py:11-69). There is no fallback that keeps execution on CPU/MPS when these aren’t available.
Request / proposal
Would Meta consider supporting a backend-agnostic inference mode? Concretely, that could mean:
- Abstracting device selection (use
tensor.to(device) instead of raw .cuda() and allowing torch.device("mps"), "cpu", etc.).
- Guarding CUDA-specific features (NCCL, Triton kernels,
torch.cuda.* logging) behind availability checks and providing CPU-friendly defaults.
- Documenting a CPU/MPS installation path—e.g., PyTorch nightly with Metal and a note about expected performance.
- (Stretch) exposing hooks so advanced users could plug in XLA/TPU devices once the general abstraction exists.
I’m happy to test on Apple Silicon if guidance is provided, but an official stance on whether CPU/MPS/TPU support is on the roadmap would already help the community plan.
Summary
It would be great if SAM 3 exposed a backend-agnostic inference path so the model can run on devices other than CUDA GPUs (Apple Silicon / MPS, CPU-only servers, TPU via XLA, etc.). Right now the repo assumes CUDA everywhere, so even image-only inference fails on machines without NVIDIA GPUs.
Use case
I (and likely many others) want to use SAM 3 for bulk auto-labeling images when preparing YOLO datasets. Those labeling jobs often run on whatever hardware is already available—e.g., a MacBook Pro M3 with the Metal build of PyTorch. Because SAM 3 hard-requires CUDA 12.6, there is no way to try the model without renting a remote GPU, which makes lightweight labeling workflows much harder.
Current blockers
These are some spots that make CUDA mandatory today:
README.md:58-79).load_image_as_single_frame_videocalls.cuda()on the image, mean, and std tensors insam3/model/io_utils.py:93-112). On a PyTorch build compiled without CUDA, importing these utilities throwsTorch not compiled with CUDA enabled.@torch.autocast(device_type="cuda")and raises ifself.device.type != "cuda"(sam3/model/sam3_video_inference.py:797-810), so even if most of the model could run on CPU/MPS, execution aborts immediately.sam3/model/sam3_video_predictor.py:420-433), again preventing CPU or other backends.torch_generic_nmsand Triton kernels built withTORCH_CUDA_ARCH_LIST(sam3/perflib/nms.py:11-69). There is no fallback that keeps execution on CPU/MPS when these aren’t available.Request / proposal
Would Meta consider supporting a backend-agnostic inference mode? Concretely, that could mean:
tensor.to(device)instead of raw.cuda()and allowingtorch.device("mps"),"cpu", etc.).torch.cuda.*logging) behind availability checks and providing CPU-friendly defaults.I’m happy to test on Apple Silicon if guidance is provided, but an official stance on whether CPU/MPS/TPU support is on the roadmap would already help the community plan.