metal : add Metal backend for GGML_OP_GATED_DELTA_NET#20244
Closed
arkavo-com wants to merge 3 commits intoggml-org:masterfrom
Closed
metal : add Metal backend for GGML_OP_GATED_DELTA_NET#20244arkavo-com wants to merge 3 commits intoggml-org:masterfrom
arkavo-com wants to merge 3 commits intoggml-org:masterfrom
Conversation
Add a fused Metal kernel for the gated delta net recurrence op (ggml-org#19504), enabling GPU-accelerated inference for DeltaNet-based models (Qwen3.5, etc.) on Apple Silicon. Supports both GDA (scalar gate) and KDA (per-row gate) modes with head_size 64 and 128. Unsupported configurations (head_size 32, non-contiguous tensors) gracefully fall back to CPU. Performance: Qwen3.5-0.8B Q4_K_M on M4 Max tg128: 170 -> 213 t/s (+25%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
Superseded by #20361 |
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.
Summary
GGML_OP_GATED_DELTA_NET(ggml: add GATED_DELTA_NET op #19504), enabling GPU-accelerated DeltaNet recurrence on Apple SiliconG=1) and KDA (per-row gate,G=S) modesPerformance (Apple M4 Max, Qwen3.5-0.8B Q4_K_M)
Backend test results
All 7 supported test configurations pass on Metal (GDA + KDA, head_size 64/128, contiguous). 6 unsupported configs (head_size=32, permuted) correctly report "not supported" and fall back to CPU.
Files changed (Metal only)
ggml-metal.metalkernel_gated_delta_net_f32kernelggml-metal-ops.cppggml-metal-device.cppggml-metal-device.hggml-metal-ops.hggml-metal-device.msupports_opwith head_size + contiguity checksTest plan
test-backend-ops -o GATED_DELTA_NET-- 7/7 pass on Metal, 3/3 backends passllama-benchwith Qwen3.5-0.8B confirms +25% tg speedupAI usage: yes. Claude Opus 4.6 assisted with implementation.
🤖 Generated with Claude Code