Skip to content

Switch from mlx-rs to quill-mlx - #39

Merged
rgbkrk merged 4 commits into
mainfrom
quill-mlx
Mar 22, 2026
Merged

Switch from mlx-rs to quill-mlx#39
rgbkrk merged 4 commits into
mainfrom
quill-mlx

Conversation

@rgbkrk

@rgbkrk rgbkrk commented Mar 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace mlx-rs / mlx-macros with quill-mlx / quill-mlx-macros (our fork, published on crates.io)
  • Cap Metal buffer cache at 2 GB on MCP server startup via quill_mlx::metal::set_cache_limit(), fixing unbounded memory growth (102 GB+) in long-running sessions
  • Update scaled_dot_product_attention call for new sinks parameter
  • Update build.rs metallib discovery to match quill-mlx-sys-* directories

Why fork

  • Upstream mlx-rs doesn't expose Metal memory management APIs, causing the voice MCP server to leak ~100 GB over extended use
  • cargo install voice is broken due to metallib path baked to temp build directory (oxiglade/mlx-rs#327)
  • We need to move faster on fixes for voice — possible things to upstream later

Fork details

  • Repo: rgbkrk/mlx-rs (branch quill-mlx, set as default)
  • Crates: quill-mlx 0.25.4, quill-mlx-sys 0.2.1, quill-mlx-macros 0.25.4

Test plan

  • cargo check -p voice passes
  • cargo build --release -p voice succeeds
  • cargo test --workspace — all tests pass
  • Run MCP server and verify memory stays bounded after repeated speak calls

rgbkrk added 4 commits March 22, 2026 14:25
Replace mlx-rs/mlx-macros with quill-mlx/quill-mlx-macros across all
workspace crates. The fork adds Metal memory management APIs that were
missing from upstream, fixing unbounded GPU buffer cache growth (102GB+)
in long-running MCP server sessions.

- Cap Metal buffer cache at 2GB on MCP server startup
- Update scaled_dot_product_attention call for new sinks parameter
Update all workspace crates to use quill-mlx 0.25.4 from crates.io
instead of path dependencies. Update build.rs metallib discovery to
also match quill-mlx-sys-* build directories.
Previous 0.25.4 was based on upstream main which had mlx-c v0.5.0
(MLX v0.30.6), causing kernel load failures at runtime. 0.25.5 is
based on the v0.25.3 tag with mlx-c v0.2.0 (MLX v0.25.1).

Revert scaled_dot_product_attention sinks parameter since the v0.25.x
API doesn't have it.
@rgbkrk
rgbkrk merged commit cd01811 into main Mar 22, 2026
1 check passed
@rgbkrk rgbkrk mentioned this pull request Mar 22, 2026
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