scheduler.py 910 Bytes
Newer Older
PengGao's avatar
PengGao committed
1
2
from ..scheduler import HunyuanScheduler

helloyongyang's avatar
helloyongyang committed
3

4
class HunyuanSchedulerTeaCaching(HunyuanScheduler):
helloyongyang's avatar
helloyongyang committed
5
6
    def __init__(self, config):
        super().__init__(config)
Dongz's avatar
Dongz committed
7

8
    def clear(self):
Yang Yong(雍洋)'s avatar
Yang Yong(雍洋) committed
9
        self.transformer_infer.clear()
helloyongyang's avatar
helloyongyang committed
10
11


12
class HunyuanSchedulerTaylorCaching(HunyuanScheduler):
helloyongyang's avatar
helloyongyang committed
13
14
    def __init__(self, config):
        super().__init__(config)
Yang Yong(雍洋)'s avatar
Yang Yong(雍洋) committed
15
16
17
18
19
20
21
22
23
24
        pattern = [True, False, False, False]
        self.caching_records = (pattern * ((config.infer_steps + 3) // 4))[: config.infer_steps]

    def clear(self):
        self.transformer_infer.clear()


class HunyuanSchedulerAdaCaching(HunyuanScheduler):
    def __init__(self, config):
        super().__init__(config)
helloyongyang's avatar
helloyongyang committed
25

Yang Yong(雍洋)'s avatar
Yang Yong(雍洋) committed
26
27
28
29
30
31
32
33
34
35
    def clear(self):
        self.transformer_infer.clear()


class HunyuanSchedulerCustomCaching(HunyuanScheduler):
    def __init__(self, config):
        super().__init__(config)

    def clear(self):
        self.transformer_infer.clear()