You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run google/gemma-4-E2B-it (GGUF) correctly on the Orin Nano — including Per-Layer Embeddings (PLE) — so genie-claw can use Gemma 4 E2B (better
quality at the 2B scale) in place of the current model. Then port the validated
math to TensorRT-Edge-LLM (NVIDIA/TensorRT-Edge-LLM#72).
Why this is a big change
The engine today is hardcoded to the Qwen3 / Llama-3 pre-norm + SwiGLU path:
one head_dim, one rope_theta, SiLU baked into the FFN, 2 norms/layer, no
sliding-window mask, no logit softcap, and a BPE-only tokenizer. Gemma 4 diverges
on nearly every axis — dual head dim (256 local / 512 global), dual RoPE, GeGLU,
4 norms + a PLE pathway, KV-sharing across the last 20 layers, final-logit
softcap, and a SentencePiece tokenizer.
So step 1 is an architecture abstraction so model-family behavior is
data-driven (an arch "recipe"), not hardcoded — then Gemma 4 is one recipe among
others and future archs are cheap. The existing Qwen3/Llama path must route
through the new abstraction with byte-identical output (pure refactor) before
any Gemma code lands.
Note: even llama.cpp does not implement Gemma 4 E2B's PLE in its forward graph
(ggml-org/llama.cpp#22243),
so the PLE work here is genuinely new.
Full design: docs/gemma4-plan.md (on feat/gemma4-support).
Open question to resolve first
llama.cpp registers altup_* / laurel_* tensors under arch gemma4 (Gemma-3n
lineage), but HF's Gemma4TextDecoderLayer uses only PLE. Confirm from the real GGUF tensor dump whether E2B carries AltUp/LAuReL before #93 — it
materially changes the forward pass.
Goal
Run google/gemma-4-E2B-it (GGUF) correctly on the Orin Nano — including
Per-Layer Embeddings (PLE) — so genie-claw can use Gemma 4 E2B (better
quality at the 2B scale) in place of the current model. Then port the validated
math to TensorRT-Edge-LLM (NVIDIA/TensorRT-Edge-LLM#72).
Why this is a big change
The engine today is hardcoded to the Qwen3 / Llama-3 pre-norm + SwiGLU path:
one
head_dim, onerope_theta, SiLU baked into the FFN, 2 norms/layer, nosliding-window mask, no logit softcap, and a BPE-only tokenizer. Gemma 4 diverges
on nearly every axis — dual head dim (256 local / 512 global), dual RoPE, GeGLU,
4 norms + a PLE pathway, KV-sharing across the last 20 layers, final-logit
softcap, and a SentencePiece tokenizer.
So step 1 is an architecture abstraction so model-family behavior is
data-driven (an arch "recipe"), not hardcoded — then Gemma 4 is one recipe among
others and future archs are cheap. The existing Qwen3/Llama path must route
through the new abstraction with byte-identical output (pure refactor) before
any Gemma code lands.
Note: even llama.cpp does not implement Gemma 4 E2B's PLE in its forward graph
(ggml-org/llama.cpp#22243),
so the PLE work here is genuinely new.
Full design:
docs/gemma4-plan.md(onfeat/gemma4-support).Open question to resolve first
llama.cpp registers
altup_*/laurel_*tensors under archgemma4(Gemma-3nlineage), but HF's
Gemma4TextDecoderLayeruses only PLE. Confirm from thereal GGUF tensor dump whether E2B carries AltUp/LAuReL before #93 — it
materially changes the forward pass.
Tasks
gemma4GGUF + parse hparams + fail loud