-
Notifications
You must be signed in to change notification settings - Fork 966
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 : improve custom operator support #294
Comments
Looks like the To support multi-threading, we could add a typedef void (*ggml_custom1_op_t)(struct ggml_tensor * dst , const struct ggml_tensor * a, int ith, int nth);
GGML_API struct ggml_tensor * ggml_map_custom1(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_tasks, // clamped to the number of threads
ggml_custom1_op_t fun); Would a test work as an example? |
Maybe we can pass the entire |
My view on that is that we are already exposing way too many details of the internals of ggml in the public API (ie. In this case, We should probably add a typedef void (*ggml_custom1_op_t)(struct ggml_tensor * dst , const struct ggml_tensor * a, int ith, int nth, void * userdata);
GGML_API struct ggml_tensor * ggml_map_custom1(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_tasks, // clamped to the number of threads
ggml_custom1_op_t fun,
void * userdata); |
Good point - agree
Yes, let's add it. With the proposed changes, we only need a test or example to complete this. |
…gerganov#154) (ggerganov#294) * Use F16 for memory_k and memory_v * add command line switch to use f16 instead of f32 for memory k+v --------- Co-authored-by: Ty Everett <[email protected]>
We have rudimentary support for adding F32 custom
ggml
operators in user space via:ggml/include/ggml/ggml.h
Lines 1173 to 1240 in a1d0ea7
The API has to be improved to support:
We also need to provide a few examples of how to define custom operators.
This functionality will significantly improve adoption of
ggml
in third-party projects since currently, they need to rely that certain operators first get implemented intoggml
before being able to use themThe text was updated successfully, but these errors were encountered: