Metadata-Version: 2.4
Name: mpsops
Version: 0.1.3
Summary: CUDA-only PyTorch operations for Apple Silicon - metapackage
Author: mpsops
License-Expression: MIT
Project-URL: Homepage, https://github.com/mpsops
Project-URL: Repository, https://github.com/mpsops/mpsops
Project-URL: Issues, https://github.com/mpsops/mpsops/issues
Keywords: pytorch,mps,apple-silicon,metal,gpu,machine-learning
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0.0
Requires-Dist: mps-flash-attn>=0.1.7
Requires-Dist: mps-bitsandbytes>=0.1.1
Requires-Dist: mps-deform-conv>=0.1.1
Requires-Dist: mps-correlation>=0.1.1
Requires-Dist: mps-carafe>=0.1.1
Requires-Dist: mps-conv3d>=0.1.1
Provides-Extra: flash-attn
Requires-Dist: mps-flash-attn>=0.1.7; extra == "flash-attn"
Provides-Extra: bitsandbytes
Requires-Dist: mps-bitsandbytes>=0.1.1; extra == "bitsandbytes"
Provides-Extra: deform-conv
Requires-Dist: mps-deform-conv>=0.1.1; extra == "deform-conv"
Provides-Extra: correlation
Requires-Dist: mps-correlation>=0.1.1; extra == "correlation"
Provides-Extra: carafe
Requires-Dist: mps-carafe>=0.1.1; extra == "carafe"
Provides-Extra: conv3d
Requires-Dist: mps-conv3d>=0.1.1; extra == "conv3d"

# 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:
```bash
pip install mpsops
```

Or install individual packages:
```bash
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](https://github.com/mpsops/mps-flash-attn) | Flash Attention | Transformers, LLMs |
| [mps-bitsandbytes](https://github.com/mpsops/mps-bitsandbytes) | 8-bit/4-bit quantization | LLM inference, QLoRA |
| [mps-deform-conv](https://github.com/mpsops/mps-deform-conv) | Deformable convolution | Object detection (DETR, DCN) |
| [mps-correlation](https://github.com/mpsops/mps-correlation) | Correlation layer | Optical flow (RAFT, PWC-Net) |
| [mps-carafe](https://github.com/mpsops/mps-carafe) | CARAFE upsampling | Segmentation (Mask R-CNN) |
| [mps-conv3d](https://github.com/mpsops/mps-conv3d) | 3D Convolution | Video models (I3D, SlowFast, MMAudio) |

## Quick Start

```python
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
