Repository navigation
[Remyx Recommendation] Add DiG (Gated Linear Attention) transformer backbone alongside DiT #13
Description
Model/Pipeline/Scheduler description
DiG (Diffusion models with Gated Linear Attention) swaps DiT's quadratic self-attention for Gated Linear Attention (GLA), giving the diffusion transformer sub-quadratic cost on long sequences while keeping the same 2D backbone and forward contract as DiTTransformer2DModel. This lines up directly with two active themes in the repo's trajectory: efficient attention (diffusers already ships SanaLinearAttnProcessor2_0 as a linear-attention backbone, an implicit acceptance signal for this direction) and inference efficiency / scalability. It is a clean architectural sibling of DiTTransformer2DModel, so the integration surface is well understood.
Open source status
- The model implementation is available.
- The model weights are available (Only relevant if addition is not a scheduler).
The reference implementation is open source (MIT), but no DiG checkpoint is currently exposed on the Hub in diffusers format, and the repo has no path to obtain one. DiG's value is as a runnable, pretrained backbone; a model class with no weights and no pipeline that instantiates it is a scaffold, not a usable capability. Whether to ship architecture-only is one of the open decisions below.
Provide useful links for the implementation
- Paper: DiG: Scalable and Efficient Diffusion Models with Gated Linear Attention (arXiv:2405.18428)
- Reference implementation: https://github.com/hustvl/DiG
- License:
MIT(permissive — safe to adopt) - Authors: the
hustvl(HUST Visual Learning) group
Why this was opened as an Issue rather than a PR
- No
scripts/call site. Every file underscripts/(93 of them) is a checkpoint-conversion utility (convert_*_to_diffusers.py, e.g.convert_dit_to_diffusers.py). There is no inference, eval, or scoring entry point there that would invoke a new attention backbone, so there is no natural home for a small, self-contained edit. - The real integration lives in
src/diffusers/models/, and is multi-file. A faithful, registered DiG would mean (1) a newDiGTransformer2DModelmirroringDiTTransformer2DModelinsrc/diffusers/models/transformers/, (2) a new GLA attention processor alongsideSanaLinearAttnProcessor2_0insrc/diffusers/models/attention_processor.py, (3) registration inmodels/__init__.py+models/transformers/__init__.py(+ adummy_*object), and (4) a model test undertests/models/transformers/. Without (3) the model is unreachable from any pipeline and is effectively freestanding — deleting it would change nothing in the repo. This is several files acrosssrc/, each needing registration rather than a 3-line hook, which is beyond the small-slot-in shape this pass targets. - No checkpoint to load (see open-source status above).
Open questions to decide first
- Is a DiG checkpoint forthcoming on the Hub? If yes, the integration becomes a standard "add model + converter + pipeline" task (sibling to the recent Anima/AnyFlow/Cosmos 3 additions). If no, we'd be shipping architecture without weights — worth deciding whether that's wanted on its own.
- GLA as a new model vs. an optional attention path on the existing DiT block. Do we want a standalone
DiGTransformer2DModel, or would extendingDiTTransformer2DModelwith alinear_attn/GLA variant in its attention processor set be preferable (closer to how Sana exposesSanaLinearAttnProcessor2_0)? This decides whether it's a new file or a flag on an existing one. - Processor placement. Confirm the GLA processor should register next to
SanaLinearAttnProcessor2_0inattention_processor.pyand follow that processor's dataclass/__call__contract — the cleanest existing precedent to mirror.
Drafted by Outrider — paper: arXiv:2405.18428.
Discovery context
- Recommended paper: DiG: Scalable and Efficient Diffusion Models with Gated Linear Attention
- Confidence: moderate (Remyx relevance 0.65)
- Research interest: diffusers
- License:
MIT(class:permissive, compat: 1.00, source:github)
Reference: https://github.com/hustvl/DiG
Opened by the Remyx Recommendation orchestrator — the coding agent elected Issue-mode rather than scaffolding a PR for this paper. Reopen this Issue if you want Outrider to revisit this paper later; while it stays closed, the orchestrator will not re-recommend the same paper.
Activity
smellslikeml commentedon Jul 5, 2026
Closing to test auto-drafted landing-zone-to-PR: the successor PR will ship DiG as a GatedLinearAttnProcessor2_0 in attention_processor.py, sibling to SanaLinearAttnProcessor2_0. Standalone DiGTransformer2DModel + Hub checkpoint + FID eval are deferred (no weights exist upstream yet). Spec drafted via /home/thorax/draft_landing_zone_spec.sh — REMYX-195 bypass in effect.