Repository navigation
Commit f494a75
Add nine core GGUF VLM projector routes (#689)
## Summary
- Add role-explicit standalone GGUF sidecar export for `gemma3na`,
`gemma3nv`, `gemma4a`, `gemma4ua`, `gemma4uv`, `idefics3`, `internvl`,
`llama4`, and `pixtral`.
- Add reusable pixel-unshuffle, Idefics3, InternVL, Llama4, and Pixtral
projector components plus a dedicated Llama4 vision tower.
- Recover revision-neutral graph config and exact tensor mappings from
each sidecar while pinning immutable revisions only in the evidence
registry.
- Preserve active Gemma4 audio by default and support encoder-free
Gemma4 unified vision/audio sidecars without collapsing their roles.
- Integrate the #688 graph-versus-runtime policy: exact component export
remains non-gating, while every saved standalone graph records
`mobius.runtime_support=standalone-sidecar-only; paired multimodal
runtime unvalidated` and the dispatcher emits a warning.
## Route contracts
| Projector | ModelPackage role | Text target | Processor-native feature
contract |
|---|---|---|---|
| `gemma3nv` | `vision_encoder` | `gemma3n` | 768x768 image, 256 feature
rows |
| `gemma3na` | `audio_encoder` | `gemma3n` | 128-bin input features, 188
feature rows |
| `gemma4a` | `audio_encoder` | `gemma4` | Clipped Conformer audio
features |
| `gemma4uv` | `vision_encoder` | `gemma4` | 48x48 merged patches, one
row per valid patch |
| `gemma4ua` | `audio_encoder` | `gemma4` | Raw 640-sample frames, one
row per valid frame |
| `idefics3` | `vision_encoder` | `llama` | Dynamic tile count, 512x512
tiles, 64 rows per tile |
| `internvl` | `vision_encoder` | `qwen2` | Dynamic tile count, 448x448
tiles, 256 rows per tile, CLS-last GGUF ordering |
| `llama4` | `vision_encoder` | `llama4` | Dynamic tile count, 336x336
tiles, 144 rows per tile; adjacent-pair split-axis 2D RoPE |
| `pixtral` | `vision_encoder` | `llama` | Dynamic patch-aligned image;
`(H/16)*(W/16)+(H/16)-1` rows |
For Idefics3, InternVL, and Llama4, the symbolic `num_tiles` input is
processed tile-wise by the encoder/projector and reshaped from `[tiles,
rows_per_tile, hidden]` to rank-2 `[tiles * rows_per_tile, hidden]`.
ONNX row-major reshape preserves processor tile order and raster order
inside each tile; no synthetic tile separators are inserted because the
processor owns refined-crop/overview ordering.
Gemma3n's combined sidecar requires both presence flags and validates
all 825 co-resident vision/audio tensors against both role graphs.
Cross-pairing, aliasing, unknown tensors, unsupported packed projector
qtypes, and unrepresentable dynamic ABI paths fail closed.
## Runtime policy
Mobius emits the exact ONNX component whenever the graph is
representable. Downstream paired runtime execution remains explicitly
deferred and advisory; it does not gate standalone graph export. Every
standalone vision graph declares `when_present=image`. Only F32/F16/BF16
sidecar tensor storage is accepted.
## Evidence and validation
- Semantically rebased onto
`main@50bb373` (#688), retaining its
advisory runtime policy and regenerated census/docs.
- Immutable sparse-header preflight covered every promoted route;
artifacts and processors are pinned in the generated evidence census and
remain within the 16 GiB budget.
- 226 focused projector, mapping, pairing, census, documentation, and
independent numerical parity tests passed.
- One- and three-tile executable tests for Idefics3, InternVL, and
Llama4 prove symbolic input shape, cardinality, batch-major tile/raster
ordering, image-presence metadata, and parity with independently
executed single tiles.
- 9,038 broad non-integration tests passed, with 64 skipped and one
subtest passed.
- Llama4 full-tower independent parity uses `head_dim=8`, which
distinguishes adjacent complex-pair rotation from the incorrect
split-half layout.
- Targeted mypy passed for all new/shared projector sources.
- `lintrunner -a` passed.
- Independent medium-effort final review found no remaining issues.
- The inline image-presence review thread was answered and resolved.
- Temporary GGUF headers, sparse files, extracted sources, and scratch
payloads were removed before publication.
---------
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>1 parent 50bb373 commit f494a75
23 files changed
Lines changed: 4392 additions & 161 deletions
File tree
- docs/api
- src/mobius
- components
- integrations/gguf
- models
- tasks
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| 95 | + | |
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| |||
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
| |||
195 | 208 | | |
196 | 209 | | |
197 | 210 | | |
| 211 | + | |
198 | 212 | | |
199 | 213 | | |
200 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
0 commit comments