From 422d8fd8f9313176802b792e41a30fcd286d6408 Mon Sep 17 00:00:00 2001 From: ooooooye <53851298+brandneway@users.noreply.github.com> Date: Mon, 10 Aug 2026 22:20:37 +0800 Subject: [PATCH] [Bugfix][Diffusion] Restore supports_packed_mask_free on teacache FakeBackend (#5997) Signed-off-by: brandneway Co-authored-by: Hongsheng Liu --- tests/diffusion/cache/test_teacache_extractors.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/diffusion/cache/test_teacache_extractors.py b/tests/diffusion/cache/test_teacache_extractors.py index db2ee7332..fdeca8e17 100644 --- a/tests/diffusion/cache/test_teacache_extractors.py +++ b/tests/diffusion/cache/test_teacache_extractors.py @@ -488,6 +488,14 @@ class _MiniMaxH3FakeAttention(nn.Module): class FakeBackend: supports_prefix_kv_slicing = False + # Mirror AttentionBackend.supports_packed_mask_free: H3's packed + # attention path calls attn_backend.supports_packed_mask_free() to decide + # whether to build the padding mask. Return False so the fake exercises + # the masked path (the abstract backend default). + @classmethod + def supports_packed_mask_free(cls) -> bool: + return False + def __init__(self, **kwargs): del kwargs super().__init__()