Spaces:
Running on Zero
Running on Zero
drop the SDPA backend override: it made no difference to peak memory
Browse files
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
|
| 33 |
-
#
|
| 34 |
-
# torch 2.11
|
| 35 |
-
#
|
| 36 |
-
#
|
| 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
|