Skip to content

SJTU-DENG-Lab/Diffulex

Repository files navigation

Diffulex

Diffulex

Documentation Discord

Diffulex is a Diffusion Language Model Serving Engine built on PagedAttention-style runtime primitives. It provides a unified runtime for KV cache management, block scheduling, prefix reuse, MoE execution, CUDA graph replay, HTTP serving, and model-specific diffusion samplers.

Diffulex is also the runtime engine behind the Multi-Block Diffusion Language Models (MBD-LMs) line of work. Native Block Diffusion LMs perform Single-Block Diffusion (SingleBD): one noisy block per forward pass, creating a store bubble where no new output is produced. Multi-Block Diffusion (MultiBD) removes this bottleneck with a bounded running-set of consecutive blocks, enabling decode-store overlap and inter-block parallelism. MBD-LMs are BD-LMs post-trained with Multi-block Teacher Forcing (MultiTF) to handle practical MultiBD states, and Diffulex executes them with an optimized Block Buffer runtime that preserves static shapes for CUDA Graph replay. In the engine, this is exposed as decoding_strategy=multi_bd.

Start Here

The README is intentionally brief. Use the documentation for installation, configuration, benchmarks, serving, and development notes:

Goal Go to
Read the full documentation Diffulex Documentation
Install Python, CUDA, and the tested vllm==0.23.0 dependency Installation
Run the first LLaDA2-mini command Quickstart
Check supported models and strategy combinations Models
Tune runtime and YAML parameters Configuration
Run GSM8K and other benchmark workflows Benchmark
Start HTTP serving and the local demo visualization Server
Use Diffulex as a research backend Research Engine
Add a model, decoding strategy, or kernel Developer Guide

Branches

For reproducing the MBD-LMs experiments, use the Diffulex mbd-lms branch (CUDA 12).

For engine development, open-source contributions, or exploring new decoding algorithms and turning them into runnable systems, use the main branch. main contains ongoing runtime and model-specific optimizations, so its behavior and performance profile may differ from the experiment reproduction branch. The main branch requires CUDA 13.

Diffulex main is built for researchers who want a real backend for block-level dLLM inference ideas. Its Block Buffer backend separates logical block state, running-set/cache policy, and paged KV plus Triton kernel execution, so new SingleBD, MultiBD, TokenMerge, edit, uniform diffusion, or cache-oriented algorithms can be implemented as bounded strategy changes instead of full serving-system rewrites.

Current Scope

Diffulex focuses on cache-aware block-wise dLLM decoding through a single core backend that supports multiple main strategies: MultiBD (SingleBD at BufSz=1, full MultiBD at BufSz≥2), Token Merge + Edit (DMax), Edit Sampling / T2T (LLaDA2.1), D2F MultiBD, Fast-dLLM-v2 Dual Cache, and DiffusionGemma. The most complex part of adding a strategy is modifying the request state machine — sampler-only strategies like DMax require no state machine changes at all.

Supported model families include Dream/DiffuCoder-style dense dLLMs, Dream reasoner, Stable-DiffCoder, LLaDA, Fast-dLLM-v2, SDAR, SDAR-MoE, LLaDA2, and DiffusionGemma. See the Models documentation for the up-to-date compatibility matrix.

Discussion

For questions, development discussion, and collaboration, join the Discord or our WeChat group:

Join our Discord

WeChat Group

Acknowledgments

We would like to thank Nano-vLLM, vLLM, mini-sglang, SGLang, and dInfer, whose designs informed parts of Diffulex's early backend, paged attention, serving architecture, and dLLM inference optimizations. Diffulex is developed by the DENG Lab at Shanghai Jiao Tong University.

About

Flexible and Pluggable Serving Engine for Diffusion LLMs

Topics

Resources

License

Code of conduct

Contributing

Stars

145 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors