Instructions to use kernels-community/flash-attn2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/flash-attn2 with Kernels:
# !pip install kernels from kernels import get_kernel kernel = get_kernel("kernels-community/flash-attn2") - Notebooks
- Google Colab
- Kaggle
Build uploaded using `kernels`.
Browse files- build/torch210-cxx11-xpu20253-x86_64-linux/{_flash_attn2_588b404.abi3.so → _flash_attn2_660971e.abi3.so} +2 -2
- build/torch210-cxx11-xpu20253-x86_64-linux/_ops.py +3 -3
- build/torch210-cxx11-xpu20253-x86_64-linux/flash_attn_interface.py +3 -3
- build/torch29-cxx11-xpu20252-x86_64-linux/{_flash_attn2_588b404.abi3.so → _flash_attn2_660971e.abi3.so} +2 -2
- build/torch29-cxx11-xpu20252-x86_64-linux/_ops.py +3 -3
- build/torch29-cxx11-xpu20252-x86_64-linux/flash_attn_interface.py +3 -3
build/torch210-cxx11-xpu20253-x86_64-linux/{_flash_attn2_588b404.abi3.so → _flash_attn2_660971e.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29c0a6792979ae3880bd1cf1077d710b14fbd96b244665c75e4e7aaf65449a49
|
| 3 |
+
size 15424416
|
build/torch210-cxx11-xpu20253-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _flash_attn2_660971e
|
| 3 |
+
ops = torch.ops._flash_attn2_660971e
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_flash_attn2_660971e::{op_name}"
|
build/torch210-cxx11-xpu20253-x86_64-linux/flash_attn_interface.py
CHANGED
|
@@ -1064,7 +1064,7 @@ def flash_attn_qkvpacked_func(
|
|
| 1064 |
alibi_slopes,
|
| 1065 |
deterministic,
|
| 1066 |
return_attn_probs,
|
| 1067 |
-
|
| 1068 |
)
|
| 1069 |
|
| 1070 |
|
|
@@ -1142,7 +1142,7 @@ def flash_attn_kvpacked_func(
|
|
| 1142 |
alibi_slopes,
|
| 1143 |
deterministic,
|
| 1144 |
return_attn_probs,
|
| 1145 |
-
|
| 1146 |
)
|
| 1147 |
|
| 1148 |
|
|
@@ -1219,7 +1219,7 @@ def flash_attn_func(
|
|
| 1219 |
alibi_slopes,
|
| 1220 |
deterministic,
|
| 1221 |
return_attn_probs,
|
| 1222 |
-
|
| 1223 |
)
|
| 1224 |
|
| 1225 |
|
|
|
|
| 1064 |
alibi_slopes,
|
| 1065 |
deterministic,
|
| 1066 |
return_attn_probs,
|
| 1067 |
+
torch.is_grad_enabled(),
|
| 1068 |
)
|
| 1069 |
|
| 1070 |
|
|
|
|
| 1142 |
alibi_slopes,
|
| 1143 |
deterministic,
|
| 1144 |
return_attn_probs,
|
| 1145 |
+
torch.is_grad_enabled(),
|
| 1146 |
)
|
| 1147 |
|
| 1148 |
|
|
|
|
| 1219 |
alibi_slopes,
|
| 1220 |
deterministic,
|
| 1221 |
return_attn_probs,
|
| 1222 |
+
torch.is_grad_enabled(),
|
| 1223 |
)
|
| 1224 |
|
| 1225 |
|
build/torch29-cxx11-xpu20252-x86_64-linux/{_flash_attn2_588b404.abi3.so → _flash_attn2_660971e.abi3.so}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d2c3b732c7af702975d491dd792485a9dc9a68f41d8f6cdd9fca64045dd27b6
|
| 3 |
+
size 13907792
|
build/torch29-cxx11-xpu20252-x86_64-linux/_ops.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import torch
|
| 2 |
-
from . import
|
| 3 |
-
ops = torch.ops.
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
-
return f"
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from . import _flash_attn2_660971e
|
| 3 |
+
ops = torch.ops._flash_attn2_660971e
|
| 4 |
|
| 5 |
def add_op_namespace_prefix(op_name: str):
|
| 6 |
"""
|
| 7 |
Prefix op by namespace.
|
| 8 |
"""
|
| 9 |
+
return f"_flash_attn2_660971e::{op_name}"
|
build/torch29-cxx11-xpu20252-x86_64-linux/flash_attn_interface.py
CHANGED
|
@@ -1064,7 +1064,7 @@ def flash_attn_qkvpacked_func(
|
|
| 1064 |
alibi_slopes,
|
| 1065 |
deterministic,
|
| 1066 |
return_attn_probs,
|
| 1067 |
-
|
| 1068 |
)
|
| 1069 |
|
| 1070 |
|
|
@@ -1142,7 +1142,7 @@ def flash_attn_kvpacked_func(
|
|
| 1142 |
alibi_slopes,
|
| 1143 |
deterministic,
|
| 1144 |
return_attn_probs,
|
| 1145 |
-
|
| 1146 |
)
|
| 1147 |
|
| 1148 |
|
|
@@ -1219,7 +1219,7 @@ def flash_attn_func(
|
|
| 1219 |
alibi_slopes,
|
| 1220 |
deterministic,
|
| 1221 |
return_attn_probs,
|
| 1222 |
-
|
| 1223 |
)
|
| 1224 |
|
| 1225 |
|
|
|
|
| 1064 |
alibi_slopes,
|
| 1065 |
deterministic,
|
| 1066 |
return_attn_probs,
|
| 1067 |
+
torch.is_grad_enabled(),
|
| 1068 |
)
|
| 1069 |
|
| 1070 |
|
|
|
|
| 1142 |
alibi_slopes,
|
| 1143 |
deterministic,
|
| 1144 |
return_attn_probs,
|
| 1145 |
+
torch.is_grad_enabled(),
|
| 1146 |
)
|
| 1147 |
|
| 1148 |
|
|
|
|
| 1219 |
alibi_slopes,
|
| 1220 |
deterministic,
|
| 1221 |
return_attn_probs,
|
| 1222 |
+
torch.is_grad_enabled(),
|
| 1223 |
)
|
| 1224 |
|
| 1225 |
|