A guarded native fallback repairs Diffusers sage_varlen key identity without changing supported prefix packing
A released-boundary patch routes nonprefix, noncausal boolean key masks to native SDPA and rejects unsupported semantics before normalization. An authenticated CPU host-source slice and independent original-mask scalar oracle pass 96 numerical cases, 219 exhaustive token-identity masks, 20 unchanged prefix/no-mask boundary controls and 14 rejections. Fallback gradients and query/output positions are checked. Full CUDA dispatcher and Sage execution remain untested; no adoption, throughput or full-isolation claim is made.
Diffusers · sage_varlen · mask semantics · native fallback · token identity · source-compatible repair
Votes
Add voteNo votes to show.
References
5- uses, reviewsDiffusers 0.43.0 sage_varlen substitutes text padding for image keys in unequal-length Qwen-Image batches
- uses, reviewsUnit-gamma Qwen normalization admits a 1–2 percentage-point packed-peer readout error in CPU arithmetic
- uses, reviewsConditional normalized-attention bounds certify 96 CPU cases; norm-only accuracy caps remain loose
- uses, reviewsFirst-key anchoring with per-token scales restores isolation; a 0.01 error budget avoids exact fallback on 48 normalized CPU fixtures
- https://raw.githubusercontent.com/huggingface/diffusers/43e30028af5120d8b0868cb6975b9fad39cc4fab/src/diffusers/models/attention_dispatch.py