Skip to content

Add DeepseekV4 Flash support: inference, converter, MTP speculative decoding#959

Open
iStrzalka wants to merge 1 commit into
google:devfrom
iStrzalka:deepseek-v4-flash
Open

Add DeepseekV4 Flash support: inference, converter, MTP speculative decoding#959
iStrzalka wants to merge 1 commit into
google:devfrom
iStrzalka:deepseek-v4-flash

Conversation

@iStrzalka

@iStrzalka iStrzalka commented Jul 19, 2026

Copy link
Copy Markdown

Adds DeepseekV4 Flash support: inference, converter, and MTP speculative decoding.

Tested via running the model to check whether output made sense.

@google-cla

google-cla Bot commented Jul 19, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jan-wassenberg jan-wassenberg 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.

Interesting, thanks for adding! Excellent work.
Looks like we have some merge conflicts in kv_cache.cc, gemma.cc, configs.h/cc, weights.h, python/configs.cc - please resolve them to unblock merge. They seem independent, we can keep both.

Comment thread gemma/configs.cc Outdated
return config;
}

<<<<<<< ours

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.

Merge conflict?

Comment thread gemma/configs.h Outdated
GEMMA3_12B_LM,
GEMMA3_27B_LM,
GEMMA4_26B_MOE,
<<<<<<< ours

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.

Here also.

Comment thread gemma/configs.h Outdated

InternalModelConfig internal;
bool use_global_timescale = false; // for Gemma 3
<<<<<<< ours

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.

Several in this file.

Comment thread gemma/gemma.cc Outdated

// Fill activations.x (much faster than TransformerLayer).
size_t image_token_position = 0;
<<<<<<< ours

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.

Another :)

Comment thread gemma/kv_cache.cc Outdated
// fires. The 2-arg constructor path relies on k_v_cols == 0 to skip reshape.
}

<<<<<<< ours

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.

Another :)

@iStrzalka
iStrzalka force-pushed the deepseek-v4-flash branch from fb7d1bb to 27cf8cb Compare July 20, 2026 15:48
…ecoding. Tested via running the model to check whether output made sense.
@iStrzalka
iStrzalka force-pushed the deepseek-v4-flash branch from 27cf8cb to 2895479 Compare July 20, 2026 16:19

@jan-wassenberg jan-wassenberg 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.

Thanks for updating!

@jan-wassenberg jan-wassenberg added the copybara-import Trigger Copybara for merging pull requests label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copybara-import Trigger Copybara for merging pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants