FlowBlock 是一种无需训练的波前并行解码框架,通过利用 token-to-token 自纠错能力打破块间的串行依赖,从而加速块状扩散语言模型。

Stars

118

7 天增长

+28

Fork 数

1

开放 Issue

0

开源协议

Apache-2.0

最近更新

2026-07-21

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

在数学/代码基准测试中,相比之前的扩散语言模型,吞吐量最高提升 4 倍、延迟降低 77%,同时准确率保持甚至提升,且无需任何额外训练。

适合谁使用

  • 高效推理研究者
  • 部署扩散语言模型的实践者
  • 开发自纠错或块状自回归模型的开发者
  • 优化生成式 AI 批处理服务的工程师

典型使用场景

  • 高吞吐批处理数学与代码生成
  • 低延迟的单请求解码加速
  • 对延迟敏感的推理流水线优化
  • 在固定计算预算下评估并行性与准确率的权衡

项目优势

  • 无需训练:直接使用未修改的 LLaDA-2.x 权重
  • 准确率提升:8 个数学/代码基准平均提高 1.3 个百分点
  • 显著加速:批处理吞吐量比 LLaDA-2.1 / LLaDA-2.0 最高提升 2.95× / 4.01×
  • 提供门控波前解码与异构打包策略以高效利用 GPU

使用前须知

  • 当前仅支持 LLaDA-2.x 模型系列(不适用于通用自回归模型)
  • 16B-A1B MoE 检查点需要约 80 GB GPU 显存
  • 推理后端仅支持 SGLang(未提及 vLLM 或 TensorRT-LLM)

README 快速开始

Wavefront-Parallel Decoding for Self-Correcting Diffusion Language Models

FlowBlock is a training-free parallel decoding framework for block-wise diffusion language models (dLLMs). Block-wise dLLMs such as LLaDA-2.x decode one block at a time, which makes inter-block decoding strictly serial. FlowBlock observes that the token-to-token (T2T) self-correction ability of LLaDA-2.1 series enable a downstream block start from an informative draft instead of a finalized predecessor — so block finality becomes a scheduling resource rather than a hard dependency.

FlowBlock is built on two mechanisms:

  • Gated Wavefront Decoding (GWD) — admits blocks into a bounded wavefront only when a readiness gate (SPAWN_TH) is satisfied, jointly refines active blocks via T2T editing, and commits blocks in order under a windowed block-causal mask that preserves exact frozen-prefix KV-cache reuse.
  • Heterogeneous Wavefront Packing (HWP) — gives each request its own wavefront while packing all active windows into dense, shape-stable batched forwards, so asynchronous progress stays GPU-efficient in batched serving.

✨ Highlights

  • Up to 2.95× / 4.01× higher TPS than LLaDA-2.1 / LLaDA-2.0 under batched serving (1.57× / 3.17× at batch size 1), with up to 53.6% / 77.1% lower latency.
  • Accuracy preserved or improved: +1.3 points on average across eight math / code benchmarks.
  • No training: runs the unmodified LLaDA-2.1 series weights.

🛠️ Installation

Requirements: Linux, NVIDIA GPU(s) with ~80 GB memory for the 16B-A1B MoE checkpoints, CUDA 12.x driver.

git clone  FlowBlock
cd FlowBlock

conda create -n flowblock python=3.11 -y
conda activate flowblock

# 1) Install PyTorch matching your CUDA version (validated: 2.8.0 + cu128)
pip install torch==2.8.0 --index-url https://download.pytorch.org/whl/cu128

# 2) Install the base dependencies (sglang, lm-eval, ...)
pip install -r requirements.txt

# 3) Install vLLM last — this is a separate step on purpose
pip install vllm==0.10.2

The dinfer package is used directly from source — the evaluation scripts set PYTHONPATH automatically, no pip install step is needed. Verify the setup:

PYTHONPATH="$PWD/dInfer/python" python -c \
  "from dinfer.decoding import FlowBlockJointDiffusionLLM, flowblock_packed; print('Flo

项目描述

FlowBlock: Wavefront-Parallel Decoding Framework for Self-Correcting Diffusion Language Models

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482