torch.nn.attention.activate_flash_attention_impl
- torch.nn.attention.activate_flash_attention_impl(impl)
Activate into the dispatcher a previously registered flash attention impl.
- Parameters
Activate into the dispatcher a previously registered flash attention impl.
impl (str | Literal['FA3', 'FA4']) – Implementation identifier to activate. See
list_flash_attention_impls() for available
implementations.
If the backend’s register_flash_attention_impl() callable
returns a FlashAttentionHandle, the registry keeps that
handle alive for the lifetime of the process (until explicit
uninstall support exists).
>>> activate_flash_attention_impl("FA4")