Skip to content

Commit 11ee0fe

Browse files
am17anggerganov
andauthored
Docs: script to auto-generate ggml operations docs (#14598)
* Docs: script to auto-generate ggml operations docs * Review: formatting changes + change github action * Use built-in types instead of typing * docs : add BLAS and Metal ops --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
1 parent a457551 commit 11ee0fe

File tree

8 files changed

+26572
-12
lines changed

8 files changed

+26572
-12
lines changed

.github/workflows/update-ops-docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Update Operations Documentation
2+
3+
on:
4+
push:
5+
paths:
6+
- 'docs/ops/**'
7+
- 'scripts/create_ops_docs.py'
8+
pull_request:
9+
paths:
10+
- 'docs/ops/**'
11+
- 'scripts/create_ops_docs.py'
12+
13+
jobs:
14+
update-ops-docs:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.x'
25+
26+
- name: Generate operations documentation to temporary file
27+
run: |
28+
mkdir -p /tmp/ops_check
29+
./scripts/create_ops_docs.py /tmp/ops_check/ops.md
30+
31+
- name: Check if docs/ops.md matches generated version
32+
run: |
33+
if ! diff -q docs/ops.md /tmp/ops_check/ops.md; then
34+
echo "Operations documentation (docs/ops.md) is not up to date with the backend CSV files."
35+
echo "To fix: run ./scripts/create_ops_docs.py and commit the updated docs/ops.md along with your changes"
36+
echo "Differences found:"
37+
diff docs/ops.md /tmp/ops_check/ops.md || true
38+
exit 1
39+
fi
40+
echo "Operations documentation is up to date."

docs/ops.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# GGML Operations
2+
3+
List of GGML operations and backend support status.
4+
5+
Legend:
6+
- ✅ Fully supported by this backend
7+
- 🟡 Partially supported by this backend
8+
- ❌ Not supported by this backend
9+
10+
| Operation | BLAS | CPU | CUDA | Metal |
11+
|-----------|------|------|------|------|
12+
| ABS ||| 🟡 ||
13+
| ACC |||||
14+
| ADD |||| 🟡 |
15+
| ADD1 |||||
16+
| ARANGE |||||
17+
| ARGMAX |||||
18+
| ARGSORT |||||
19+
| CLAMP |||| 🟡 |
20+
| CONCAT ||| 🟡 ||
21+
| CONT ||| 🟡 ||
22+
| CONV_2D_DW |||||
23+
| CONV_TRANSPOSE_1D |||||
24+
| CONV_TRANSPOSE_2D |||||
25+
| COS |||| 🟡 |
26+
| COUNT_EQUAL |||||
27+
| CPY || 🟡 | 🟡 | 🟡 |
28+
| CROSS_ENTROPY_LOSS |||||
29+
| CROSS_ENTROPY_LOSS_BACK |||||
30+
| DIAG_MASK_INF |||| 🟡 |
31+
| DIV |||| 🟡 |
32+
| DUP ||| 🟡 | 🟡 |
33+
| ELU |||| 🟡 |
34+
| EXP ||| 🟡 ||
35+
| FLASH_ATTN_EXT ||| 🟡 | 🟡 |
36+
| GATED_LINEAR_ATTN |||||
37+
| GEGLU |||| 🟡 |
38+
| GEGLU_ERF |||| 🟡 |
39+
| GEGLU_QUICK |||| 🟡 |
40+
| GELU ||| 🟡 | 🟡 |
41+
| GELU_ERF ||| 🟡 | 🟡 |
42+
| GELU_QUICK ||| 🟡 | 🟡 |
43+
| GET_ROWS ||| 🟡 ||
44+
| GET_ROWS_BACK || 🟡 | 🟡 ||
45+
| GROUP_NORM |||||
46+
| HARDSIGMOID ||| 🟡 ||
47+
| HARDSWISH ||| 🟡 ||
48+
| IM2COL |||| 🟡 |
49+
| L2_NORM |||||
50+
| LEAKY_RELU |||||
51+
| LOG |||||
52+
| MEAN |||||
53+
| MUL |||| 🟡 |
54+
| MUL_MAT | 🟡 | 🟡 | 🟡 | 🟡 |
55+
| MUL_MAT_ID |||||
56+
| NEG ||| 🟡 | 🟡 |
57+
| NORM |||| 🟡 |
58+
| OPT_STEP_ADAMW |||||
59+
| OUT_PROD | 🟡 | 🟡 | 🟡 ||
60+
| PAD |||||
61+
| PAD_REFLECT_1D |||||
62+
| POOL_2D |||||
63+
| REGLU |||| 🟡 |
64+
| RELU ||| 🟡 | 🟡 |
65+
| REPEAT ||| 🟡 ||
66+
| REPEAT_BACK |||||
67+
| RMS_NORM |||| 🟡 |
68+
| RMS_NORM_BACK |||||
69+
| RMS_NORM_MUL |||||
70+
| ROPE |||||
71+
| ROPE_BACK |||||
72+
| RWKV_WKV6 |||||
73+
| RWKV_WKV7 |||||
74+
| SCALE |||||
75+
| SET |||||
76+
| SET_ROWS || 🟡 || 🟡 |
77+
| SGN ||| 🟡 ||
78+
| SIGMOID ||| 🟡 | 🟡 |
79+
| SILU ||| 🟡 | 🟡 |
80+
| SILU_BACK |||||
81+
| SIN |||| 🟡 |
82+
| SOFT_MAX |||||
83+
| SOFT_MAX_BACK || 🟡 | 🟡 ||
84+
| SQR |||| 🟡 |
85+
| SQRT |||| 🟡 |
86+
| SSM_CONV |||||
87+
| SSM_SCAN |||||
88+
| STEP ||| 🟡 ||
89+
| SUB |||| 🟡 |
90+
| SUM |||||
91+
| SUM_ROWS |||||
92+
| SWIGLU |||| 🟡 |
93+
| TANH ||| 🟡 | 🟡 |
94+
| TIMESTEP_EMBEDDING |||||
95+
| UPSCALE |||| 🟡 |

0 commit comments

Comments
 (0)