Skip to content

Commit 6950062

Browse files
committed
chore: remove non-functional cache preset support
1 parent c2b4a2e commit 6950062

5 files changed

Lines changed: 1 addition & 113 deletions

File tree

docs/caching.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Uses Taylor series approximation to predict block outputs:
8080
Combines DBCache and TaylorSeer:
8181

8282
```bash
83-
--cache-mode cache-dit --cache-preset fast
83+
--cache-mode cache-dit
8484
```
8585

8686
#### Parameters
@@ -92,14 +92,6 @@ Combines DBCache and TaylorSeer:
9292
| `threshold` | L1 residual difference threshold | 0.08 |
9393
| `warmup` | Steps before caching starts | 8 |
9494

95-
#### Presets
96-
97-
Available presets: `slow`, `medium`, `fast`, `ultra` (or `s`, `m`, `f`, `u`).
98-
99-
```bash
100-
--cache-mode cache-dit --cache-preset fast
101-
```
102-
10395
#### SCM Options
10496

10597
Steps Computation Mask controls which steps can be cached:

examples/cli/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ Generation Options:
144144
threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=;
145145
spectrum: w=,m=,lam=,window=,flex=,warmup=,stop=. Examples:
146146
"threshold=0.25" or "threshold=1.5,reset=0" or "w=0.4,window=2"
147-
--cache-preset cache-dit preset: 'slow'/'s', 'medium'/'m', 'fast'/'f', 'ultra'/'u'
148147
--scm-mask SCM steps mask for cache-dit: comma-separated 0/1 (e.g., "1,1,1,0,0,1,0,0,1,0") - 1=compute, 0=can cache
149148
--scm-policy SCM policy: 'dynamic' (default) or 'static'
150149
```

examples/common/common.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,6 @@ struct SDGenerationParams {
10471047

10481048
std::string cache_mode;
10491049
std::string cache_option;
1050-
std::string cache_preset;
10511050
std::string scm_mask;
10521051
bool scm_policy_dynamic = true;
10531052
sd_cache_params_t cache_params{};
@@ -1461,21 +1460,6 @@ struct SDGenerationParams {
14611460
return 1;
14621461
};
14631462

1464-
auto on_cache_preset_arg = [&](int argc, const char** argv, int index) {
1465-
if (++index >= argc) {
1466-
return -1;
1467-
}
1468-
cache_preset = argv_to_utf8(index, argv);
1469-
if (cache_preset != "slow" && cache_preset != "s" && cache_preset != "S" &&
1470-
cache_preset != "medium" && cache_preset != "m" && cache_preset != "M" &&
1471-
cache_preset != "fast" && cache_preset != "f" && cache_preset != "F" &&
1472-
cache_preset != "ultra" && cache_preset != "u" && cache_preset != "U") {
1473-
fprintf(stderr, "error: invalid cache preset '%s', must be 'slow'/'s', 'medium'/'m', 'fast'/'f', or 'ultra'/'u'\n", cache_preset.c_str());
1474-
return -1;
1475-
}
1476-
return 1;
1477-
};
1478-
14791463
options.manual_options = {
14801464
{"-s",
14811465
"--seed",
@@ -1519,10 +1503,6 @@ struct SDGenerationParams {
15191503
"--cache-option",
15201504
"named cache params (key=value format, comma-separated). easycache/ucache: threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=. Examples: \"threshold=0.25\" or \"threshold=1.5,reset=0\"",
15211505
on_cache_option_arg},
1522-
{"",
1523-
"--cache-preset",
1524-
"cache-dit preset: 'slow'/'s', 'medium'/'m', 'fast'/'f', 'ultra'/'u'",
1525-
on_cache_preset_arg},
15261506
{"",
15271507
"--scm-mask",
15281508
"SCM steps mask for cache-dit: comma-separated 0/1 (e.g., \"1,1,1,0,0,1,0,0,1,0\") - 1=compute, 0=can cache",
@@ -1575,7 +1555,6 @@ struct SDGenerationParams {
15751555
load_if_exists("negative_prompt", negative_prompt);
15761556
load_if_exists("cache_mode", cache_mode);
15771557
load_if_exists("cache_option", cache_option);
1578-
load_if_exists("cache_preset", cache_preset);
15791558
load_if_exists("scm_mask", scm_mask);
15801559

15811560
load_if_exists("clip_skip", clip_skip);

examples/server/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ Default Generation Options:
133133
--cache-option named cache params (key=value format, comma-separated). easycache/ucache:
134134
threshold=,start=,end=,decay=,relative=,reset=; dbcache/taylorseer/cache-dit: Fn=,Bn=,threshold=,warmup=. Examples:
135135
"threshold=0.25" or "threshold=1.5,reset=0"
136-
--cache-preset cache-dit preset: 'slow'/'s', 'medium'/'m', 'fast'/'f', 'ultra'/'u'
137136
--scm-mask SCM steps mask for cache-dit: comma-separated 0/1 (e.g., "1,1,1,0,0,1,0,0,1,0") - 1=compute, 0=can cache
138137
--scm-policy SCM policy: 'dynamic' (default) or 'static'
139138
```

