feat(multi-modal): Phase 0 + Phase 1 — cross-architecture vision capt…#143
Merged
Conversation
…ioning
Generic multi-modal trait surface (Phase 0) + end-to-end Gemma 3 + SigLIP
prefix-only captioning (Phase 1), verified on 3 reference images.
Phase 0 — trait surface + EmbeddingPlan, no behaviour change:
- VisionConfig / VisionWeights / ProjectorWeights (arch-agnostic)
- ModalEncoder / Connector / MultiModalProtocol traits
- embed_plan() alongside embed_tokens_pub, bit-identical on text-only
Phase 1 — Gemma 3 4B + SigLIP end-to-end:
- 1a: Gemma3MultiModal protocol (verified token IDs 255999/262144/256000)
- 1b: SigLIP vision tower CPU forward (bidirectional attention, GELU-tanh)
- 1c: AvgPool2d(4,4) → RMSNorm → linear projector (4096,1152) → (256,2560)
- 1d: --image/--mm-weights CLI, KvEngine seam (ADR-0023), Q4K dispatch
Engine seam (ADR-0023): supports_multimodal() + prefill_from_hidden() on
KvEngine, default-false debt convention. StandardEngine is Phase 1's only
MM-capable engine. generate_with_engine_from_hidden wrapper. AnyEngine
forwards both methods.
3-image regression test (red/circle/unicorn) with positive+negative keyword
assertions — all pass on Gemma 3 4B-it Q4K. Unicorn caption extracts
secondary visual features ("colorful bubbles"), ruling out case-(b) silent
failure (LM generating without conditioning on vision).
Docs: docs/multi-modal.md (design + phased plan), docs/adr/0023 (engine
seam), updated README, AGENTS, root ROADMAP, 5 per-crate ROADMAPs.
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.
Generic multi-modal trait surface (Phase 0) + end-to-end Gemma 3 + SigLIP prefix-only captioning (Phase 1), verified on 3 reference images.
Phase 0 — trait surface + EmbeddingPlan, no behaviour change:
Phase 1 — Gemma 3 4B + SigLIP end-to-end:
Engine seam (ADR-0023): supports_multimodal() + prefill_from_hidden() on KvEngine, default-false debt convention. StandardEngine is Phase 1's only MM-capable engine. generate_with_engine_from_hidden wrapper. AnyEngine forwards both methods.
3-image regression test (red/circle/unicorn) with positive+negative keyword assertions — all pass on Gemma 3 4B-it Q4K. Unicorn caption extracts secondary visual features ("colorful bubbles"), ruling out case-(b) silent failure (LM generating without conditioning on vision).
Docs: docs/multi-modal.md (design + phased plan), docs/adr/0023 (engine seam), updated README, AGENTS, root ROADMAP, 5 per-crate ROADMAPs.