Feature Request: Implement missing ops from backends
Prerequisites
- [x] I am running the latest code. Mention the version if possible as well.
- [x] I carefully followed the README.md.
- [x] I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
- [x] I reviewed the Discussions, and have a new and useful enhancement to share.
Feature Description
The list of supported operation in ggml per backend is maintained at https://github.com/ggml-org/llama.cpp/blob/master/docs/ops.md
How to contribute to make the list more complete:
- Pick an operation which is not implemented in a backend (pick ones marked with ā), pick only one per PR
- Implement the operation
- Test your implementation with
test-backend-ops -o <op> - If it passes test for the op, create a PR.
- Mention performance tests in the PR if they exist (via
test-backend-ops perf -o <op>)
Notes:
- The ops suffixed with _BACK are related to training which is WIP and does not require immediate attention
- Do not link this issue in your PR, which will lead to closing this issue when your PR is merged. Instead, just mention it. Example PRs will be linked below
- This list can be temporarily out of sync, you can check support by first running
test-backend-ops -o <op>on master to confirm - Please do not ask to be assigned a particular task, make the PR first if you think it will be useful
Motivation
Feature parity between backends is always desirable and it's easy to test the implementation, making it an ideal good first issue.
Possible Implementation
No response
I would like to contribute to this effort. May I ask whether it is okay to work on operators marked as [š” Partially supported] in the ops.md table?
I would like to contribute to this effort. May I ask whether it is okay to work on operators marked as [š” Partially supported] in the ops.md table?
Yes that would also work. The reason it's preferable to work on completely unsupported ops is because sometimes it's not possible to add full support to an op on a backend (e.g. some quantisation schemes in CUDA) and it might not be clear as a newcomer why that's the case. But if you make an operation support more complete, that would always be welcome!
I've verified that PAD_REFLECT_1D is currently unsupported on CUDA. I would like to work on the PAD_REFLECT_1D op for the CUDA. Please let me know if there are any considerations or edge cases I should keep in mind. Thanks!
I've verified that PAD_REFLECT_1D is currently unsupported on CUDA.
It's already in progress in #14659
since PAD_REFLECT_1D is already in progress (#14659), Iād like to work on the SET op for the CUDA backend instead. Thanks!
Can I pick up CONV_2D for CUDA please? thank you
Do I need to create a separate issue for that?
Hey!
I'm relatively new to the project, have been using llama.cpp in the past. Really would like to help the project grow and contribute what I can.
Curious about two thing:
- Is there a good tutorial/guide on getting started with metal framework for this project?
- I noticed the BLAS is mostly unsupported backend, just. curious to know if there is a fundamental blocking reason behind this?
Thanks in advance!
@iliailmer
-
AFAIK there is no tutorial as such, but
test-backend-opsalways has a reference CPU implementation to compare new implementations with. Other suggestions would be to look at older PRs added related to the backend you're interested in. -
BLAS just forwards mul_mat to another library (see
ggml-blas.cpp), it would not make sense to add operators there apart from mul_mat and a few others
Can I pick up CONV_2D for metal?
Gonna pick up LOG for metal if that's alright?
FYI, I'm gonna pick up OPT_STEP_ADAMW for metal
i'm working on conv_transpose_2d
Any reason why nobody is taking up ops for BLAS backend? Literally zero ops =/
The BLAS backend is just a way to use a BLAS library to run matrix multiplications. It's not literally zero ops, MUL_MAT is partially supported. Otherwise this "backend" will use the regular CPU operators.
The referenced table mentions that CUMSUM is implemented on the CPU (and some other) backends, but a quick grep for GGML_OP_CUMSUM leads to no results for me. Is the table incorrect or is CUMSUM called something else?
A search does find it.
My bad; I was searching in my old local directory. Seems that CUMSUM is now implemented on CUDA as well. I'll try to work on NORM_MUL_ADD.
My bad; I was searching in my old local directory. Seems that
CUMSUMis now implemented on CUDA as well. I'll try to work onNORM_MUL_ADD.
That's a fusion and is only in the list because not all backends have updated their CSVs.
@hipudding @noemotiovon @lhez @max-krasnyansky @taronaeo I think CANN, OpenCL and zDNN are the only remaining backends that still have fusion ops in the CSVs, please update them so we can get a more accurate ops.md.
@CISC Thank you for the reminder. Updated in #17904.