iafiscal1212andClaude Opus 4.6 4d6bd72d4e Fix forward pass for real LLaDA-8B F16 model
- Add ggml_cast for norm weights (F16→F32) to fix ggml_mul type mismatch
- Switch RoPE from NORMAL to NEOX style (non-interleaved, matching LLaDA/OLMo)
- Use PyTorch framework in converter for BF16 safetensors support
- Add validation tools: validate-gguf.py, compare-logits.py, dump-logits
- Result: 100% argmax match vs PyTorch, cos_sim >0.993

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 05:03:11 +01:00

diffuse-cpp

High-performance C++ inference engine for Diffusion Language Models.

Supports LLaDA, SEDD, and MDLM architectures using GGML for quantized tensor operations.

Why diffuse-cpp?

Diffusion LLMs read weights once per step and generate all tokens in parallel, shifting inference from memory-bound to compute-bound. With quantization (Q4_K_M) and SIMD, this yields 3x faster inference than autoregressive engines on CPU.

Build

git clone --recursive https://github.com/iafiscal1212/diffuse-cpp.git
cd diffuse-cpp
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

Usage

Convert model

python tools/convert-llada.py \
    --input /path/to/LLaDA-8B-Instruct \
    --output llada-8b-f32.gguf

Generate text

./build/diffuse-cli -m llada-8b-f32.gguf -p "Explain quantum computing" -s 32 -t 12

Benchmark

./build/diffuse-bench -m llada-8b-f32.gguf -s 8,16,32 -t 1,4,12 -r 3

Supported models

Model Architecture Status
LLaDA-8B Masked diffusion (Llama backbone) Phase 1
SEDD Score-based diffusion Phase 3
MDLM Masked discrete diffusion Phase 3

License

MIT

S
Description
High-performance C++ inference engine for Diffusion Language Models (LLaDA, SEDD, MDLM)
Readme Apache-2.0
1.4 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 60.5%
Python 22.4%
TeX 14.7%
Shell 0.8%
CMake 0.8%
Other 0.8%