metal: add ADD1 support#21274
Closed
xuir268 wants to merge 1 commit into
Closed
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Author
|
I have used AI content for commit message and description only @ggml-gh-bot |
4 tasks
Author
|
@ggerganov this MR is now ready for review |
ggerganov
reviewed
Apr 3, 2026
Comment on lines
+785
to
+788
| if (op->op == GGML_OP_ADD1) { | ||
| args.val = *(float *) op->src[1]->data; | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Expressing this as unary op is not correct. Specifically this part is not guaranteed to work.
Member
|
Closing this in favor of #21267 |
Author
|
okay , will go ahead for another feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Implement GGML_OP_ADD1 for the Metal backend using the existing
kernel_unary_impl infrastructure.
#14909
Additional information
#14909
Requirements
The requirement comes directly from issue #14909:
"Feature parity between backends is always desirable"
The goal is simple — every GGML operation should work on every backend. ADD1 worked on CPU and CUDA but not on Metal. That means any model graph containing an ADD1 op on an Apple Silicon Mac would force that operation to fall back from GPU to CPU, causing a memory copy round-trip and killing performance.
test-backend-ops -o ADD1:
Yes , PR commit message and description only