Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,15 +1,55 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
- kernels
|
| 5 |
---
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
Flash Attention is a fast and memory-efficient implementation of the
|
| 10 |
-
attention mechanism, designed to work with large models and long sequences.
|
| 11 |
-
This is a Hugging Face compliant kernel build of Flash Attention.
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: kernels
|
| 3 |
+
license: apache-2.0
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
+
<!-- This model card has automatically been generated. You
|
| 7 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
This is the repository card of {repo_id} that has been pushed on the Hub. It was built to be used with the [`kernels` library](https://github.com/huggingface/kernels). This card was automatically generated.
|
| 11 |
|
| 12 |
+
|
| 13 |
+
## How to use
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
# make sure `kernels` is installed: `pip install -U kernels`
|
| 17 |
+
from kernels import get_kernel
|
| 18 |
+
|
| 19 |
+
kernel_module = get_kernel("kernels-community/flash-attn3") # <- change the ID if needed
|
| 20 |
+
flash_attn_combine = kernel_module.flash_attn_combine
|
| 21 |
+
|
| 22 |
+
flash_attn_combine(...)
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
## Available functions
|
| 26 |
+
|
| 27 |
+
- `flash_attn_combine`
|
| 28 |
+
- `flash_attn_func`
|
| 29 |
+
- `flash_attn_qkvpacked_func`
|
| 30 |
+
- `flash_attn_varlen_func`
|
| 31 |
+
- `flash_attn_with_kvcache`
|
| 32 |
+
- `get_scheduler_metadata`
|
| 33 |
+
|
| 34 |
+
## Supported backends
|
| 35 |
+
|
| 36 |
+
- cuda
|
| 37 |
+
|
| 38 |
+
## CUDA Capabilities
|
| 39 |
+
|
| 40 |
+
- 8.0
|
| 41 |
+
- 9.0a
|
| 42 |
+
|
| 43 |
+
## Benchmarks
|
| 44 |
+
|
| 45 |
+
Benchmarking script is available for this kernel. Make sure to run `kernels benchmark org-id/repo-id` (replace "org-id" and "repo-id" with actual values).
|
| 46 |
+
|
| 47 |
+
[TODO: provide benchmarks if available]
|
| 48 |
+
|
| 49 |
+
## Source code
|
| 50 |
+
|
| 51 |
+
[TODO: provide original source code and other relevant citations if available]
|
| 52 |
+
|
| 53 |
+
## Notes
|
| 54 |
+
|
| 55 |
+
[TODO: provide additional notes about this kernel if needed]
|