src/cache_dit.hpp

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -603,87 +603,6 @@ inline std::vector<int> generate_scm_mask(
603603
return mask;
604604
}
605605

606-
inline std::vector<int> get_scm_preset(const std::string& preset, int total_steps) {
607-
struct Preset {
608-
std::vector<int> compute_bins;
609-
std::vector<int> cache_bins;
610-
};
611-
612-
Preset slow = {{8, 3, 3, 2, 1, 1}, {1, 2, 2, 2, 3}};
613-
Preset medium = {{6, 2, 2, 2, 2, 1}, {1, 3, 3, 3, 3}};
614-
Preset fast = {{6, 1, 1, 1, 1, 1}, {1, 3, 4, 5, 4}};
615-
Preset ultra = {{4, 1, 1, 1, 1}, {2, 5, 6, 7}};
616-
617-
Preset* p = nullptr;
618-
if (preset == "slow" || preset == "s" || preset == "S")
619-
p = &slow;
620-
else if (preset == "medium" || preset == "m" || preset == "M")
621-
p = &medium;
622-
else if (preset == "fast" || preset == "f" || preset == "F")
623-
p = &fast;
624-
else if (preset == "ultra" || preset == "u" || preset == "U")
625-
p = &ultra;
626-
else
627-
return {};
628-
629-
if (total_steps != 28 && total_steps > 0) {
630-
float scale = static_cast<float>(total_steps) / 28.0f;
631-
std::vector<int> scaled_compute, scaled_cache;
632-
633-
for (int v : p->compute_bins) {
634-
scaled_compute.push_back(std::max(1, static_cast<int>(v * scale + 0.5f)));
635-
}
636-
for (int v : p->cache_bins) {
637-
scaled_cache.push_back(std::max(1, static_cast<int>(v * scale + 0.5f)));
638-
}
639-
640-
return generate_scm_mask(scaled_compute, scaled_cache, total_steps);
641-
}
642-
643-
return generate_scm_mask(p->compute_bins, p->cache_bins, total_steps);
644-
}
645-
646-
inline float get_preset_threshold(const std::string& preset) {
647-
if (preset == "slow" || preset == "s" || preset == "S")
648-
return 0.20f;
649-
if (preset == "medium" || preset == "m" || preset == "M")
650-
return 0.25f;
651-
if (preset == "fast" || preset == "f" || preset == "F")
652-
return 0.30f;
653-
if (preset == "ultra" || preset == "u" || preset == "U")
654-
return 0.34f;
655-
return 0.08f;
656-
}
657-
658-
inline int get_preset_warmup(const std::string& preset) {
659-
if (preset == "slow" || preset == "s" || preset == "S")
660-
return 8;
661-
if (preset == "medium" || preset == "m" || preset == "M")
662-
return 6;
663-
if (preset == "fast" || preset == "f" || preset == "F")
664-
return 6;
665-
if (preset == "ultra" || preset == "u" || preset == "U")
666-
return 4;
667-
return 8;
668-
}
669-
670-
inline int get_preset_Fn(const std::string& preset) {
671-
if (preset == "slow" || preset == "s" || preset == "S")
672-
return 8;
673-
if (preset == "medium" || preset == "m" || preset == "M")
674-
return 8;
675-
if (preset == "fast" || preset == "f" || preset == "F")
676-
return 6;
677-
if (preset == "ultra" || preset == "u" || preset == "U")
678-
return 4;
679-
return 8;
680-
}
681-
682-
inline int get_preset_Bn(const std::string& preset) {
683-
(void)preset;
684-
return 0;
685-
}
686-
687606
inline void parse_dbcache_options(const std::string& opts, DBCacheConfig& cfg) {
688607
if (opts.empty())
689608
return;

0 commit comments

Comments
 (0)