Skip to content

Bind Gemma prompt arithmetic to registered cluster stages - #1569

Closed
jonathan308 wants to merge 4 commits into
fix/cluster-mimo-paged-modesfrom
fix/cluster-gemma-prefill-arithmetic
Closed

jonathan308 wants to merge 4 commits into
fix/cluster-mimo-paged-modesfrom
fix/cluster-gemma-prefill-arithmetic

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Gemma's registered stage previously used wide prompt projections and expert reductions that can produce different bytes across Apple GPU generations. This draft activates the reviewed token-preserving prompt scope only for prefill and binds both changed arithmetic policies into the exact receipt used for plan/cache identity.

The stable family policy, required environment, chunk framing, decode scopes, normalization and head behavior remain unchanged. This is a separate child of #1568, and pins SDK commit 7a2582c736abfe1b3b33bf4fef347d9db9f3da3c in SDK #345.

Before

flowchart TD
  A["Registered Gemma prefill"] --> B["Wide prompt arithmetic"]
  B --> C["Different cross-chip reductions"]
  classDef default fill:#e8f0fe,stroke:#174ea6,color:#102a43;
  classDef failure fill:#fde2e2,stroke:#9b1c1c,color:#571111;
  class C failure;
Loading

After

flowchart TD
  A["Prefill frame"] --> B["Explicit dense and expert prompt scope"]
  B --> C["Original model continuation"]
  D["Exact arithmetic receipt"] --> E["Bind both prompt policies before LOAD"]
  E --> B
  classDef default fill:#e8f0fe,stroke:#174ea6,color:#102a43;
  classDef guard fill:#fff4ce,stroke:#8a6100,color:#332500;
  classDef success fill:#d7f0df,stroke:#176b39,color:#103b23;
  class E guard;
  class B,C success;
Loading

Validation: eight actual SDK CPU tests and one runtime receipt test pass; all 231 SDK and 351 Runtime source files compile. The independent review checked all 12 preimages/postimages and retained the tiny CPU normalization diagnostic as an explicit limitation. Reviewed root patch SHA-256: 6a77ee3805b702ae266d12685dddd4cf9c2ee4b5858d95c456744033ca936fdd. The root publication files match that review exactly; SDK formatting is the only source transformation.

make docs-check
make docs-impact-check BASE=67a4540ca9130912cda816883e37035653abbe0d
make changelog-check
make changelog-preview

These checks pass. The focused runtime suite is GemmaPrefillArithmeticTests; the SDK suites are Gemma4PrefillProjectionTests and Gemma4PrefillExpertTests. Recorded CPU checks use isolated actual-source closures, and do not imply full-model Metal qualification.

This remains a draft: complete artifact/rank/context parity, installed worker behavior, memory and throughput need fresh hardware validation. The change does not establish whole-layer singleton equivalence, add a tensor adapter or restore vision/video ingress. Final acceptance requires tensor parallel for every included model with all supported capabilities retained. Prior text-only or phase-split results are partial or excluded evidence, respectively. No numerical tolerance or memory safeguard is relaxed.

Additional actual-weight diagnostic: six layer-zero shared-MLP widths (1, 8, 127, 128, 511, 512) ran on both M5 Max and M3 Ultra using the production arithmetic flags. Corrected full intermediate and post-normalization bytes match across chips for all six widths; the original wide path differs at 127/128/511/512. Original rectangular normalization is retained and its diagnostic token partition matches at the actual 2816-wide geometry. This is component evidence, not full-model or modality/TP qualification.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 23, 2026 2:59pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 23, 2026 2:59pm UTC
d-inference-landing Ready Ready Preview Oct 23, 2026 2:59pm UTC
darkbloom-status Ready Ready Preview Oct 23, 2026 2:59pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 23, 2026 2:59pm UTC

Request Review

This branch was successfully deployed

5 active deployments
Preview – d-inference-console-ui-dev — 6bd43f8c Deployed Oct 23, 2026 by vercel[bot]
Preview – d-inference — 6bd43f8c Deployed Oct 23, 2026 by vercel[bot]
Preview – d-inference-landing — 6bd43f8c Deployed Oct 23, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 6bd43f8c Deployed Oct 23, 2026 by vercel[bot]
Preview – darkbloom-status — 6bd43f8c Deployed Oct 23, 2026 by vercel[bot]
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