Skip to content

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 4 commits into from
Jul 10, 2025

Conversation

am17an
Copy link
Collaborator

@am17an am17an commented Jul 9, 2025

Original PR ggml-org/ggml#1293

Maintaining parity between backends is desirable, and developers have to dig in the code to understand which operations/backends need implementation. But adding these ops is good for newcomers as it's straightforward to test.

This PR adds basic documentation for ops support using test-backend-ops

Also I added a github action to this PR, but I'm not sure how to test it out

@am17an am17an requested a review from slaren July 9, 2025 15:29
@github-actions github-actions bot added documentation Improvements or additions to documentation script Script related testing Everything test related python python script changes devops improvements to build systems and github actions labels Jul 9, 2025
Copy link
Member

@slaren slaren Jul 9, 2025

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.

Copy link
Collaborator

@ngxson ngxson Jul 9, 2025

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:

  1. 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..
  2. Having a "checking" pipeline like @slaren suggest can lead to extra works whenever someone wants to implement a trivial kernel. For example, when adding ggml_gelu_erf, having to regenerate the CSV, then regenerate the table - that's 2 extra steps.
  3. What about the case where we have 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

Copy link
Member

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.

3. What about the case where we have rtx3090.csv but I only have an RTX 4060? Which file will be taken for generating the table?

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.

@am17an
Copy link
Collaborator Author

am17an commented Jul 10, 2025

@am17an am17an merged commit 11ee0fe into ggml-org:master Jul 10, 2025
51 checks passed
@am17an am17an deleted the add_docs branch July 10, 2025 15:29
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Jul 10, 2025
* origin/master:
Smoldocling support (ggml-org#14597)
Docs: script to auto-generate ggml operations docs (ggml-org#14598)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions documentation Improvements or additions to documentation python python script changes script Script related testing Everything test related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants