Replies: 1 comment
|
Confirmed facts (from current main source):
Because I cannot run your full pipeline, the following are hypotheses to check, roughly in order of likelihood, not verified facts:
Minimal diagnostic to isolate the cause before touching your optimizer loop: python with torch.enable_grad(): If out.requires_grad is already False right after the forward call (before you even touch AttentionStore), the break is upstream of your processor (case 1 or 2). If out.requires_grad is True but probs/store.accumulator still doesn't require grad, the break is in which attention module received the processor (case 3). To narrow this further, please share: diffusers version (pip show diffusers), whether enable_model_cpu_offload/enable_sequential_cpu_offload is used, and the exact code that produces latents before optimize() is called (in particular, whether it comes from inside a torch.no_grad()/torch.inference_mode() context). |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm trying to capture the model prompt cross attention in order to apply some latent optimization techniques during inference, but for some reason I'm getting latents.grad as None no matter what I'm trying. I'll add small code snippets to describe what I'm trying to do:
Hoped someone can point me to my issue, I have a feeling the the captured attention are not affecting the latents during the forward (graph computation).
All reactions