Skip to content

Fix Gemma 4 singleton expert prefill and prepare 0.2.4 - #102

Merged
bsbodden merged 2 commits into
mainfrom
agent/gemma4-singleton-expert-prefill
Aug 3, 2026
Merged

Fix Gemma 4 singleton expert prefill and prepare 0.2.4#102
bsbodden merged 2 commits into
mainfrom
agent/gemma4-singleton-expert-prefill

Conversation

@bsbodden

@bsbodden bsbodden commented Aug 3, 2026

Copy link
Copy Markdown
Member

What changed

  • fall back to the Java projection kernel when Gemma 4 MoE batched prefill routes exactly one token to a quantized expert
  • retain the native kernel for eligible batches of two or more
  • add a Q4_K regression covering a batch-only injected kernel
  • prepare the coordinated Models 0.2.4 patch release metadata

Root cause

Gemma 4 enables native batched prefill after validating representative two-token projections. MoE routing can still produce a one-token batch for an individual expert. The native kernel intentionally rejects singleton work unless native decode is enabled, but the Gemma decoder treated that eligibility decision as fatal instead of using its existing Java projection path.

User impact

The qualified ggml-org/gemma-4-26B-A4B-it-GGUF Q4_K_M artifact can now prefill prompts through ModelJars' default native backend without throwing loaded Gemma 4 batched-prefill kernel rejected Q4_K projection ... when an expert receives one routed token.

Validation

  • ./gradlew :backend-java:test --tests com.integrallis.models.backend.purejava.gemma4.Gemma4ForwardPassTest
  • ./gradlew spotlessCheck :backend-java:test
  • ./gradlew verifyReleaseMetadata

@bsbodden
bsbodden marked this pull request as ready for review August 3, 2026 04:39
@bsbodden
bsbodden merged commit f022c7a into main Aug 3, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant