ComfyUI/comfy/ldm/modules
Scott Yewell 55760cdeb5 attention_pytorch: skip the chunk buffer/copy when steps==1
Addresses CodeRabbit feedback on #14838: the chunking loop always
allocated a temporary output buffer and copied SDPA's result into it,
even in the common case (any non-MPS device, or MPS below the size
threshold) where steps==1 and the loop only ever runs once. Adds a
fast path that calls scaled_dot_product_attention directly and
reshapes its result, matching the original pre-fix code for that case
-- no extra allocation or copy. The chunked path (steps>1) is
unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HAMqHgFBD6e9wjU8k8U6uW
2026-07-08 16:31:12 -04:00
..
diffusionmodules Revert "Add SeedVR2 support (CORE-6) (#14110)" (#14359) 2026-06-08 18:00:20 -04:00
distributions Small optimizations. 2024-12-18 18:23:28 -05:00
encoders Remove dead code. (#13251) 2026-04-01 20:22:06 -04:00
attention.py attention_pytorch: skip the chunk buffer/copy when steps==1 2026-07-08 16:31:12 -04:00
ema.py New Year ruff cleanup. (#11595) 2026-01-01 22:06:14 -05:00
sdpose.py SDPose: resize input always (#13349) 2026-04-10 11:26:55 -10:00
sub_quadratic_attention.py Widen OOM_EXCEPTION to AcceleratorError form (#12835) 2026-03-10 00:41:02 -04:00
temporal_ae.py Basic Hunyuan Video model support. 2024-12-16 19:35:40 -05:00