Instructions to use kernels-community/flash-attn-ops with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/flash-attn-ops with Kernels:
# !pip install kernels from kernels import get_kernel kernel = get_kernel("kernels-community/flash-attn-ops") - Notebooks
- Google Colab
- Kaggle
Uploaded using `kernel-builder`.
Browse files
README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: kernels
|
| 3 |
+
license: bsd-3-clause
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
This is the repository card of kernels-community/flash-attn-ops 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.
|
| 7 |
+
|
| 8 |
+
## How to use
|
| 9 |
+
|
| 10 |
+
```python
|
| 11 |
+
# make sure `kernels` is installed: `pip install -U kernels`
|
| 12 |
+
from kernels import get_kernel
|
| 13 |
+
|
| 14 |
+
kernel_module = get_kernel("kernels-community/flash-attn-ops")
|
| 15 |
+
cross_entropy_loss = kernel_module.cross_entropy_loss
|
| 16 |
+
|
| 17 |
+
cross_entropy_loss(...)
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
## Available functions
|
| 21 |
+
- `cross_entropy_loss`
|
| 22 |
+
- `CrossEntropyLoss`
|
| 23 |
+
- `apply_rotary`
|
| 24 |
+
- `layer_norm_fn`
|
| 25 |
+
- `rms_norm_fn`
|
| 26 |
+
- `layer_norm_linear_fn`
|
| 27 |
+
- `LayerNormFn`
|
| 28 |
+
- `RMSNorm`
|
| 29 |
+
|
| 30 |
+
## Benchmarks
|
| 31 |
+
|
| 32 |
+
No benchmark available yet.
|