-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Docs: script to auto-generate ggml operations docs #14598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Update Operations Documentation | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/ops/**' | ||
- 'scripts/create_ops_docs.py' | ||
pull_request: | ||
paths: | ||
- 'docs/ops/**' | ||
- 'scripts/create_ops_docs.py' | ||
|
||
jobs: | ||
update-ops-docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Generate operations documentation to temporary file | ||
run: | | ||
mkdir -p /tmp/ops_check | ||
./scripts/create_ops_docs.py /tmp/ops_check/ops.md | ||
|
||
- name: Check if docs/ops.md matches generated version | ||
run: | | ||
if ! diff -q docs/ops.md /tmp/ops_check/ops.md; then | ||
echo "Operations documentation (docs/ops.md) is not up to date with the backend CSV files." | ||
echo "To fix: run ./scripts/create_ops_docs.py and commit the updated docs/ops.md along with your changes" | ||
echo "Differences found:" | ||
diff docs/ops.md /tmp/ops_check/ops.md || true | ||
exit 1 | ||
fi | ||
echo "Operations documentation is up to date." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# GGML Operations | ||
|
||
List of GGML operations and backend support status. | ||
|
||
Legend: | ||
- ✅ Fully supported by this backend | ||
- 🟡 Partially supported by this backend | ||
- ❌ Not supported by this backend | ||
|
||
| Operation | CPU | CUDA | | ||
|-----------|------|------| | ||
| ABS | ✅ | 🟡 | | ||
| ACC | ✅ | ✅ | | ||
| ADD | ✅ | ✅ | | ||
| ADD1 | ✅ | ✅ | | ||
| ARANGE | ✅ | ✅ | | ||
| ARGMAX | ✅ | ✅ | | ||
| ARGSORT | ✅ | ✅ | | ||
| CLAMP | ✅ | ✅ | | ||
| CONCAT | ✅ | 🟡 | | ||
| CONT | ✅ | 🟡 | | ||
| CONV_2D_DW | ✅ | ✅ | | ||
| CONV_TRANSPOSE_1D | ✅ | ✅ | | ||
| CONV_TRANSPOSE_2D | ✅ | ✅ | | ||
| COS | ✅ | ✅ | | ||
| COUNT_EQUAL | ✅ | ✅ | | ||
| CPY | 🟡 | 🟡 | | ||
| CROSS_ENTROPY_LOSS | ✅ | ✅ | | ||
| CROSS_ENTROPY_LOSS_BACK | ✅ | ✅ | | ||
| DIAG_MASK_INF | ✅ | ✅ | | ||
| DIV | ✅ | ✅ | | ||
| DUP | ✅ | 🟡 | | ||
| ELU | ✅ | ❌ | | ||
| EXP | ✅ | 🟡 | | ||
| FLASH_ATTN_EXT | ✅ | 🟡 | | ||
| GATED_LINEAR_ATTN | ✅ | ✅ | | ||
| GEGLU | ✅ | ✅ | | ||
| GEGLU_ERF | ✅ | ✅ | | ||
| GEGLU_QUICK | ✅ | ✅ | | ||
| GELU | ✅ | 🟡 | | ||
| GELU_ERF | ✅ | 🟡 | | ||
| GELU_QUICK | ✅ | 🟡 | | ||
| GET_ROWS | ✅ | 🟡 | | ||
| GET_ROWS_BACK | 🟡 | 🟡 | | ||
| GROUP_NORM | ✅ | ✅ | | ||
| HARDSIGMOID | ✅ | 🟡 | | ||
| HARDSWISH | ✅ | 🟡 | | ||
| IM2COL | ✅ | ✅ | | ||
| L2_NORM | ✅ | ✅ | | ||
| LEAKY_RELU | ✅ | ✅ | | ||
| LOG | ✅ | ✅ | | ||
| MEAN | ✅ | ✅ | | ||
| MUL | ✅ | ✅ | | ||
| MUL_MAT | 🟡 | 🟡 | | ||
| MUL_MAT_ID | ✅ | ✅ | | ||
| NEG | ✅ | 🟡 | | ||
| NORM | ✅ | ✅ | | ||
| OPT_STEP_ADAMW | ✅ | ✅ | | ||
| OUT_PROD | 🟡 | 🟡 | | ||
| PAD | ✅ | ✅ | | ||
| PAD_REFLECT_1D | ✅ | ❌ | | ||
| POOL_2D | ✅ | ✅ | | ||
| REGLU | ✅ | ✅ | | ||
| RELU | ✅ | 🟡 | | ||
| REPEAT | ✅ | 🟡 | | ||
| REPEAT_BACK | ✅ | ✅ | | ||
| RMS_NORM | ✅ | ✅ | | ||
| RMS_NORM_BACK | ✅ | ✅ | | ||
| RMS_NORM_MUL | ✅ | ✅ | | ||
| ROPE | ✅ | ✅ | | ||
| ROPE_BACK | ✅ | ✅ | | ||
| RWKV_WKV6 | ✅ | ✅ | | ||
| RWKV_WKV7 | ✅ | ✅ | | ||
| SCALE | ✅ | ✅ | | ||
| SET | ✅ | ❌ | | ||
| SET_ROWS | 🟡 | ❌ | | ||
| SGN | ✅ | 🟡 | | ||
| SIGMOID | ✅ | 🟡 | | ||
| SILU | ✅ | 🟡 | | ||
| SILU_BACK | ✅ | ✅ | | ||
| SIN | ✅ | ✅ | | ||
| SOFT_MAX | ✅ | ✅ | | ||
| SOFT_MAX_BACK | 🟡 | 🟡 | | ||
| SQR | ✅ | ✅ | | ||
| SQRT | ✅ | ✅ | | ||
| SSM_CONV | ✅ | ✅ | | ||
| SSM_SCAN | ✅ | ✅ | | ||
| STEP | ✅ | 🟡 | | ||
| SUB | ✅ | ✅ | | ||
| SUM | ✅ | ✅ | | ||
| SUM_ROWS | ✅ | ✅ | | ||
| SWIGLU | ✅ | ✅ | | ||
| TANH | ✅ | 🟡 | | ||
| TIMESTEP_EMBEDDING | ✅ | ✅ | | ||
| UPSCALE | ✅ | ✅ | |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can test this in your own fork, but adding commits will be trickier than this. It may be preferable to only check if the document is out of date, and fail the job if it is not, but not actually update it.
server.yml
does this for the WebUI bundle file.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we don't necessarily need to commit the result to the repo. Managing CI permission can be tricky.
Maybe a simple command to print this list to console is enough. Something like:
test-backend-ops --support --output table
which outputs markdown table directly to the console.Some extra things to concern about:
I feel like the python script is not necessary. It's kinda a hack on top of existing cpp code.Ok maybe unfair to say this because the python code actually takes multiple CSV from multiple cpp runs. But still, I feel like there is an easier way to do so..rtx3090.csv
but I only have an RTX 4060? Which file will be taken for generating the table?Just to be clear, I do think this feature is useful, but I just want to do it without too much over-engineering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow only runs if the csv files changes, so adding a new op alone won't make it fail.
Yeah we should only have one for each backend. Multiple runs with different devices can be merged into a single file if necessary and to add more details in the future, but not really very important.