Skip to content

Instantly share code, notes, and snippets.

@awni
awni / fast_mlx.md
Last active November 9, 2025 20:14
Writing Fast MLX

Making MLX Go Fast

This guide assumes you have some familiarity with MLX and want to make your MLX model or algorithm as efficient as possible.

The guide covers the following:

@awni
awni / ops_data_dependent_shapes.md
Last active October 15, 2025 17:09
Working around operations with data-dependent shapes in MLX

Ops with Data Dependent Shapes

This is a short article on a common type of not-yet-supported operation in MLX: ops where the output shape depends on the input data. Here's an outline:

  1. An introduction to these operations, followed by an explanation of why they are challenging to implement efficiently.
  2. A discussion on when and how to work-around these missing operations with a couple of examples.

The Ops