Skip to content
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

GGML operations appear to have no documentation or description - let's change that! #118

Closed
KerfuffleV2 opened this issue Apr 29, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@KerfuffleV2
Copy link

KerfuffleV2 commented Apr 29, 2023

Please correct me if I'm a moron: I looked for information on GGML operations and couldn't find it.

I started working on documentation for my Rust GGML bindings: https://docs.rs/rusty-ggml/0.0.4/rusty_ggml/gtensor/struct.GTensor.html
If anyone is curious, you can see an example of those bindings actually being used in my RWKV project: https://github.com/KerfuffleV2/smolrsrwkv/tree/600718ebee029aa684c4a6abbe035d21283a446c

If someone authoritative (@ggerganov — hope it's not too out of line to tag you here) could help me out with some of the more complicated ops I would really appreciate it. Also, if I get help here I will also write up the operations in a less Rust-specific document and contribute it back to the project.

Simple operations like add, sub, div are obvious and I doubt I got them wrong.

Somewhat more complicated ones like scale I'm pretty sure I still was able to figure out, but I would appreciate my description getting double checked.

Complex ones like repeat, conv_1d_[1s,2s], etc I am much less sure about. Some of them have the documentation marked as !!! FIXME !!! — those are the ones I'm most interested in. (I actually don't need help with get_rows, I just haven't had time to write the explanation.) An explanation doesn't have to be suitable for documentation directly, just enough detail for me to understand how it works. With that information, I can clean it up, create an example, etc.

For some of the operations, I wrote down the invariants (not a complete list). It would also be very helpful to have those double checked by someone who actually knows what they're doing. It's very likely I got some of it wrong.

Note: GGML uses an atypical shape format compared to other libraries like PyTorch, etc. The rusty-ggml crate tries to "fix" that, so you might see that my examples have the opposite row/column ordering compared to raw GGML. Hopefully that won't be too confusing. Naturally, if I wrote documentation to contribute to the GGML project it will use GGML's row/column ordering.

Having an accurate list of descriptions for the operations and also the requirements/expected results seems like it would be helpful for a lot of projects. Anyone who is interested in creating bindings is going to need that information.

@ggerganov ggerganov added the documentation Improvements or additions to documentation label May 1, 2023
@KerfuffleV2 KerfuffleV2 closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants