Kernels
kernels-bot commited on
Commit
e47d818
·
verified ·
1 Parent(s): 4442c86

Uploaded using `kernel-builder`.

Browse files
Files changed (1) hide show
  1. README.md +22 -4
README.md CHANGED
@@ -7,12 +7,30 @@ This is the repository card of kernels-community/flash-attn2 that has been pushe
7
 
8
  ## How to use
9
 
10
- Usage example not available.
 
 
11
 
12
- ## Available functions
 
 
 
 
13
 
14
- Function list not available.
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  ## Benchmarks
17
 
18
- Benchmarking script is available for this kernel. Run `kernels benchmark kernels-community/flash-attn2 --version 1`.
 
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-attn2", version=2)
15
+ flash_attn_func = kernel_module.flash_attn_func
16
+
17
+ flash_attn_func(...)
18
+ ```
19
 
20
+ ## Available functions
21
+ - `flash_attn_func`
22
+ - `flash_attn_kvpacked_func`
23
+ - `flash_attn_qkvpacked_func`
24
+ - `flash_attn_varlen_func`
25
+ - `flash_attn_varlen_kvpacked_func`
26
+ - `flash_attn_varlen_qkvpacked_func`
27
+ - `flash_attn_with_kvcache`
28
+ - `fwd`
29
+ - `varlen_fwd`
30
+ - `bwd`
31
+ - `varlen_bwd`
32
+ - `fwd_kvcache`
33
 
34
  ## Benchmarks
35
 
36
+ Benchmarking script is available for this kernel. Run `kernels benchmark kernels-community/flash-attn2 --version 2`.