DreamLite: disabling attention slicing replaces the GQA processor and breaks inference
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 70/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Bereich
- machine-learning
Rechercherichtung
Locate DreamLiteUNetModel and the DreamLite pipeline classes in the diffusers source; inspect set_attention_slice and set_default_attn_processor to see where AttnProcessor2_0 replaces DreamLiteAttnProcessor2_0. Run the provided CPU reproduction to observe the RMSNorm tensor mismatch. The fix should preserve the correct GQA processor when slicing is disabled and add regression tests for both pipelines.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
Calling disable_attention_slicing() on either DreamLite pipeline replaces DreamLiteAttnProcessor2_0 with AttnProcessor2_0. The next inference then fails in RMSNorm, even if attention slicing was never enabled. The inherited UNet method calls set_attention_slice(None) on each attention layer, installing a processor that does not support DreamLite's grouped-query attention layout. DreamLite's existing set_default_attn_processor() restores the correct processor and produces exactly the original output.
I found this by inspecting the source code and reproduced it on CPU. Standard attention slicing is already known to be incompatible with DreamLite's GQA layout. This issue is about what happens when slicing is disabled.
Reproduction
This example uses the published DreamLite-mobile UNet weights with smaller spatial dimensions and synthetic text-conditioning vectors.
import torch
from diffusers import DreamLiteUNetModel
torch.set_num_threads(1)
unet = DreamLiteUNetModel.from_pretrained(
"carlofkl/DreamLite-mobile",
subfolder="unet",
revision="6695c3f4be230f0493fa5dbf78be3bc4d3bb2ab4",
torch_dtype=torch.float32,
).eval()
torch.manual_seed(23)
sample = torch.randn(1, 4, 8, 8)
inputs = dict(
encoder_hidden_states=torch.randn(1, 5, 2048),
added_cond_kwargs={"time_ids": torch.tensor([[64., 64.]])},
)
with torch.no_grad():
print(unet(sample, 500, **inputs).sample.shape)
unet.set_attention_slice(None) # Called by pipeline.disable_attention_slicing()
print(unet(sample, 500, **inputs).sample.shape)
Logs
torch.Size([1, 4, 8, 8])
RuntimeError: The size of tensor a (16) must match the size of tensor b (64) at non-singleton dimension 3
System Info
Diffusers main at 86ef420b17363c28e36ebad6b58555e9aa8feda2, Linux x86_64, Python 3.11.17, PyTorch 2.14.1+cpu, Transformers 5.19.0, Accelerate 1.15.0. I used Codex to help investigate the issue and reproduce it.
Would you be open to a focused fix that keeps DreamLite's correct default processor when attention slicing is disabled? I'd be happy to implement it and add regression tests for both pipeline classes. I'd also appreciate guidance on what should happen if users try to enable unsupported attention slicing.
Who can help?
No response
- Vorherrschende Sprache
- Python
- Sterne
- 35k
- Forks
- 7.5k
- Ø Merge
- 2 T. 22 Std.
- Gemergte PRs (30 T.)
- 58
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus huggingface/diffusers
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
huggingface/diffusers#15436 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
huggingface/diffusers#15433 ·
Maintainer antworten meist innerhalb von 1 Tag
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Evtl. vergeben @hparik11 hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
huggingface/diffusers#15423 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docs: 13 docstrings document parameters their functions don't haveEvtl. vergeben @M-Colley hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
huggingface/diffusers#15363 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorEvtl. vergeben @chessing234 hat das vor 11 Tagen übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
huggingface/diffusers#15337 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in huggingface/diffusers
Ähnliche Issues
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 79/100
developmentseed/titiler-covjson#164 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
awslabs/visual-asset-management-system#2164 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainer antworten meist innerhalb von 1 Tag
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag