FP8 and FP4 sub-byte dtype support for PyTorch MPS on Apple Silicon via Metal shaders
Project description
Registers FP8 (float8_e4m3fn, float8_e5m2) and FP4 (float4_e2m1fn_x2) support for PyTorch's MPS backend on Apple Silicon. Once installed, import torch auto-loads the extension via the torch.backends entry point, enabling tensor.to(torch.float8_e4m3fn), torch._scaled_mm, and tensor.copy_ to work transparently on MPS through Metal shader kernels dispatched via torch.mps.compile_shader. The FP8 encode is tested byte-for-byte against all 254 representable values and their midpoints to match CPU PyTorch exactly; FP4 decode is verified exhaustively against all 256 packed byte patterns. 80 tests run on macOS MPS hardware in CI.
uv pip install git+https://github.com/AppMana/mps-fp8-for-torch-and-comfyui-python-package.git
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fp4_fp8_for_torch_mps-1.0.0.tar.gz.
File metadata
- Download URL: fp4_fp8_for_torch_mps-1.0.0.tar.gz
- Upload date:
- Size: 43.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
737c08f00baf38be5c710e538c902600880f9502cb832ed88b77be4cfd733e9b
|
|
| MD5 |
e69246998bd03ee7e67f7362c88595b5
|
|
| BLAKE2b-256 |
5d99d03926b9adedccfce2ec47fb940f89c01275cefe58719dcf3f55cc36ea4a
|
Provenance
The following attestation bundles were made for fp4_fp8_for_torch_mps-1.0.0.tar.gz:
Publisher:
publishing.yml on AppMana/mps-fp8-for-torch-and-comfyui-python-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fp4_fp8_for_torch_mps-1.0.0.tar.gz -
Subject digest:
737c08f00baf38be5c710e538c902600880f9502cb832ed88b77be4cfd733e9b - Sigstore transparency entry: 1154863752
- Sigstore integration time:
-
Permalink:
AppMana/mps-fp8-for-torch-and-comfyui-python-package@d16b0e38c0f47f19d936978a9dbfaf6d94cf4c29 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/AppMana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publishing.yml@d16b0e38c0f47f19d936978a9dbfaf6d94cf4c29 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fp4_fp8_for_torch_mps-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fp4_fp8_for_torch_mps-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2531c4c060f5bb523d825aceaa908f62a08aac7c4e5c041fc4fe0413c9d1422
|
|
| MD5 |
0052a353ee56beb47747f7b1b1e4cba3
|
|
| BLAKE2b-256 |
d9feec72730cd9d1be40285cd4c6162cf0e7d220171748aa88f60b6d887933fd
|
Provenance
The following attestation bundles were made for fp4_fp8_for_torch_mps-1.0.0-py3-none-any.whl:
Publisher:
publishing.yml on AppMana/mps-fp8-for-torch-and-comfyui-python-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fp4_fp8_for_torch_mps-1.0.0-py3-none-any.whl -
Subject digest:
e2531c4c060f5bb523d825aceaa908f62a08aac7c4e5c041fc4fe0413c9d1422 - Sigstore transparency entry: 1154863754
- Sigstore integration time:
-
Permalink:
AppMana/mps-fp8-for-torch-and-comfyui-python-package@d16b0e38c0f47f19d936978a9dbfaf6d94cf4c29 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/AppMana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publishing.yml@d16b0e38c0f47f19d936978a9dbfaf6d94cf4c29 -
Trigger Event:
release
-
Statement type: