Skip to content

model :support Gemma4 DSpark draft backbone - #29226

Merged
ggerganov merged 2 commits into
ggml-org:masterfrom
hthadicherla:hthadicherla/gemma-dspark
Sep 23, 2026
Merged

ggerganov merged 2 commits into
ggml-org:masterfrom
hthadicherla:hthadicherla/gemma-dspark

Conversation

@hthadicherla

Copy link
Copy Markdown
Contributor

Overview

Adds GGUF conversion and runtime support for Gemma 4 DSpark drafts, including full attention and SWA1024.

  • Adds the Gemma 4 attention, normalization, embedding scaling and RoPE handling to the existing DFlash graph.
  • Preserves the draft’s own embeddings and output head, including tied weights.
  • Uses the existing DSpark speculative decoding flow.

Additional information

Tested GPU inference with both full-attention and SWA1024 Gemma DSpark drafts. Both generated accepted draft tokens.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, I used AI to help write code and understand codebase.

@ggml-gh-bot

ggml-gh-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

Hi @hthadicherla, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • Multiple open PRs from a new contributor: We limit new contributors (those without a previously merged PR) to 1 open PR at a time. You currently have 2 open PRs.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@ruixiang63 ruixiang63 changed the title spec : support Gemma 4 DSpark draft model :support Gemma4 DSpark draft backbone Sep 21, 2026
@ggerganov ggerganov self-assigned this Sep 21, 2026

@CISC CISC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need gemma4_backbone metadata? The only difference is the non/existence of some tensors and a different activation (we already have metadata for specifying that).

Comment thread conversion/gemma.py Resolved
Comment thread conversion/gemma.py Resolved
Comment thread gguf-py/gguf/constants.py Resolved
Add GGUF conversion and runtime support for full-attention and SWA Gemma 4
DSpark drafts, including tied output weights and boolean backbone metadata.

Assisted-by: Codex
@hthadicherla
hthadicherla force-pushed the hthadicherla/gemma-dspark branch from b635c44 to 37e1e37 Compare September 22, 2026 09:35
@hthadicherla

hthadicherla commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Do we really need gemma4_backbone metadata? The only difference is the non/existence of some tensors and a different activation (we already have metadata for specifying that).

Agreed. Removed gemma4_backbone in the latest commit; the runtime now uses tensor presence and the existing hidden_activation metadata.

@hthadicherla
hthadicherla requested a review from CISC September 22, 2026 09:54
@hthadicherla

Copy link
Copy Markdown
Contributor Author

@CISC , addressed the review comments just now.

Can you PTAL again ?

@hthadicherla

Copy link
Copy Markdown
Contributor Author

@ggerganov , the reviewers have approved the changes. Can you PTAL at the PR once and merge if it looks okay ?

@ggerganov
ggerganov merged commit 633733d into ggml-org:master Sep 23, 2026
13 of 15 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 7, 2026
* dspark: add Gemma 4 draft support

Add GGUF conversion and runtime support for full-attention and SWA Gemma 4
DSpark drafts, including tied output weights and boolean backbone metadata.

Assisted-by: Codex

* dflash: infer Gemma draft features from metadata

(cherry picked from commit 633733d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants