[diffusion] perf: add QKV fusion optimization for Flux models (#14505)
Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user