End‑User Angle

You can now run the same MoE kernel that powers Composer 2.5. The kernel is called Mixture‑of‑Kittens, or MoK. Cursor released it on GitHub. The repo contains build scripts and sample code.

To try it you need a machine with NVIDIA GPUs that support the NVL72 architecture. Those are the GB300 nodes that have 72 GPUs in one NVLink domain. If you run on a cloud provider that offers a GB300 instance, you can use MoK out of the box. Otherwise you need a local rack with similar NVLink connectivity.

Installation is straightforward. Clone the repository, run the CMake build, and link the resulting library into your training script. The kernel works with PyTorch through a custom extension. Cursor supplies a Python wrapper that mirrors the torch.nn.Module API.

Cost stays the same as your compute budget. MoK does not add extra hardware fees. It only improves throughput. Cursor reports a 1.41× increase in tokens‑per‑second for its production workloads. That translates to faster model training or cheaper runs for the same amount of work.

Getting started:

  1. git clone https://github.com/cursor/mixture-of-kittens
  2. cd mixture-of-kittens && mkdir build && cd build
  3. cmake .. -DCMAKEBUILDTYPE=Release
  4. make -j$(nproc)
  5. Follow the README.md to install the Python bindings.

After that, replace your MoE layer with torch.ops.mok.mokforward and mokbackward. The API matches the existing MoE calls, so you can drop‑in the kernel.

For users who do not have GB300 hardware, the kernel still runs on any CUDA‑compatible GPU. Expect lower gains because the communication tricks rely on fast NVLink. You can still experiment on a single A100 or H100.

In short, MoK is a free, high‑performance MoE kernel. Use it to speed up large language model training. No subscription, just a GitHub repo.


Engineer Angle

MoK is a deterministic megakernel that fuses MoE communication and computation. It replaces the traditional two‑step dispatch‑compute‑combine pipeline with a single CUDA kernel.

Architecture

  • Pull‑based forward dispatch – each destination rank pulls tokens from sources. This eliminates cross‑GPU signalling and cuts NVLink traffic by ~12 KB per transfer.
  • Push‑based forward combine – after the expert FFNs finish, the destination pushes results back. The kernel re‑uses the same schedule table for both directions.
  • Ring token buffers – the schedule lives in GPU memory. No CPU involvement. Tokens flow in a ring, avoiding CPU‑GPU sync.
  • Inter‑SM overlap – a subset of SMs handles communication, the rest runs the expert FFNs. The two groups signal each other via a device‑side counter.
  • Determinism – the kernel orders tokens per‑expert, guaranteeing reproducible results across runs.
  • MXFP8 support – mixed‑precision FP8 kernels (MXFP8) integrate seamlessly, boosting throughput on newer hardware.

Scheduling Details

The kernel builds a two‑column schedule {srcrank, srcindex} for pull‑dispatch. It runs entirely on the device, taking < 3 % of total MoE time. The table is a few megabytes at worst and can be reused for forward and backward passes.

A minibatch size tunes the compute‑communication granularity. MoK chooses a size that gives each expert‑grouped GEMM at least two full SM waves. This balances tensor‑core saturation with overlap efficiency.

Benchmarks

In Cursor’s production stack across multiple GB300 racks, MoK lifts end‑to‑end tokens per second by 1.41×. Microbenchmarks on Blackwell GPUs show up to 29 % higher NVLink utilization for pull‑based dispatch versus push‑based. Latency for signalling drops from 103 µs to 18 µs.

Integration Steps

  1. Clone the repo and build with CUDA 12.
  2. Install the Python bindings (pip install . inside the python/ folder).
  3. Replace your MoE layer calls with the wrapper functions mokforward and mokbackward.
  4. Configure the minibatch size via the MOKMINIBATCHTOKENS environment variable.
  5. Run a validation pass to confirm deterministic output.

MoK targets DeepSeek‑V3 style MoE layers (shared + routed experts, top‑k routing). It works with GLM, Qwen, Kimi up to 2.7, and other models with similar routing.


Contrarian Note

MoK shines only on NVL72‑type hardware. Those racks are rare and costly. Most users run on a handful of A100/H100 GPUs. On such systems the kernel still runs but the communication gains shrink dramatically.

The megakernel is monolithic. Debugging a failure means rebuilding the whole kernel. The schedule tables assume a full‑rank layout; using a subset of GPUs can break the ring buffers.

Determinism forces strict token ordering. In highly imbalanced routing scenarios this ordering can introduce idle lanes, hurting performance.

The code base is large and highly tuned for Cursor’s internal stack. External contributors may struggle to adapt it to their own pipelines. Documentation is thin beyond the README.

Finally, the 1.41× speedup is a production figure on Cursor’s own workloads. Benchmarks on public cloud instances show modest gains (10‑20 %). The hype may outpace real‑world benefits for smaller teams.

In short, MoK is a powerful kernel for well‑resourced labs with NVL72 clusters. For most practitioners it remains a niche tool that demands specialized hardware and deep integration effort.