Gemma4 initial npu support#195
Merged
cavusmustafa merged 7 commits intoMay 29, 2026
Merged
Conversation
59b8969 to
8b77fab
Compare
Collaborator
Author
|
@zhaixuejun1993 this PR modifies gemma3 falsh attention fallback part as it was falling back for gemma4 as well. Can you verify the changes? |
af9fb52
into
ravi9:dev_backend_openvino
6 of 14 checks passed
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.
Gemma4 Initial NPU Support
Adds initial Intel NPU support for Gemma4 E2B via the OpenVINO backend, and fixes a regression that broke Gemma4 on CPU/GPU.
Changes
NPU static path support (view.cpp, utils.cpp, node_context.h, ggml-decoder.h, ggml-decoder.cpp):
already-resolved views
NPU accuracy fix (glu_geglu.cpp):
Fix: Gemma4 FLASH_ATTN_EXT regression (ggml-openvino.cpp):
breaking inference
Fix: test-llama-archs (utils.cpp):
Known Limitation
NPU compilation for Gemma4 triggers NPUW FOLD's dynamic shape issue — the per-layer embedding tensor (inp_per_layer) gets parameterized during folding,
which the NPU compiler cannot handle. Current workaround uses specific NPUW config settings.