-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
65 lines (59 loc) · 1.46 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import itertools
import subprocess
# Define the possible values for each argument
ckpt_ids = [
# "stabilityai/stable-diffusion-3-medium-diffusers",
# "PixArt-alpha/PixArt-Sigma-XL-2-1024-MS",
# "fal/AuraFlow",
"black-forest-labs/FLUX.1-dev",
"black-forest-labs/FLUX.1-schnell",
]
torch_dtypes = [
# "fp32",
"fp16",
"bf16",
]
qtypes = ["fp8", "int8", "int4", "none"]
batch_sizes = [1] # You can add more sizes if needed
qte_options = [0, 1]
fuse_options = [0, 1]
exclude_layers_options = [
[],
# ["layer1"],
# ["layer2"],
# ["layer1", "layer2"],
] # Adjust as needed
# Generate all combinations of the arguments
combinations = itertools.product(
ckpt_ids,
torch_dtypes,
qtypes,
batch_sizes,
qte_options,
fuse_options,
exclude_layers_options,
)
# Run benchmark.py for each combination
for combination in combinations:
ckpt_id, torch_dtype, qtype, batch_size, qte, fuse, exclude_layers = combination
exclude_layers_str = " ".join(exclude_layers)
command = [
"python",
"benchmark.py",
"--ckpt_id",
ckpt_id,
"--torch_dtype",
torch_dtype,
"--qtype",
qtype,
"--batch_size",
str(batch_size),
"--qte",
str(qte),
"--fuse",
str(fuse),
]
if exclude_layers_str:
command.extend(["--exclude_layers"] + exclude_layers)
print(f"Running: {' '.join(command)}")
subprocess.run(command)