diffulex.sampler¶
diffulex.sampler contains token update logic for diffusion language models.
Importing the package loads built-in samplers so their AutoSampler.register(...)
calls run.
Module |
Role |
|---|---|
|
Registry and factory for sampler implementations. |
|
Base sampler classes and sample output utilities. |
|
DiffusionGemma sampler registration. |
|
Dream sampler registration. |
|
Fast-dLLM-v2 sampler registration. |
|
LLaDA sampler registration. |
|
LLaDA2, edit-sampling, and DMax sampler logic. |
|
SDAR and SDAR-MoE sampler registration. |
diffulex.sampler.auto_sampler¶
This module maps Config.model_name values to sampler factories. It supports
both simple class registration and factories that need the full Diffulex config.
Symbol |
Purpose |
|---|---|
|
Registry used by model runners to construct the configured sampler. |
New model families should register a sampler only when the token update rule differs from existing sampler behavior.
diffulex.sampler.base¶
This package provides shared sampler contracts and output structures.
Symbol |
Purpose |
|---|---|
|
Base classes for samplers that shift logits before sampling. |
|
Base classes for samplers that operate without shifted logits. |
|
Base sample-output dataclass. |
|
Merges sample outputs from parallel paths. |
Use these base classes before adding a new model-family sampler from scratch.
diffulex.sampler.diffusion_gemma¶
This module registers the DiffusionGemma sampler.
Symbol |
Purpose |
|---|---|
|
Sampler registered for |
diffulex.sampler.dream¶
This module registers the Dream sampler.
Symbol |
Purpose |
|---|---|
|
Shift-logits sampler registered for |
diffulex.sampler.fast_dllm_v2¶
This module registers the Fast-dLLM-v2 sampler.
Symbol |
Purpose |
|---|---|
|
Shift-logits sampler registered for |
diffulex.sampler.llada¶
This module registers the LLaDA sampler.
Symbol |
Purpose |
|---|---|
|
No-shift sampler registered for |
diffulex.sampler.llada2¶
This module contains the most feature-rich sampler path: accepted-token helpers, edit sampling, DMax token merging, and factory registration for multiple LLaDA2 model names.
Symbol |
Purpose |
|---|---|
|
Base LLaDA2 sampler with accepted-token handling. |
|
Edit-sampling variant. |
|
DMax/token-merge sampler variant. |
|
Factory registered for LLaDA2 model names. |
Use this module as the reference for edit-sampling and token-merge sampler behavior.
diffulex.sampler.sdar¶
This module registers the SDAR sampler for dense and MoE SDAR variants.
Symbol |
Purpose |
|---|---|
|
No-shift sampler registered for |