Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7d9a6ab
Fix doc comments and verify in CI (#176)
DePasqualeOrg Apr 6, 2026
780048f
Add more documentation for integrations to readme (#201)
DePasqualeOrg Apr 9, 2026
ec9619b
Fix tool calling for Llama 3 (#145)
aleroot Apr 9, 2026
ab04a9c
Add IntegrationTesting Xcode project and additional integration test …
atdrendel Apr 10, 2026
e53b701
feat(moe): parallel execution prefetch queue for SSD expert streaming
Apr 10, 2026
ad6bb69
fix(ci): restore remote url dependency for mlx-swift to fix github ac…
Apr 10, 2026
490aad2
Fix links in readme (#204)
DePasqualeOrg Apr 10, 2026
7f169f9
Preserve JSONValue in Llama3 Tool Calls (#203)
Lakr233 Apr 10, 2026
b0fb4de
feat: Expose Omni modality UserInput.Audio structures, Chat represent…
Apr 11, 2026
b050edf
fix: Resolve missing brace syntax error in Gemma4 and add any KVCache…
Apr 11, 2026
325bfb2
feat: Support global partial RoPE Base Frequencies and explicit QK-Lo…
Apr 11, 2026
5de772e
fix: Resolve potential merge conflicts for Gemma4 softcapping and sha…
Apr 11, 2026
b55297b
fix(gemma4): stabilize logit projection accuracy and mm weight sync
Apr 12, 2026
7d4bd1a
fix(kvcache): handle empty states gracefully on reload and add safe c…
Apr 12, 2026
5c3f6e5
feat(gemma4): implement native message generator for multimodal tokens
Apr 12, 2026
2a9283f
feat(audio): implement native Gemma-4 Omni Audio processing via Confo…
Apr 12, 2026
168c134
feat(vlm): stabilize Gemma 4 Omni integration bounds for Audio Subsam…
Apr 12, 2026
c9227c1
fix(gemma4): enforce explicit enableMoeBlock fallback mapping to prev…
Apr 12, 2026
1193966
feat: migrate and restructure STFT audio processing into MLXLMCommon
Apr 12, 2026
bd103cb
refactor(gemma4): integrate native MEL spectrogram audio pipeline int…
Apr 12, 2026
689b6ae
fix(vlm): mask per-layer text streams and scale multimodal vectors un…
Apr 12, 2026
d7b3426
fix(gemma): use exact reshape for multimodal mask
Apr 12, 2026
6a66ca5
chore: merge main into papps-ssd-streaming
Apr 12, 2026
93f23f7
fix(gemma4): restore manual normalizations and inputEmbedding paramet…
Apr 12, 2026
11a43be
fix(gemma4): prevent double scaling of inputEmbedding and fix omni pr…
Apr 12, 2026
a6c98c0
fix(gemma4): update camelCase config coding keys to match JSON schema
Apr 12, 2026
b871e30
fix: safely unwrap Gemma 4 VLM configuration options
Apr 12, 2026
c0c2624
fix: make LanguageModel and associated types Sendable for Swift 6
Apr 12, 2026
9691a5b
fix: use @unchecked Sendable for MLX-backed types in LanguageModel
Apr 12, 2026
1635f3d
revert: Sendable changes in LanguageModel to restore build sanity
Apr 12, 2026
6ec7742
fix(audio): resolve optional unwrapping build error in Gemma4Audio in…
Apr 12, 2026
4c5797b
fix(gemma4): stabilize PLE gated residual and weight sanitization; ad…
Apr 12, 2026
4b227d6
test(speculative): add hardened regression checks and CI protection gate
Apr 12, 2026
52c158e
feat(quality): add high-rigor regression suite for 8GB runners and Ge…
Apr 12, 2026
e614a0d
fix(gemma4): stabilize RoPE, softcapping, shared KV, and audio axis c…
Apr 12, 2026
fa64cf6
chore: fix Sendable violations, deprecations, and unused variables fo…
Apr 12, 2026
b3f9df2
fix: restore missing Foundation import in SwitchLayers
Apr 12, 2026
d9e8679
fix(gemma4): update Gemma4 and Gemma4VL parameter unpacking and archi…
Apr 12, 2026
640b63f
Merge remote-tracking branch 'origin/feature/papps-ssd-streaming' int…
Apr 12, 2026
1ff327c
fix(sync): resolve overlapping omni-model tied word embedding logic
Apr 12, 2026
87f854e
fix(gemma4): resolve missing MoE router projection weight during load
Apr 12, 2026
0fc3152
fix: build tests in release mode and execute them with -c release to …
Apr 12, 2026
71d6188
fix(gemma4): remove explicit ModuleInfo strings from internal Router …
Apr 13, 2026
67b146e
Add gemma 4 model (text, vision, MoE) (#180)
adrgrondin Apr 13, 2026
9b2ab37
fix(gemma4): resolve architectural phase shifts and initialization cr…
Apr 13, 2026
b5833b9
fix(gemma4): resolve multimodal blindness via accurate spatial convol…
Apr 13, 2026
f7c5c99
Add Gemma 4 text model support (E2B and E4B) (#185)
stefan-geens Apr 13, 2026
bc9c956
fix(gemma4audio): remove manual audio bounding tokens inhibiting tran…
Apr 13, 2026
112c45e
fix(gemma4): restore multimodal scale magnitudes and stabilize token …
Apr 13, 2026
d16b6c0
fix(gemma4): implement float32 safe RMSNorm wrapper, resolving NaN ov…
Apr 13, 2026
c1ff9f8
small v3 api fixes (#190)
davidkoski Apr 13, 2026
12664a1
fix(gemma4): finalize omni enhancements, audio logic, and native mask…
Apr 14, 2026
c658591
Merge upstream/main into feature/papps-ssd-streaming, adopting Apple'…
Apr 14, 2026
1b87754
chore: remove superseded Gemma4VL.swift in favor of upstream Gemma4.s…
Apr 14, 2026
8e5084e
test(gemma4): rewrite Gemma4Tests to use upstream Gemma4Model and JSO…
Apr 14, 2026
fb5e9ba
fix(ci): support @testable imports in release builds and clean up unu…
Apr 14, 2026
f47be0d
fix(tests): resolve syntax errors in SpeculativeDecodingTests.swift (…
Apr 14, 2026
dc91a4e
fix(ci): aggressive mlx.metallib injection for Metal accelerated test…
Apr 14, 2026
8f106a4
fix(ci): robust metallib injection into MacOS and Resources dirs insi…
Apr 14, 2026
94ce982
fix(tests): serialize all MLX-eval test suites to prevent Metal concu…
Apr 14, 2026
56c7966
fix(ci): disable parallel testing and serialize all suites to avoid A…
Apr 14, 2026
b80f257
fix(tests): serialize remaining MLX-eval tests (KVCache, Pooling) to …
Apr 14, 2026
e975a7d
fix(tests): fully encapsulate KVCacheTests inside serialized suite to…
Apr 14, 2026
91589f5
fix(tests): perfectly serialize all MLX suites by nesting them under …
Apr 14, 2026
f9fdac5
fix(tests): resolve matrix rank broadcasting logic in performance sui…
Apr 14, 2026
d96b95b
fix(layers): explicitly capture arrays in concurrent loops to resolve…
Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-and-test:
name: Build and Test (macOS 15)
runs-on: macos-15
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Metal Toolchain
run: xcodebuild -downloadComponent MetalToolchain || true

- name: Cache Swift packages
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-v1-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-v1-

- name: Clear stale module cache
run: find .build -type d -name ModuleCache -exec rm -rf {} + 2>/dev/null || true

- name: Resolve dependencies
run: swift package resolve

- name: Build (Release)
run: swift build -c release -Xswiftc -enable-testing --build-tests

- name: Install MLX Metal library
run: |
python3 -m venv /tmp/mlx_venv
/tmp/mlx_venv/bin/pip install --quiet mlx
MLX_LIB=$(find /tmp/mlx_venv -name "mlx.metallib" | head -n 1)
# Copy to build root and release root
cp $MLX_LIB .build/release/ 2>/dev/null || true
cp $MLX_LIB ./ 2>/dev/null || true
# Find the xctest bundle's MacOS directory and put it right next to the test runner binary
find .build -type d -name "MacOS" -exec cp $MLX_LIB {}/ \; 2>/dev/null || true
# Also put it in Resources just in case
find .build -type d -name "Resources" -exec cp $MLX_LIB {}/ \; 2>/dev/null || true
# Aggressive: put it next to any executable in the release dir
find .build -type f -executable -exec cp $MLX_LIB $(dirname "{}")/ \; 2>/dev/null || true

- name: Run Library Tests (Metal Accelerated)
run: swift test -c release --skip-build

- name: Gemma 4 PLE Stabilization Gate
run: |
# Verify PLE signal stability with full kernel support
swift test -c release --filter Gemma4StabilizationTests --skip-build

- name: Speculative Decoding Protection Gate
run: |
# Ensure speculative decoding parity and cache integrity are never regressed
swift test -c release --filter SpeculativeDecodingTests --skip-build

- name: High-Rigor Architectural Parity (Gemma 4)
run: |
# Verify Gemma 4 Gated Residuals and PLE math integrity
swift test -c release --filter Gemma4Tests --skip-build

- name: Performance & Memory Ceiling Audit (8GB Target)
run: |
# Enforce 6GB RSS limit and throughput baselines
swift test -c release --filter PerformanceRegressionTests --skip-build

- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: library-test-results
path: .build/artifacts/
retention-days: 7
28 changes: 28 additions & 0 deletions .github/workflows/performance_audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Performance Audit

on:
pull_request:
types: [labeled]

jobs:
benchmark:
if: contains(github.event.pull_request.labels.*.name, 'run-benchmark')
name: Regression Benchmark
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build Benchmark Tool
run: swift build -c release --product BenchmarkHelpers

- name: Run Baseline Gemma4 Benchmark
run: |
# Use synthetic weights for performance tracking to avoid GBytes of downloads in CI
swift run -c release mlx-swift-lm-benchmark --model gemma4 --synthetic --prompt-len 512 --gen-len 128

- name: Run Memory Efficiency Audit
run: |
# Check for memory leaks / peak memory stability
swift run -c release mlx-swift-lm-benchmark --model gemma4 --synthetic --max-mem 4GB
12 changes: 12 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ jobs:
run: |
pre-commit run --all || (echo "Style checks failed, please install pre-commit and run pre-commit run --all and push the change"; echo ""; git --no-pager diff; exit 1)

docs:
needs: lint
if: github.repository == 'ml-explore/mlx-swift-lm'
runs-on: [self-hosted, macos]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Verify documentation
run: scripts/verify-docs.sh

mac_build_and_test:
needs: lint
if: github.repository == 'ml-explore/mlx-swift-lm'
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/regression_harness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Regression Harness

on:
pull_request:
types: [labeled]

jobs:
performance-audit:
if: contains(github.event.pull_request.labels.*.name, 'run-benchmark')
name: Performance & Memory Audit
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Metal Toolchain
run: xcodebuild -downloadComponent MetalToolchain || true

- name: Build Benchmark Tool
run: swift build -c release --product BenchmarkHelpers

- name: Install MLX Metal library
run: |
python3 -m venv /tmp/mlx_venv
/tmp/mlx_venv/bin/pip install --quiet mlx
cp /tmp/mlx_venv/lib/python*/site-packages/mlx/lib/mlx.metallib .build/release/

- name: TFLOPS Regression Check
run: |
# Verify that throughput remains stable
swift run -c release mlx-swift-lm-benchmark --model gemma4 --synthetic --prompt-len 512 --gen-len 128

- name: Memory Efficiency Audit
run: |
# Check peak memory stability (mimicking root project's speculative-decoding-eval)
swift run -c release mlx-swift-lm-benchmark --model gemma4 --synthetic --max-mem 4GB

- name: Token Variance Check
run: |
# Verify that the output token variance is within baseline (PLE stability)
swift run -c release mlx-swift-lm-benchmark --model gemma4 --synthetic --verbose
35 changes: 34 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,44 @@ possible.
You can also run the formatters manually as follows:

```
swift-format format --in-place --recursive Libraries Tools Applications
swift-format format --in-place --recursive Libraries Tools Applications IntegrationTesting
```

or run `pre-commit run --all-files` to check all files in the repo.

## Running Tests

Unit tests run without any special hardware and do not download models.
Note: `swift test` [does not work yet](https://github.com/ml-explore/mlx-swift?tab=readme-ov-file#xcodebuild) — use `xcodebuild` instead:

```bash
xcodebuild test -scheme mlx-swift-lm-Package -destination 'platform=macOS'
```

Integration tests verify end-to-end model loading and generation. They require
macOS with Metal and download models from Hugging Face Hub on first run. These
tests do not run in CI.

Open `IntegrationTesting/IntegrationTesting.xcodeproj` in Xcode and run the
test target (`Cmd+U` or via the Test Navigator), or use `xcodebuild`:

```bash
# Run all integration tests
xcodebuild test \
-project IntegrationTesting/IntegrationTesting.xcodeproj \
-scheme IntegrationTesting \
-destination 'platform=macOS'

# Run a single test
xcodebuild test \
-project IntegrationTesting/IntegrationTesting.xcodeproj \
-scheme IntegrationTesting \
-destination 'platform=macOS' \
-only-testing:IntegrationTestingTests/ToolCallIntegrationTests/qwen35FormatAutoDetection\(\)
```

See [Libraries/IntegrationTestHelpers/README.md](Libraries/IntegrationTestHelpers/README.md) for more details.

## Issues

We use GitHub issues to track public bugs. Please ensure your description is
Expand Down
Loading
Loading