JonathanColetti commited on
Commit
5bedd16
·
verified ·
1 Parent(s): 92748f7

drop the SDPA backend override: it made no difference to peak memory

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -29,14 +29,11 @@ import os
29
  # allocator. Set it explicitly so a platform default cannot turn it back on.
30
  os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:False"
31
 
32
- # wan21_patches/modules/attention.py pins SDPA's backend order with cuDNN first,
33
- # from timings taken on an sm_100 B200 with torch 2.13. This Space is sm_120 on
34
- # torch 2.11, where that order falls through to the MATH backend: it materialises
35
- # the whole [B, 12, 2760, 29440] score matrix, and one block forward peaks at
36
- # 44.2 GB against a 47.4 GB slice. The memory-efficient fused kernel handles both
37
- # shapes this model attends over -- unmasked self-attention against the K/V cache,
38
- # and key-padded cross-attention -- in linear memory.
39
- os.environ.setdefault("WAN_SDPA_BACKEND", "EFFICIENT_ATTENTION")
40
 
41
  import queue
42
  import shutil
 
29
  # allocator. Set it explicitly so a platform default cannot turn it back on.
30
  os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:False"
31
 
32
+ # The SDPA backend order that wan21_patches/modules/attention.py pins (cuDNN first)
33
+ # is left alone. Forcing EFFICIENT_ATTENTION here was tried, on the theory that this
34
+ # sm_120 / torch 2.11 runtime was falling through to the MATH backend; it changed the
35
+ # peak not at all (44.2 GB either way), so the backend is not the problem and the
36
+ # project's own measured order stands.
 
 
 
37
 
38
  import queue
39
  import shutil