Skip to content

Commit 4cae178

Browse files
authored
feat: Add seq offload for 🔥FLUX.2 w/o parallel (#490)
* feat: support hybrid cache + tp for flux.2 * feat: enable seq offload for FLUX.2 w/ GPU=1
1 parent 54461e5 commit 4cae178

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/parallelism/run_flux2_tp.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@
7676

7777
if world_size < 4 and GiB() <= 48:
7878
assert not args.compile, "Compilation requires more GPU memory. Please disable it."
79-
pipe.enable_model_cpu_offload(device=device)
80-
print("Enabled model CPU offload.")
79+
if world_size < 2:
80+
pipe.enable_sequential_cpu_offload(device=device)
81+
print("Enabled sequential CPU offload.")
82+
else:
83+
pipe.enable_model_cpu_offload(device=device)
84+
print("Enabled model CPU offload.")
8185
else:
8286
pipe.to(device)
8387

0 commit comments

Comments
 (0)