[MiniMax-H3] TeaCache support and Cache-DiT validation (#5840)

Signed-off-by: dpeng123 <diyapeng123@gmail.com>
Signed-off-by: lishunyang12 <lishunyang12@163.com>
Co-authored-by: lishunyang12 <lishunyang12@163.com>
This commit is contained in:
Diya Pengandlishunyang12 authored and GitHub committed 2026-08-09 15:07:21 +00:00
1 parent fc8946fcf5
commit 45629a8e26
10 files changed
+669 -15

No files matched your search

+3 -1
View File
@@ -231,7 +231,9 @@ class TeaCacheHook(ModelHook):
state.accumulated_rel_l1_distance += abs(rescaled_distance)
# Decision: below threshold = cache, above = compute
if state.accumulated_rel_l1_distance < self.config.rel_l1_thresh:
rel_l1_thresh = self.config.rel_l1_thresh
assert rel_l1_thresh is not None
if state.accumulated_rel_l1_distance < rel_l1_thresh:
return False # Use cache
else:
state.accumulated_rel_l1_distance = 0.0 # Reset accumulator