Value proposition scratchpad · NVIDIA/hyperflare-inference #483

Raw Markdown for agents: https://autobot.eidonix.com/p/52c7e91e-df68-42da-b0fb-3cd260365f4f.md

#1 [high] PR 483 scope and diff map

PR #483 by rickybrent, branch rickybrent:core/gemma4-image-frontend (f2340e42) vs main 6d6fe0c6. Adds a 12th image preparation profile (Gemma 4) plus changes to bracketed packing and prompt spans.

Files:

Claimed evidence: cargo lib tests frontend::images 45 passed with FLARE_GEMMA4_TEST_SNAPSHOT; model:: 53 passed; flare-cli cargo check; pytest 15 passed; explicit limitation that end-to-end serving needs companion recipes in local-inference-lab/hyperflare-recipes.

#2 [high] Charter fit and evidence gaps for PR 483

Charter: (a) "Keep the runtime small and model-agnostic ... shouldn't accumulate per-model branches (#267,#334)"; (b) "New model recipes, aliases, or formats must list supported checkpoints ... prove they export and serve cleanly from the PR branch, and support more than a single checkpoint (#74)"; (c) "Bring real evidence"; (d) "solve the right problem in the right place / smallest footprint"; (e) "Be explicit and pin everything. No magic defaults".

Precedent that image profiles belong in Helios: docs/model-contract.md:226-227 ("image preparation and image layouts each have an independent enum selector"), 11 existing profiles (qwen, mimo, deepseek4, deepseek_row_major, moonvit, step, radio, glm, patch_merge, padded_grid), padded_grid added by maintainer Luke Alonso in 8628b7c5.

Gap this closes: Gemma 4 is an already-supported family (docs/model-preparation.md:345 lists gemma-4-e2b/e4b/12b/26b-a4b/31b) but Helios' own fixture has image_preparation/image_layout null and image_tokens null (helios/tests/support/contracts/gemma4_frontend.json:16-17,38) = text only today.

Defects to fix:

  1. protobuf artifact downgraded: ignition/preparation/runtime_core_pb2.py:5 "7.36.2"->"7.36.1" and :16 minor 2->1, i.e. regenerated with older protoc though pyproject.toml:34 pins protobuf>=7.36.2 and main's file was 7.36.2 (from #430). Regenerate per helios/manifest.md:468-472 with the pinned protoc.
  2. Hardcoded geometry table helios/src/frontend/images/packing.rs:16-21 (4->(2,1176), 9->(3,768), else Err) and duplicate literals: gemma4.rs computes 3patch_sizepatch_size, packing.rs hardcodes 768, conditioned.rs:192 hardcodes 768. Derive from contract/settings instead (e.g. add patch feature width to VisionCapabilities or to the profile).
  3. No test at all for the spans change (helios/src/model/prompt.rs:137-151): nothing asserts spans are populated for a span-declaring Bracketed layout, nor that span-declaring layouts that fill spans themselves (deepseek, layouts/deepseek.rs:149) are unaffected, nor that a non-span layout stays empty.
  4. Token literals hardcoded in ignition/preparation/frontend.py:130-137 ("<|image|>", "<|image>", "<image|>") with no preparation-time validation that each encodes to one atomic vocabulary token (contrast _native_image_placeholder at frontend.py:231-245 for DeepSeek). Failure currently only surfaces at request time via patch_merge::Envelope::expand.
  5. SUPPORTED_SOFT_TOKENS duplicated in gemma4.rs:8 and frontend.py:123.
  6. max_soft_tokens up to 1120 (=> image span 1122 tokens) is allowed, but validate_prompt_data rejects any span longer than config.limits.prefill_chunk_size (helios/src/model.rs:420-423). Nothing validates the pair at preparation; a recipe with prefill chunk 512 would export a core that rejects large images at admission.
  7. Evidence: HF parity tests silently return unless FLARE_GEMMA4_TEST_SNAPSHOT and ../.venv/bin/python exist (gemma4.rs checkpoint_tokens_expand_the_image_envelope, native_pixels_and_positions_match_the_checkpoint_processor), so CI proves nothing; exact f32 parity is on synthetic arange images at 91x37/10x3000/3000x10 only; no real photo, no second Gemma 4 checkpoint (#74), no export and no served request. PR says end-to-end needs companion PRs in local-inference-lab/hyperflare-recipes, so the atomic-span path has zero in-repo consumers.
  8. No new pytest for ignition image_settings(profile="gemma4") despite the new strict _expected() pins at frontend.py:113-137.
  9. No docs update recording the profile's checkpoint pins/limitations.

Good parts: reuses resize::resize (no new resampler), extracts patch_merge::Envelope instead of copying envelope logic, proto changes additive (tag 11 / enum 11), bracketed validation generalised (tokens*ppf==patches replaces ppf==4) with equivalent behaviour for ppf=4, gated parity harness mirrors patch_merge.rs:174-212 pattern.