Skip to content

How I can run this on mac No module named 'triton' #597

Description

@Anmolpatwa

Problem
I'm trying to run the SAM 3 model on my MacBook Air M3, but I keep encountering the following error:

ModuleNotFoundError: No module named 'triton'

I investigated further and found that Triton appears to be designed primarily for CUDA-enabled NVIDIA GPUs. Since Apple Silicon uses Metal (MPS) instead of CUDA, I cannot install or use the required Triton package on macOS.

I also noticed that the installation instructions recommend installing CUDA-specific PyTorch builds, which are not available for macOS.

What I've Tried
Created a fresh Python virtual environment.
Installed the macOS version of PyTorch.
Installed all dependencies listed in the repository.
Tried installing Triton, but it is not available/supported for my platform.
Verified that PyTorch works correctly with MPS.

Despite this, the code still imports triton, which prevents the model from running.

Questions
Is there an MPS-compatible implementation that replaces the Triton kernels?
Is there a branch, fork, or previous commit that works on macOS?
If not, what code changes would be required to replace the Triton operations with standard PyTorch operations so the model can run on Apple Silicon?

Any guidance would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions