[diffusion] perf: add QKV fusion optimization for Flux models (#14505)

Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
Xiaoyu Zhang
2025-12-06 20:44:16 +08:00
committed by GitHub
parent 35a9a07370
commit 6d41791823
3 changed files with 152 additions and 9 deletions

View File

@@ -691,6 +691,11 @@ class TransformerLoader(ComponentLoader):
), "Model dtype does not match default dtype"
model = model.eval()
if hasattr(model, "fuse_qkv_projections"):
logger.info("Fusing QKV projections for better performance")
model.fuse_qkv_projections()
return model