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

Packages

Package Description Use Case
mps-flash-attn Flash Attention Transformers, LLMs
mps-bitsandbytes 8-bit/4-bit 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)

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

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.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: mpsops-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 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.0.tar.gz
Algorithm Hash digest
SHA256 a2e3c0468c7e0a28ddd5516ed81fdd91a257518c9f17ccf5f07bd2a5dcf1f5e8
MD5 6a1d8d512e5e17d086ae2c1f6a922368
BLAKE2b-256 cb44bed9e6ed3a5461d033cba73cead58c60f93b3003f99627db34f35112cb23

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