Skip to content

RFC: chunked CUDA prefill kernel for ggml_gated_delta_net #22967

Description

@leonardHONG

The CUDA implementation of ggml_gated_delta_net (ggml/src/ggml-cuda/gated_delta_net.cu) still has the TODO (from #19504) for a chunked prefill kernel in launch_gated_delta_net().

My reading is that there is still a CUDA-side prefill gap here: larger prompt processing cases still go through the existing token-sequential kernel, while the chunked algorithmic reference lives in build_delta_net_chunking() (src/models/delta-net-base.cpp).

I'd like to work on a chunked CUDA prefill kernel for this op, likely starting with the non-KDA path first.

Tentative plan:

  • mirror the existing DeltaNet chunking logic as a fused CUDA path;
  • keep small-token cases on the current kernel and dispatch chunked only for larger n_tokens;
  • validate against the existing reference path;
  • benchmark prefill on Qwen3-Next / Qwen3.5-style GDN workloads;
  • KDA path may land as a follow-up if the initial PR grows too large.

Before I start prototyping: any preference for the chunked dispatch threshold here, and is there any existing work or direction I should align with?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions