Commit f539af5
committed
feat(v4): 5 new bricks from open mlx-lm PRs — Mistral4 MLA, DSv4, Bailing/Ling
Direct re-export of new model bricks from open mlx-lm PRs, vendored into
our editable mlx-lm checkout at /Users/dave/sources/mlx-lm on branch
cppmega-integration (pushed to DatasunriseOU/mlx-lm). Each is wrapped as
a thin nn.Module that exposes ``self.inner`` so weight loaders find
upstream parameter paths at the expected locations.
PRs integrated (commits 96febcc..5f4e5e5 in our mlx-lm fork):
- #1037 Mistral Small 4 — Absorbed MLA + INT4 latent cache
-> "mistral4_mla" block kind, Mistral4MLABlock
- #1057 LongCat Next — full model class, loadable directly via
mlx_lm.load (no per-brick wrapper needed)
- #1227 Bailing/Ling-2.6 — LinearAttention + MultiLatentAttention + MoE
-> "bailing_linear" / "bailing_mla" / "bailing_moe" block kinds
- #1201 DeepSeek-V4 Flash — hash-indexed sparse attention + block
-> "dsv4_attention" block kind
All 5 bricks registered in BLOCK_BUILDERS for UnifiedSuperblock composition
(this is the modular GUI-driven model construction surface).
cppmega_v4/nn/mlx_lm_bricks.py: 5 wrapper classes + minimal-stub ModelArgs
builders so each upstream class can be instantiated standalone.
cppmega_v4/models/unified_superblock_v4.py: 5 _build_<kind> functions
added; BLOCK_BUILDERS dict extended.
tests/v4/test_mlx_lm_bricks.py: 14 tests covering direct-import-from-mlx-lm,
forward shape, BLOCK_BUILDERS round-trip for each brick.
Suite: 393 passed / 0 skipped (was 379).1 parent f6798a1 commit f539af5
3 files changed
Lines changed: 542 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 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 | + | |
140 | 190 | | |
141 | 191 | | |
142 | 192 | | |
| |||
299 | 349 | | |
300 | 350 | | |
301 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
302 | 363 | | |
303 | 364 | | |
304 | 365 | | |
| |||
0 commit comments