# emily v0.3.5 - Table of Contents

Elixir bindings and Nx backend for Apple MLX

## Pages

- [Changelog](changelog.md)

- README
  - [Emily](readme.md)

- Notebooks
  - [DistilBERT question answering on Emily](distilbert_qa.md)
  - [Qwen3-0.6B quantized generation on Emily](qwen3_quantized.md)
  - [Training an MNIST classifier on Emily](mnist_training.md)
  - [Whisper transcription on Emily](whisper_transcription.md)
  - [Fused transformer kernels on Emily](fast_kernels.md)

## Modules

- Core
  - [Emily](Emily.md): Elixir bindings and Nx backend for Apple's MLX.
  - [Emily.Backend](Emily.Backend.md): `Nx.Backend` implementation backed by Apple's MLX.
  - [Emily.Compiler](Emily.Compiler.md): `Nx.Defn.Compiler` implementation that runs `defn` computations on
`Emily.Backend`.

- Concurrency
  - [Emily.Stream](Emily.Stream.md): Per-process MLX stream management for concurrent inference.

- Quantization
  - [Emily.Quantization](Emily.Quantization.md): Quantized inference primitives.
  - [Emily.Quantization.Layers](Emily.Quantization.Layers.md): Defn-traceable quantized layer op for use inside Axon graphs.
  - [Emily.QuantizedWeight](Emily.QuantizedWeight.md): Container for a matrix quantized via one of MLX's group-wise quantization
schemes (`"affine"` int4/int8, plus the microscaled variants
`"mxfp4"`, `"mxfp8"`, `"nvfp4"`).

- Training
  - [Emily.MixedPrecision](Emily.MixedPrecision.md): Mixed-precision training utilities.
  - [Emily.MixedPrecision.LossScaler](Emily.MixedPrecision.LossScaler.md): Dynamic loss-scaler state for mixed-precision training.

- Performance
  - [Emily.Bumblebee.FastKernels](Emily.Bumblebee.FastKernels.md): Rewrite RMSNorm, LayerNorm, RoPE, and SDPA Axon layers of a
Bumblebee model so they call `Emily.Fast.*` instead of their stock
defn implementations. When the rewritten model is then evaluated
under `Emily.Compiler`, those `Emily.Fast.*` calls dispatch to
fused MLX kernels via the `:optional`-node mechanism (see
`Emily.Fast`'s moduledoc). On any other backend the helpers fall
back to defn composition and produce mathematically equivalent
results, so applying the shim is safe even if the model is later
evaluated on `Nx.BinaryBackend` or EXLA.
  - [Emily.Fast](Emily.Fast.md): Fused transformer kernels as `defn`-callable helpers.

- Observability
  - [Emily.Telemetry](Emily.Telemetry.md): `:telemetry` events emitted by Emily.

## Mix Tasks

- [mix bench.native](Mix.Tasks.Bench.Native.md): Build and run the standalone C++ microbenchmarks under `bench/native/`.

