Skip to main content

CUDA-only PyTorch operations for Apple Silicon - metapackage

Project description

MPS Ops

CUDA-only PyTorch operations for Apple Silicon.

This metapackage installs all mpsops packages - Metal implementations of operations that are typically CUDA-only.

Installation

Install everything:

pip install mpsops

Or install individual packages:

pip install mps-flash-attn    # Flash attention
pip install mps-bitsandbytes  # Quantized ops
pip install mps-deform-conv   # Deformable convolution
pip install mps-correlation   # Optical flow correlation
pip install mps-carafe        # Content-aware upsampling
pip install mps-conv3d        # 3D convolution for video

Packages

Package Description Use Case
mps-flash-attn Flash Attention Transformers, LLMs
mps-bitsandbytes NF4/FP4/FP8/INT8 quantization LLM inference, QLoRA
mps-deform-conv Deformable convolution Object detection (DETR, DCN)
mps-correlation Correlation layer Optical flow (RAFT, PWC-Net)
mps-carafe CARAFE upsampling Segmentation (Mask R-CNN)
mps-conv3d 3D Convolution Video models (I3D, SlowFast, MMAudio)

Quick Start

import mpsops

# Check what's installed
mpsops.print_status()

# Use the ops directly
from mpsops import flash_attn_func, deform_conv2d, correlation, carafe, conv3d, patch_conv3d

Compatibility

  • PyTorch: 2.0+
  • macOS: 12.0+ (Monterey)
  • Hardware: Apple Silicon (M1/M2/M3/M4)

Why?

Many state-of-the-art models use CUDA-only operations:

  • LLMs need flash attention and quantization
  • Object detection needs deformable convolution
  • Optical flow needs correlation layers
  • Segmentation needs specialized upsampling

On Mac, you get errors like:

NotImplementedError: flash_attn not implemented for MPS

MPS Ops provides native Metal implementations so these models run on Apple Silicon.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpsops-0.1.14.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpsops-0.1.14-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file mpsops-0.1.14.tar.gz.

File metadata

  • Download URL: mpsops-0.1.14.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for mpsops-0.1.14.tar.gz
Algorithm Hash digest
SHA256 f75ec527df6721d2bc9aacb906671516128e10a5c20fab914715abdf0407d022
MD5 1bc0a078c3184378c72327ae1682e6f6
BLAKE2b-256 a3a8ba96eb9be9ad4205ffd40c80a301c749e5c2ac77269c989c856f1fb41f2b

See more details on using hashes here.

File details

Details for the file mpsops-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: mpsops-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for mpsops-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7017e81fd33b63928b9b4c5e6be73953a480c7f3f876b3b01aa1c895863ad8f8
MD5 100e64bd8d20ad2324958bf92d6792a1
BLAKE2b-256 e9e633dce8d02f8c15bddf470aa0669ae45b7879ff647a60acdb7e81bba28b18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page