simplify logic (#1856)
This commit is contained in:
@@ -589,15 +589,8 @@ def load_model(
|
|||||||
|
|
||||||
# sample packing uses custom FA2 patch
|
# sample packing uses custom FA2 patch
|
||||||
if cfg.flash_attention:
|
if cfg.flash_attention:
|
||||||
if not cfg.sample_packing:
|
if not cfg.sample_packing and cfg.s2_attention:
|
||||||
if cfg.s2_attention:
|
|
||||||
pass
|
pass
|
||||||
# most other models support flash attention, we can define exceptions as they come up
|
|
||||||
model_kwargs["attn_implementation"] = "flash_attention_2"
|
|
||||||
model_config._attn_implementation = ( # pylint: disable=protected-access
|
|
||||||
"flash_attention_2"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
model_kwargs["attn_implementation"] = "flash_attention_2"
|
model_kwargs["attn_implementation"] = "flash_attention_2"
|
||||||
model_config._attn_implementation = ( # pylint: disable=protected-access
|
model_config._attn_implementation = ( # pylint: disable=protected-access
|
||||||
"flash_attention_2"
|
"flash_attention_2"
|
||||||
|
|||||||
Reference in New Issue
Block a user