Commit c74b88e
authored
[FA] Add option to specify tuning parameters (intel#3293)
Add option specifying tuning parameters. Users can override default
parameters passing a list of options to autotune from. This way, passing
`-BLOCK-M 64 32 128` would mean these values for `BLOCK_M` are used for
autotuning.
Also split options in two different option groups so the help string
looks something like:
```
usage: flash-attention [-h] -Z Z -H H -N-CTX N_CTX -D-HEAD D_HEAD [-causal] [-backward] [-BLOCK-M BLOCK_M [BLOCK_M ...]] [-BLOCK-N BLOCK_N [BLOCK_N ...]] [-stages STAGES [STAGES ...]] [-warps WARPS [WARPS ...]]
Run Intel XPU Flash-Attention implementation
options:
-h, --help show this help message and exit
Model description:
Options setting different model metaparameters
-Z Z Batch size
-H H Head count
-N-CTX N_CTX Sequence length
-D-HEAD D_HEAD Embedding dimension
-causal Run causal attention
-backward Run backward attention
Tuning configuration:
Options setting different tuning parameters
-BLOCK-M BLOCK_M [BLOCK_M ...]
Sizes of M
-BLOCK-N BLOCK_N [BLOCK_N ...]
Sizes of N
-stages STAGES [STAGES ...]
Numbers of stages
-warps WARPS [WARPS ...]
Numbers of warps
```
---------
Signed-off-by: victor-eds <[email protected]>1 parent 0234248 commit c74b88e
1 file changed
+37
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
22 | 49 | | |
23 | 50 | | |
24 | 51 | | |
| |||
27 | 54 | | |
28 | 55 | | |
29 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
30 | 60 | | |
31 | 61 | | |
32 | 62 | | |
| |||
0 commit comments