diffsynth-engine 0.5.1.dev2__py3-none-any.whl → 0.5.1.dev3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,12 +135,13 @@ def attention(
135
135
  flash_attn3_compatible = q.shape[-1] <= FA3_MAX_HEADDIM
136
136
  if attn_impl is None or attn_impl == "auto":
137
137
  if FLASH_ATTN_3_AVAILABLE:
138
- if flash_attn3_compatible:
138
+ if flash_attn3_compatible and attn_mask is None:
139
139
  return flash_attn3(q, k, v, softmax_scale=scale)
140
140
  else:
141
- logger.warning(
142
- f"head_dim={q.shape[-1]}, but flash_attn_3 only supports head dimension at most {FA3_MAX_HEADDIM}, will use fallback attention implementation"
143
- )
141
+ if not flash_attn3_compatible:
142
+ logger.warning(f"head_dim={q.shape[-1]}, but flash_attn_3 only supports head dimension at most {FA3_MAX_HEADDIM}, will use fallback attention implementation")
143
+ else:
144
+ logger.debug("flash_attn_3 does not support attention mask, will use fallback attention implementation")
144
145
  if XFORMERS_AVAILABLE:
145
146
  return xformers_attn(q, k, v, attn_mask=attn_mask, scale=scale)
146
147
  if SDPA_AVAILABLE:
@@ -156,6 +157,8 @@ def attention(
156
157
  raise RuntimeError(
157
158
  f"head_dim={q.shape[-1]}, but flash_attn_3 only supports head dimension at most {FA3_MAX_HEADDIM}"
158
159
  )
160
+ if attn_mask is not None:
161
+ raise RuntimeError("flash_attn_3 does not support attention mask")
159
162
  return flash_attn3(q, k, v, softmax_scale=scale)
160
163
  if attn_impl == "flash_attn_2":
161
164
  return flash_attn2(q, k, v, softmax_scale=scale)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffsynth_engine
3
- Version: 0.5.1.dev2
3
+ Version: 0.5.1.dev3
4
4
  Author: MuseAI x ModelScope
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Operating System :: OS Independent
@@ -84,7 +84,7 @@ diffsynth_engine/kernels/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
84
84
  diffsynth_engine/models/__init__.py,sha256=8Ze7cSE8InetgXWTNb0neVA2Q44K7WlE-h7O-02m2sY,119
85
85
  diffsynth_engine/models/base.py,sha256=PlBDpimIYnysjbvlIwsCDc0uyIAjdiTlwuOUFGdt-bk,2556
86
86
  diffsynth_engine/models/basic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- diffsynth_engine/models/basic/attention.py,sha256=H-LKiVD09GFj6hIwiIb5wiDS1HVCslN_TXgR7FrkUX4,10343
87
+ diffsynth_engine/models/basic/attention.py,sha256=Or57PjHGVOjjzSPUuH2nbuf5r_VtrVQYRiL1v5zT7T0,10646
88
88
  diffsynth_engine/models/basic/lora.py,sha256=PT-A3pwIuUrW2w3TnNlBPb1KRj70QYiBaoCvLnkR5cs,10652
89
89
  diffsynth_engine/models/basic/relative_position_emb.py,sha256=rCXOweZMcayVnNUVvBcYXMdhHS257B_PC8PZSWxvhNQ,2540
90
90
  diffsynth_engine/models/basic/timestep.py,sha256=WJODYqkSXEM0wcS42YkkfrGwxWt0e60zMTkDdUBQqBw,2810
@@ -181,8 +181,8 @@ diffsynth_engine/utils/video.py,sha256=Ne0rd2lb59UT1q5EotpjlY7OT8F9oTCFDyo1ST77u
181
181
  diffsynth_engine/utils/memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
182
  diffsynth_engine/utils/memory/linear_regression.py,sha256=oW_EQEw13oPoyUrxiL8A7Ksa5AuJ2ynI2qhCbfAuZbg,3930
183
183
  diffsynth_engine/utils/memory/memory_predcit_model.py,sha256=EXprSl_zlVjgfMWNXP-iw83Ot3hyMcgYaRPv-dvyL84,3943
184
- diffsynth_engine-0.5.1.dev2.dist-info/licenses/LICENSE,sha256=x7aBqQuVI0IYnftgoTPI_A0I_rjdjPPQkjnU6N2nikM,11346
185
- diffsynth_engine-0.5.1.dev2.dist-info/METADATA,sha256=MB7Kzzpm_b8MLnSKUJH5uzV4gFTc8pgEOpAziSHA70E,1117
186
- diffsynth_engine-0.5.1.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
187
- diffsynth_engine-0.5.1.dev2.dist-info/top_level.txt,sha256=6zgbiIzEHLbhgDKRyX0uBJOV3F6VnGGBRIQvSiYYn6w,17
188
- diffsynth_engine-0.5.1.dev2.dist-info/RECORD,,
184
+ diffsynth_engine-0.5.1.dev3.dist-info/licenses/LICENSE,sha256=x7aBqQuVI0IYnftgoTPI_A0I_rjdjPPQkjnU6N2nikM,11346
185
+ diffsynth_engine-0.5.1.dev3.dist-info/METADATA,sha256=Id8vzK6j6uuME5xZvpxh_nNXYu0dYJr_QP6m9Eu4WuY,1117
186
+ diffsynth_engine-0.5.1.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
187
+ diffsynth_engine-0.5.1.dev3.dist-info/top_level.txt,sha256=6zgbiIzEHLbhgDKRyX0uBJOV3F6VnGGBRIQvSiYYn6w,17
188
+ diffsynth_engine-0.5.1.dev3.dist-info/RECORD,,