Skip to content

feat: Initial block diffusion strategy support - #7

Merged
drewjin merged 27 commits into
mainfrom
fast_dllm_v2
Dec 22, 2025
Merged

drewjin merged 27 commits into
mainfrom
fast_dllm_v2

Conversation

@drewjin

@drewjin drewjin commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Motivation

This PR introduces a flexible framework to support multiple inference paradigms for Diffusion Language Models (dLLMs). Specifically, it implements a Strategy Registration Mechanism, which decouples the decoding logic from the model architecture. This design allows researchers and developers to rapidly prototype, register, and experiment with novel inference algorithms without modifying the core system.

Implementation Status

Features included in this PR:

  • Strategy Registration Mechanism: A registry system to manage different decoding strategies dynamically.
  • Abstract Strategy Interface: Defined base classes for implementing custom diffusion policies.
  • Initial Block Diffusion Strategy: Implementation of the standard block-wise diffusion logic using the new registry.
  • Model Integration: Basic integration for Fast-dLLM-v2, SDAR, LLaDA-2.0-mini/flash with the new strategy framework.
  • Configuration Support: Ability to select strategies via configuration/arguments.
  • Refactored Sampler: Refactor samplers to Shifting and Non-Shifting, and inherit model-specific samplers based on this.

Features to be implemented in future PRs:

  • Advanced Batching support (leveraging SGLang's core scheduling with new strategies)
  • CUDA Graph optimization for dynamic strategies
  • Support for Prefix Cache with diffusion steps
  • Support for overlap scheduling
  • More advanced decoding policies (e.g., specific low-confidence policies)

Our From-Scratch Diffusion Language Models

Related Issues

#5

#10

Contributors

  • Chengyue Wu wcy010805@gmail.com. His efforts included integrate Fast-dLLM-v2 model into Diffulex supported models.

@drewjin

drewjin commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

@copilot

Copilot AI commented Dec 10, 2025

Copy link
Copy Markdown

@drewjin I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

drewjin and others added 8 commits December 11, 2025 18:36
- Add SDARConfig in diffulex/model/config/sdar/configuration_sdar.py
- Implement SDARForDiffusionLM with native Diffulex KV cache integration
- Register SDAR model to AutoModelForDiffusionLM
- Update model __init__.py to trigger SDAR registration
- Add test_sdar_dvllm.py in examples/
- Support automatic weight key conversion from HF format to Diffulex-native
- Test SDAR model forward pass with minimal attention metadata setup
- Use .venv Python environment for execution
…ionality; fix launch configurations and improve kernel integration; test: add dllm_flash_attn_decode_kernel test file
…tn prefilling kernel; refactor: renaming imgs to assets
@drewjin drewjin changed the title (feat) Initial block diffusion strategy support feat: Initial block diffusion strategy support Dec 18, 2025
drewjin and others added 5 commits December 18, 2025 11:19
…remove redundant assertions and enhance comments for clarity; update test to utilize einops for tensor rearrangement
…t; refactor: Move diffulex_legacy to a separate module to prevent import conflicts;
feat: add SDAR model support for fast_dllm_v2 branch
@drewjin
drewjin merged commit 4a90b4b into main Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants