Skip to main content

FP8 and FP4 sub-byte dtype support for PyTorch MPS on Apple Silicon via Metal shaders

Project description

FP8/FP4 support for PyTorch MPS on Apple Silicon.

Installing this lets ComfyUI use FP8 and FP4 weight checkpoints on MPS automatically.

Fast paths use Metal kernels. Fallback paths round-trip through CPU Torch for exact PyTorch-compatible bytes.

pip install fp4-fp8-for-torch-mps

Decode backend

FP8 e4m3fn and FP4 decode can use lut, lut4, arithmetic, arithmetic4, or auto. Default: lut.

import fp4_fp8_for_torch_mps as mps_fp
mps_fp.set_decode_backend("lut")

Or:

FP4_FP8_MPS_DECODE_BACKEND=lut

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

fp4_fp8_for_torch_mps-1.0.1.tar.gz (45.9 kB view details)

Uploaded Source

Built Distribution

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

fp4_fp8_for_torch_mps-1.0.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file fp4_fp8_for_torch_mps-1.0.1.tar.gz.

File metadata

  • Download URL: fp4_fp8_for_torch_mps-1.0.1.tar.gz
  • Upload date:
  • Size: 45.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fp4_fp8_for_torch_mps-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e032aa62ca86686b993804995b0b49a1db3165a8bd4d30f674fe28fc8415b390
MD5 dd69be8969b57e67184186083ac69880
BLAKE2b-256 3b1961774ade237d4c5362f5084a4a6c69e84b98bfd0427d3beafc9a7ef3c885

See more details on using hashes here.

Provenance

The following attestation bundles were made for fp4_fp8_for_torch_mps-1.0.1.tar.gz:

Publisher: publishing.yml on AppMana/mps-fp8-for-torch-and-comfyui-python-package

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fp4_fp8_for_torch_mps-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fp4_fp8_for_torch_mps-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63c2a2f3ea6ae9673eb91e340f3adc435349c7793bb844ec864d490cb6fc620c
MD5 ce471126b0448dd0b067a5495326c67b
BLAKE2b-256 0ed05a31a20bb8da070bcf640994151954770df7e8a344078c56ef9001419379

See more details on using hashes here.

Provenance

The following attestation bundles were made for fp4_fp8_for_torch_mps-1.0.1-py3-none-any.whl:

Publisher: publishing.yml on AppMana/mps-fp8-for-torch-and-comfyui-python-package

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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