refactor : use factory for attention backends
- register built-in backends through BaseFactory - derive benchmark choices from registered backends - cover string selection and invalid backend names
This commit is contained in:
@@ -18,6 +18,7 @@ SDPA is handled by the attention backend, not the wrapper functions.
|
||||
from astrai.extension.attention_backend import (
|
||||
ATTN_BACKEND,
|
||||
AttentionBackend,
|
||||
AttentionBackendFactory,
|
||||
CudaBackend,
|
||||
FlashAttnBackend,
|
||||
TorchNativeBackend,
|
||||
@@ -37,6 +38,7 @@ from astrai.extension.rotary_backend import apply_rotary_emb
|
||||
__all__ = [
|
||||
"ATTN_BACKEND",
|
||||
"AttentionBackend",
|
||||
"AttentionBackendFactory",
|
||||
"CudaBackend",
|
||||
"TorchNativeBackend",
|
||||
"FlashAttnBackend",
|
||||
|
||||
Reference in New Issue
Block a user