ausimian

ausimian

Emily - A new MLX-based backend for Nx

Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving, and Bumblebee all dispatch to the Metal GPU on Apple Silicon with no further integration work.

Highlights:

  • Nx.Backend with transparent fallback for uncovered ops
  • Nx.Defn.Compiler that threads Bumblebee and Nx.Serving through MLX
  • Fused transformer kernels (rms_norm, layer_norm, rope, scaled-dot-product attention), optionally applied to any Bumblebee model via a shim
  • Affine group-wise int2 / int4 / int8 quantisation
  • bf16 mixed-precision training
  • Per-process Metal command queues for concurrent inference on a shared model
  • Runnable Livebooks for DistilBERT QA, Qwen3 quantized generation, MNIST training, Whisper transcription,
    and the fused kernels

MLX is vendored in (for now) because the recent command queue threading-related features have not yet been released. The first compile will compile MLX, which can be a bit slow (> 1 min).

macOS / Apple Silicon. Requires Xcode with the Metal toolchain;

https://github.com/ausimian/emily

Most Liked

ausimian

ausimian

Roughly:

  • emily exposes the concurrency model now available in mlx, I assume emlx can’t do this because of the version it uses.
  • emily has features I don’t believe emlx advertises. Fused kernels, quantisation, mixed precision training (might be wrong about this one), maybe also zero-copy to_binary/1.
  • emily vendors mlx at a specific commit (for reasons outlined above and in more details in the docs), emlx uses a relatively old binary
  • There’s quite a few conformance tests in emily that use real open-source models, but I mostly did that for my own sanity
polvalente

polvalente

Nx Core Team

We’re open to bringing in any features to EMLX you feel are missing (and also you as a maintainer) if you wanna join efforts!

kip

kip

ex_cldr Core Team

Amazing work, that’s such a great contribution and I can’t wait to give it a spin.

Where Next?

Popular in Announcing Top

danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
asiniy
Hey there! I wrote a download elixir package which does exactly what its name about - an easy way to download files. I saw solutions ab...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
blatyo
The best overview for how things are tied together is this presentation. Modules and functions are pretty well documented at this point, ...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 10858 107
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement