mlxmolkit — GPU-accelerated molecular clustering on Apple Silicon

Recently a guest post from NVIDIA described GPU-Accelerated Clustering with nvMolKit that uses CUDA.

A recent post no describes a port of the nvMolKit (CUDA) molecular clustering pipeline to Apple Metal via MLX. All code is on GitHub https://github.com/guillaume-osmo/mlxmolkit?tab=readme-ov-file

Implements the same 3-step workflow as the RDKit blog post:

  1. Morgan Fingerprinting — RDKit GetMorganGenerator (CPU, multi-threaded)
  2. Pairwise Tanimoto Similarity — Custom Metal kernel (GPU)
  3. Butina Clustering — Greedy algorithm on CSR neighbour list (CPU)

Key results

Tested on Enamine REAL 10.4M subset (same dataset as the blog), Apple M3 Max:

NFused sim→CSRButinaTotalvs RDKitMemory
20k0.26s0.09s0.35s152x0.1 MB
50k1.26s0.36s1.62s0.5 MB
100k4.87s0.97s5.84s1.3 MB

Related Posts