Instructions to use replicate/sgl-flash-attn3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/sgl-flash-attn3 with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("replicate/sgl-flash-attn3", version=1) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,7 +19,7 @@ pip install kernels
|
|
| 19 |
```python
|
| 20 |
from kernels import get_kernel
|
| 21 |
|
| 22 |
-
fa3 = get_kernel("kernels-community/sgl-flash-attn3", revision="
|
| 23 |
|
| 24 |
fa3.flash_attn_varlen_func(q, k, v, cu_seqlens_q, cu_seqlens_k, causal=True)
|
| 25 |
fa3.flash_attn_with_kvcache(q, k_cache, v_cache, cache_seqlens=cache_seqlens, causal=True)
|
|
@@ -39,7 +39,7 @@ from sgl_kernel.flash_attn import flash_attn_with_kvcache as flash_attn_with_kvc
|
|
| 39 |
Replace with:
|
| 40 |
```python
|
| 41 |
from kernels import get_kernel
|
| 42 |
-
_fa3_mod = get_kernel("kernels-community/sgl-flash-attn3", revision="
|
| 43 |
flash_attn_varlen_func_fa3 = _fa3_mod.flash_attn_varlen_func
|
| 44 |
flash_attn_with_kvcache_fa3 = _fa3_mod.flash_attn_with_kvcache
|
| 45 |
```
|
|
|
|
| 19 |
```python
|
| 20 |
from kernels import get_kernel
|
| 21 |
|
| 22 |
+
fa3 = get_kernel("kernels-community/sgl-flash-attn3", revision="V1")
|
| 23 |
|
| 24 |
fa3.flash_attn_varlen_func(q, k, v, cu_seqlens_q, cu_seqlens_k, causal=True)
|
| 25 |
fa3.flash_attn_with_kvcache(q, k_cache, v_cache, cache_seqlens=cache_seqlens, causal=True)
|
|
|
|
| 39 |
Replace with:
|
| 40 |
```python
|
| 41 |
from kernels import get_kernel
|
| 42 |
+
_fa3_mod = get_kernel("kernels-community/sgl-flash-attn3", revision="V1")
|
| 43 |
flash_attn_varlen_func_fa3 = _fa3_mod.flash_attn_varlen_func
|
| 44 |
flash_attn_with_kvcache_fa3 = _fa3_mod.flash_attn_with_kvcache
|
| 45 |
```
|