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 : add ggml_map_custom1-3 #422

Merged
merged 3 commits into from
Aug 1, 2023
Merged

ggml : add ggml_map_custom1-3 #422

merged 3 commits into from
Aug 1, 2023

Conversation

slaren
Copy link
Collaborator

@slaren slaren commented Jul 30, 2023

Fixes #294

  • Adds ggml_map_custom1-3 and _inplace versions
  • Marks ggml_map_unary_f32, ggml_map_binary_f32, ggml_map_custom1-3_f32 as deprecated
  • Adds tests/test-customop.c to test these functions and hopefully also serve as an example

Additional changes:

  • Removes GGML_TYPE_F32 type checks from ggml_map_custom1-3_f32
  • Makes ggml_are_same_shape public
  • Adds .editorconfig from llama.cpp
  • Adds macro GGML_DEPRECATED to ggml.h (from llama.h)

@slaren
Copy link
Collaborator Author

slaren commented Jul 30, 2023

Possible issue: the data type of the destination tensor is copied from the data type of the first parameter. In some cases, users may want to use a different data type. We could add a type argument to ggml_map_custom1-3.

@ggerganov
Copy link
Owner

Sure, adding type argument sounds good. But even as it is it should work for most use cases

@slaren
Copy link
Collaborator Author

slaren commented Jul 31, 2023

I guess it is better to test this for a while and make sure that it works for the users. Adding another version of the ops that adds a parameter to choose the output type would be trivial and can be done later, and I think that would be better than adding even more parameter to these functions.

@slaren slaren merged commit b57410a into master Aug 1, 2023
2 checks passed
@slaren slaren deleted the ggml-map-custom-new branch August 1, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ggml : improve custom operator support
2 participants