Skip to main content

Discrete Denoising Diffusion Probabilistic Models in MLX

Project description

d3pm

ci

Discrete denoising diffusion probabilistic models in MLX

d3pm is a small library for discrete denoising diffusion probabilistic models (D3PM) in MLX.

[!IMPORTANT]

🚀 DiffusionGemma

🔥 d3pm now features a 💎 DiffusionGemma 💎 example. DiffusionGemma trains on tiny_shakespeare and generates text in a block-autoregressive fashion with a Gemma-4 MoE backbone, uniform (mask-free) diffusion, self-conditioning, and D-CFG guidance. It supports prompt-conditioned generation via causal prompt prefill with bidirectional denoising.

Examples

Self-contained examples can be found in examples.

Installation

To install the latest GitHub , just call the following on the command line:

pip install git+https://github.com/dirmeier/d3pm-mlx@<RELEASE>

Please do not directly install from the main branch, since these commits are not tested, but prefer using PyPI or a stable release.

Contributing

Contributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled good first issue.

In order to contribute:

  1. Clone d3pm-mlx and install uv from here.

  2. Install all dependencies using uv sync --all-groups.

  3. Install the Git hooks:

    uv run pre-commit install -t pre-commit -t commit-msg
    
  4. Create a new branch locally, e.g. git checkout -b feature/my-new-feature.

  5. Implement your contribution and ideally a test case.

  6. Check your work (see below).

  7. Submit a PR 🙂.

Development commands

The project uses uv for everything:

uv sync --all-groups
uv run ruff format src examples
uv run ruff check --fix src examples
uv run mypy src examples
uv run pre-commit run --all-files

References

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

d3pm-0.0.1.tar.gz (99.7 kB view details)

Uploaded Source

Built Distribution

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

d3pm-0.0.1-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file d3pm-0.0.1.tar.gz.

File metadata

  • Download URL: d3pm-0.0.1.tar.gz
  • Upload date:
  • Size: 99.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for d3pm-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cfec8df61b0c5714751efacc7346b331a7dd06915f453ce7762b7eef77092c0f
MD5 e2cd692ea9c772b79a614dbe4af9a194
BLAKE2b-256 fecd232ff87025f65fdbf027f40acb89419aa0cb91f8e7898f57976bff66aa0b

See more details on using hashes here.

File details

Details for the file d3pm-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: d3pm-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for d3pm-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55d8ca808fabb6b16f4235e674853d56fe35d351dfdc926ce794dcdd4a4a86b7
MD5 9c12402f74765d8df38b1fb11b962735
BLAKE2b-256 bd64681c9ba238a9b4f87d215d23e750c3ddf11927698e67162720917d1dea01

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