Repository navigation
Commit c3fa21e
Add exact legacy dense GGUF graph subsets (#639)
## Summary
Adds fail-closed, architecture-owned GGUF graph paths for the maximal
exact subsets of:
- **GPT-NeoX:** bias LayerNorm/GELU, partial NeoX RoPE, MHA, parallel
residual only; pinned converter QKV row reformat is reversed before
graph load.
- **JAIS:** bias LayerNorm, sequential SwiGLU, causal ALiBi,
`1/head_dim` attention scale, converter-baked MuP values.
- **MPT:** causal ALiBi, sequential pre-LayerNorm GELU; supports
all-or-none optional bias families and tied/untied output while
rejecting learned positions, Q/K norms, nonzero KQV clipping, AWQ
activation scales, and partial bias families.
- **Refact:** RMSNorm, max-8 causal ALiBi, one KV head, bias-free
sequential SwiGLU; rejects expert, RoPE-factor, and
loaded-but-unexecuted bias families.
- **Dense ERNIE 4.5:** RMSNorm, full adjacent-pair RoPE, split bias-free
Q/K/V and SwiGLU; rejects fused, MoE, sectioned-position, and bias
variants.
- **OpenELM:** per-layer Q/KV head and FFN arrays, per-head Q/K RMSNorm,
full NeoX RoPE, mandatory tied output, and per-layer dynamic KV-cache
geometry.
All six advance config/tensor/graph import while **runtime remains
deferred**. Static cache is rejected fail-closed. Packed quantized
import is rejected for every dedicated graph: fused-QKV architectures
require row splitting, while Refact/ERNIE currently lack
quantization-aware graph targets. Explicit dequantization remains
available.
The implementation is pinned to llama.cpp
`8d9af256337d1a501250f9bbf4c0859a654bddd6` and retains the existing
BailingMoE, DeepSeek, and Dots1 registry/config/tensor/docs behavior
from base `8b5f89ab22ea8cc5333d6a05fa7960cdc81cf768`.
## Evidence
- Tiny graph/config/tensor closure and fail-closed loader-union tests
for all six architectures.
- Realistic value-based GPT-NeoX converter row-order transform and
OpenELM per-layer fused-row checks.
- Independent PyTorch equation reference versus full ORT logits for
multi-token prefill and reused-cache decode across all six
architectures.
- Focused shared GGUF/cache/parity suite: `1199 passed, 1 skipped`.
- Broad non-integration suite: `8139 passed, 57 skipped, 1 subtest
passed`.
- Existing shared GGUF suite: `41 passed`.
- Generated GGUF docs check and initialized all-files lint pass.
- Pinned real artifact CLI evidence:
`tensorblock/pythia-70m-v0-GGUF@8a29e7567c0feef4b3ecca9ae554141d46ea790c`,
`pythia-70m-v0-Q2_K.gguf`, SHA-256
`345e1ab0e14035766cfd1faf0cf9c14a3ee8d87e5bf0e8296567277865b77649`.
Default packed import is rejected; `--dequantize --dtype f32` builds and
runs finite ORT prefill `[1,3,50304]` plus cached decode `[1,1,50304]`,
growing cache to `[1,8,4,64]`.
## Reviews
Two independent GPT-5.6 Sol medium reviews covered architecture
exactness and shared-surface regressions. Findings fixed before
publication:
- ERNIE 4.5 changed from mirrored NeoX RoPE to pinned adjacent-pair
RoPE, including an independent parity reference.
- Refact/ERNIE packed-import claims changed to fail-closed rejection
because the dedicated graph lacks quantization-aware targets.
- Static-cache exposure changed to explicit rejection because dedicated
layers implement dynamic cache only.
## Waivers / residual blockers
- No YAML/HuggingFace L2 case is added because `gguf_legacy` is an
internal graph selected only after GGUF metadata validation, not a
HuggingFace architecture alias; dedicated graph/config/closure coverage
is registered as specialized coverage instead.
- No sufficiently small, pinned representative GGUF was practical for
JAIS, MPT, Refact, ERNIE 4.5, or OpenELM in this pass. Their evidence is
synthetic full-logit prefill/decode parity, so runtime packaging remains
deferred.
- The real GPT-NeoX artifact proves CLI import, graph serialization, ORT
load, prefill, and reused-cache decode, but not upstream real-weight
logit/generation parity; GPT-NeoX runtime therefore also remains
deferred.
- Quantized preservation and static cache remain explicit residual
blockers for all six; callers must dequantize and use dynamic cache.
Base: `8b5f89ab22ea8cc5333d6a05fa7960cdc81cf768`
Head: `843c3acd6a25874eaa22587a714465bf3a6fee80`
---------
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>1 parent 8b5f89a commit c3fa21e
18 files changed
Lines changed: 1616 additions & 30 deletions
File tree
- docs/api
- src/mobius
- _configs
- integrations/gguf
- _upstream_data
- models
- tasks
- tests
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
461 | 467 | | |
462 | 468 | | |
463 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
533 | 534 | | |
534 | 535 | | |
535 | 536 | | |
| 537 | + | |
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
1815 | 1822 | | |
1816 | | - | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
1817 | 1829 | | |
1818 | 1830 | | |
1819 | 1831 | | |
1820 | | - | |
1821 | | - | |
1822 | | - | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
1823 | 1853 | | |
1824 | | - | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1825 | 1909 | | |
1826 | 1910 | | |
1827 | 1911 | | |
| |||
2022 | 2106 | | |
2023 | 2107 | | |
2024 | 2108 | | |
2025 | | - | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
2026 | 2122 | | |
2027 | 2123 | | |
2028 | 2124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
63 | 77 | | |
64 | 78 | | |
65 | 79 | | |
| |||
279 | 293 | | |
280 | 294 | | |
281 | 295 | | |
| 296 | + | |
282 | 297 | | |
283 | 298 | | |
284 | 299 | | |
| |||
293 | 308 | | |
294 | 309 | | |
295 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
296 | 315 | | |
297 | 316 | | |
| 317 | + | |
298 | 318 | | |
299 | 319 | | |
300 | 320 | | |
| |||
0 commit comments