feat(gemma4): add standalone Gemma 4 MoE runtime - #1276
Draft
jcolozzi wants to merge 1 commit into
Draft
Conversation
|
CMake, really? why not add some meson and bazel to the mix? so everyone can have their favorite build system! 🤣 |
jcolozzi
force-pushed
the
feat/gemma4-engine
branch
from
August 30, 2026 13:40
3dff15e to
9d2c348
Compare
Author
|
Removed the standalone CMake build and updated the documentation to use Colibri's existing Makefile. The branch remains a single focused commit; the warning-clean Make build and all seven Gemma tests pass after the cleanup. |
Add a dependency-free CPU engine for Gemma 4 GGUF models with disk-streamed experts, tokenizer, sampling, tool rendering, multimodal vision support, and validated optional CUDA kernel source. Include focused C tests, llama.cpp oracle utilities, model-validation scripts, Make and CI integration, and implementation documentation. CUDA build wiring, gateway, and WebUI integration are intentionally left for follow-ups.
jcolozzi
force-pushed
the
feat/gemma4-engine
branch
from
August 30, 2026 13:44
9d2c348 to
6c92615
Compare
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.
Summary
Add a standalone Gemma 4 MoE runtime that follows Colibri's dependency-free CPU design and disk-streamed expert model.
The smallest reviewable scope includes:
This PR intentionally does not add another build system, launcher/OpenAI gateway/WebUI integration, release packaging. CUDA kernel source validated during development is included, but wiring it into Colibri's existing platform-specific CUDA build conventions is left for follow-up.
AI disclosure
The implementation, tests, and documentation in this PR were fully generated with OpenAI Codex under my direction. I reviewed the resulting changes, resolved the upstream integration and scope, built and tested the code on Windows, exercised real Gemma 4 inference on CPU and CUDA during development, and take responsibility for the submitted code.
Validation
gemma4.exeand all seven Gemma C test executablesgit diff --checkmake -C c checkThe complete local check is currently blocked by pre-existing Windows/toolchain failures outside this diff:
-flto, but this w64devkit GCC reports that LTO support is unavailable. With the supportedLTO=0override, the untouched DeepSeek V4 test still fails to linkcoli_v4_layer_gpu*,coli_v4_engine_config, andcoli_v4_route_bf16.C:\Program Files\...compiler path, and the E2E harness omits the Windows-required-D_FILE_OFFSET_BITS=64definition.Additional development validation, before narrowing the checked-in build integration to Make, included a warning-free Visual Studio 2022/CUDA 12.4 build, 7/7 focused tests, and real
gemma-4-26B-A4BQ4 generation on a Quadro P1000 4 GB that producedHello.Compatibility
devand remains a single focused commit based on currentupstream/devFollow-up
Separate changes can wire the validated CUDA kernel into Colibri's existing CUDA conventions and integrate Gemma with the current launcher/OpenAI gateway/WebUI and release packaging after the engine API and model behavior are reviewed.