Skip to content

SL-47: SharpAI model overlays for 127 missing or partial model_types - #102

Merged
solderzzc merged 3 commits into
mainfrom
feat/sl47-model-overlays
Nov 1, 2026
Merged

solderzzc merged 3 commits into
mainfrom
feat/sl47-model-overlays

Conversation

@solderzzc

Copy link
Copy Markdown
Member

What

Adds 127 fork-only model implementations (LLM under Libraries/MLXLLM/SharpAI, VLM under Libraries/MLXVLM/SharpAI), each with its own Configuration, sanitize and <Name>Overlay.creators, plus 453 test files under Tests/MLXLMTests/SharpAI. 1050 files, +120,811 lines, additions only: no existing file is modified.

Inert on purpose

Nothing is registered with LLMModelFactory or VLMModelFactory here, so runtime behaviour does not change. Wiring is split out:

  • SL-50: LLM overlays into LLMModelFactory, upstream-wins, plus an air-gapped synthetic-weights load test for all 37 wired keys. Opened as a follow-up PR on top of this one.
  • SL-51: VLM overlays. They also need processors; none exist yet.

Scope guarantees

  • No change to .github/workflows or Package.swift.
  • All new types carry the SharpAI prefix so an upstream model of the same name cannot collide (see scripts/conformance/upstream/UPSTREAM_WATCH.md).

Validation so far

  • Before rebasing: full-tree debug build, all SharpAI tests green (430 classes, 2350 cases, 0 failed).
  • On main 5cbd33a, this tree together with the SL-50 wiring: release build OK; swift test -c release --no-parallel has one failure, the pre-existing GatedDeltaTests.testGatedDeltaFastPathKeepsDecayNearOneInFloat32 (0.0014360338 not less than 0.001). SpeculativeDecodingTests, Gemma4Tests and PerformanceRegressionTests pass.
  • This tree on its own has not been built in release. The CI on this PR is the first run of it, and it is much larger than any previous PR here, so a timeout or runner-memory failure is possible.

Review

Independent adversarial review covered the SL-50 wiring commit (5 dimensions, findings verified by a second agent). The 127 model implementations themselves have had no independent line-by-line review; their gate is the per-model tests plus this CI.

🤖 Generated with Claude Code

solderzzc and others added 3 commits October 31, 2026 23:41
Adds 127 fork-only model implementations under Libraries/MLXLLM/SharpAI (LLM)
and Libraries/MLXVLM/SharpAI (VLM) with per-model configuration, sanitize and
registration code, plus 453 test files under Tests/MLXLMTests/SharpAI.

Each model carries its own Configuration, a SharpAI-prefixed type set and a
<Name>Overlay.creators dictionary. Nothing is registered with LLMModelFactory or
VLMModelFactory in this change: the overlays are inert until SL-50 (LLM) wires
them with upstream-wins semantics, and SL-51 (VLM, which also needs processors).

Validation so far: a full-tree debug build with all SharpAI tests green (430
classes, 2350 cases) before rebasing, and a release build plus --no-parallel run
of this tree together with the SL-50 wiring on main 5cbd33a, whose only failure
is the pre-existing GatedDeltaTests.testGatedDeltaFastPathKeepsDecayNearOneInFloat32.
This tree on its own has not been built in release; the CI on the pull request is
the first run of it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…'s mlx-swift

The SwiftLM umbrella build (Test with SwiftLM) pins an older mlx-swift where
'MLXArray * Float' and a mixed Float expression feeding an MLXArray product do
not type-check: SharpAIDoryModel.swift:158-159 and SharpAIHyV4Attention.swift:95.
Use explicit MLXArray scalars; the arithmetic is unchanged (all float32).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Fixes the findings from the static review of the 127 overlay models that can be shown from this
repository alone. 34 findings are fixed, each with a test that fails before the change.

Blockers:
- BailingHybrid: LightningAttention slope is no longer a required parameter (`_slope`).
- BailingHybrid: sanitize now stacks expert weights into switch_mlp and splits kv_b_proj into
  embed_q / unembed_out. The target key names are not checked against a real checkpoint.
- Openvla: DINOv2 pos_embed has no class slot and is added to the patch tokens only.

Majors include duplicate @ModuleInfo keys (Glm5Next), sliding-window caches (CohereCompass,
Kolibri1), rotary pairing (HunyuanVl, LlavaOnevision2), quantized-cache traps (Flint, GraniteSwa,
GranitemoeSwa), batched deepstack (Colqwen3), router weights (DeepseekV3Bidirec), and several
sanitizers.

Not changed (8): findings that depend on the original Python/HF model or need a large port.
They are listed in docs, not in this commit.

Tests: all XCTest classes in the touched model directories pass (109 classes, 597 cases).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@solderzzc
solderzzc merged commit 25796e3 into main Nov 1, 2026
10 of 12 checks passed
solderzzc added a commit that referenced this pull request Nov 1, 2026
SL-55/56: fix deferred major and minor review findings from #102 (43 of 47)
@solderzzc
solderzzc deleted the feat/sl47-model-overlays branch November 4, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant