Benchmarks
Run semiempirical quantum chemistry and molecular dynamics, compute partial charges, generate 3D conformers and cluster molecules in one open-source Python toolkit. MLXMolKit uses MLX and Metal to accelerate batched calculations on Apple silicon GPUs.
See how the conformer, MMFF94, clustering and fingerprint search results compare with RDKit, and how PM7 energies compare with OpenMOPAC on the same geometries.
Current results were measured on an Apple M3 Max with macOS 27.2.1, MLX 0.32.5 and RDKit 2026.09.2. Tested MLXMolKit revision 3a6b663. See the project’s additional benchmark notes.
PM7 CPU batch validation against MOPAC
PM7 heat of formation for NaH
Single-point calculation for neutral NaH. Both programs use the same Cartesian coordinates for each case. Energies are in kcal/mol.
| Geometry | MOPAC 23.2.5 | MLXMolKit CPU batch |
|---|---|---|
| 1.85 Å, diagonal | 58.60754 | 58.60754 |
| 1.85 Å, reversed atom order | 58.60754 | 58.60754 |
| 2.05 Å, stretched | 74.81992 | 74.81992 |
Compared with MOPAC’s PM7 CHARGE=0 1SCF SCFCRT=1.D-9 calculation. The regression test also checks the Mulliken charges for all three geometries. Regression test.
MMFF optimisation from identical starting coordinates
Packed Metal BFGS completed the batch faster. RDKit reached lower residual forces. The energy tolerance measures agreement with RDKit for each conformer.
Packed Metal BFGS and RDKit MMFF94
Both methods start from the same 2,500 ETKDGv3 conformers across 50 molecule entries. Times are medians of seven warm runs. Metal timing includes parameter extraction, packing, optimisation and writing back coordinates.
| Method | Iteration cap | Wall time | Within 0.1 kcal/mol | Mean |ΔE| (kcal/mol) |
|---|---|---|---|---|
| RDKit 2026.09.2, 14 threads | 1,000 | 555.15 ms | Reference | — |
| Packed Metal BFGS | 500 | 299.82 ms | 2,444 / 2,500 | 0.09888 |
Residual forces at the returned coordinates
Independently rescored by RDKit MMFF94. Each conformer contributes the largest Euclidean force norm on any of its atoms, in kcal/mol/Å.
| Method | Median | 95th percentile | Maximum |
|---|---|---|---|
| RDKit, 14 threads | 0.00064 | 0.00251 | 0.01028 |
| Packed Metal BFGS | 0.01924 | 0.06789 | 0.41884 |
The reproduction script runs with python -m benchmarks.mmff_matched_accuracy --repeats 7. The median uses the same per-conformer force values as the 95th percentile and maximum reported by the script.
Dynamic Butina clustering
Ordered clusters on the LIT-PCBA ADRB2 fixture
Times start from precomputed fingerprints, already on the GPU for Metal. Metal timings are medians of seven warm runs. Each RDKit timing is one run including the distance calculation.
| Fingerprints | Tanimoto similarity cutoff | Metal | RDKit | Ordered clusters |
|---|---|---|---|---|
| 8,192 | 0.25 | 5.671 ms | 3.514 s | 1,481 |
| 20,000 | 0.40 | 15.680 ms | 21.616 s | 9,111 |
With reordering=True, the order of clusters and of molecules within each cluster matches RDKit exactly. The input contains 1,024-bit Morgan fingerprints of radius 3 without chirality. We shuffle the LIT-PCBA ADRB2 inactive_T.smi rows with NumPy seed 20261203 and retain valid molecules with unique canonical SMILES. The smaller fixture uses the first 8,192 entries of the same 20,000-fingerprint sample. Dataset · Reproduction script.
Fingerprint search
Exact top-eight fingerprint search
64 queries against the same 20,000 LIT-PCBA ADRB2 fingerprints. Times are medians of seven warm runs.
| Method | Search time | With index construction and any upload |
|---|---|---|
| RDKit | 128.111 ms | — |
| Metal | 0.785 ms | 1.227 ms |
| Native CPU NEON | 2.284 ms | 2.609 ms |
| Automatic backend, NumPy input | 0.700 ms | — |
Every returned index and similarity score agrees with RDKit in rank order. The resident Metal search starts with its index and queries already on the GPU. Reproduction script.
Conformer quality against RDKit
Heavy-atom RMSD to the nearest RDKit conformer
ETKDGv2 with RDKit 2026.09.2. Twenty conformers per method for each of seeds 1, 19 and 42. Each Metal pose is matched to its closest RDKit pose for the same seed using symmetry-aware alignment without reflections. Statistics pool the 60 matches per row.
| Molecule | Atoms incl. H | Before MMFF, median | After MMFF, median | After MMFF, 90th percentile |
|---|---|---|---|---|
| Benzene | 12 | 0.008 Å | <0.001 Å | <0.001 Å |
| Aspirin | 21 | 0.045 Å | <0.001 Å | 0.0014 Å |
| (R)-Ibuprofen | 33 | 0.107 Å | 0.0011 Å | 0.476 Å |
| (S)-Ibuprofen | 33 | 0.115 Å | 0.0011 Å | 0.476 Å |
| Acetaminophen | 20 | 0.029 Å | <0.001 Å | 0.0080 Å |
Matching in the reverse direction, from RDKit to Metal, gave a 90th percentile of 0.42 Å for (R)-ibuprofen and 0.46 Å for (S)-ibuprofen. This matched the two independently seeded RDKit ensembles at the precision shown.
In a separate test starting both optimisers from the same 120 ibuprofen conformers, the largest heavy-atom RMSD was 0.0144 Å and the largest absolute energy difference under RDKit’s MMFF94 was 0.000916 kcal/mol. Reproduction script.
Test suite
The full source suite recorded 1,882 passed, 8 failed, 142 skipped and 4 expected failures. The eight failures also reproduce on the GitHub main revision used as the base. They cover four PM6 reference checks that depend on RDKit-generated coordinates, two package checks and two PM7 tests that expect a separate hydrogen-bond term in MOPAC’s output. The NaH CPU batch regression cases passed.
Historical benchmarks
MMFF speed and energy agreement
The legacy fused optimiser reached the 0.1 kcal/mol tolerance for 800 conformers at 200 iterations and 2,326 at 2,000 iterations. The historical kernel could report the energy from before its final coordinate update.
Legacy fused and multi-molecule optimisers
Historical measurements on an Apple M3 Max. 50 molecule entries × 50 conformers, 9–49 atoms. ΔE in kcal/mol against RDKit.
| Method | Total | ms/conf | vs RDKit 14T | Mean |ΔE| | Within 0.1 kcal/mol |
|---|---|---|---|---|---|
| RDKit, 1 thread | 3.98 s | 1.59 | 0.13× | — | — |
| RDKit, 14 threads | 0.50 s | 0.20 | 1.00× | 0.000 | — |
| Fused, 200 iterations | 0.41 s | 0.16 | 1.22× | 1.742 | 800 |
| Fused, 500 iterations | 0.84 s | 0.34 | 0.59× | 0.520 | 1,431 |
| Fused, 1,000 iterations | 1.59 s | 0.64 | 0.31× | 0.203 | 2,019 |
| Fused, 2,000 iterations | 3.10 s | 1.24 | 0.16× | 0.073 | 2,326 |
| Multi, 1,000 iterations | 3.39 s | 1.36 | 0.15× | 0.015 | 2,470 |
| Multi, 2,000 iterations | 3.69 s | 1.48 | 0.13× | 0.015 | 2,470 |
How the comparison is timed
mmff_optimize_batch(mol, conf_ids)batches the conformers of a single molecule. Use the multi-molecule entry points to measure throughput across molecules.MMFFOptimizeMoleculeConfsoptimises in place. Start each method from a freshChem.Mol(m).- Run comparisons on a quiet machine so other work does not slow the multithreaded CPU baseline.
Historical conformer throughput
Earlier Metal pipeline measurements for N molecule entries × k conformers per entry. The original input manifest is unavailable.
| Scale | Pipeline | Time | Conformers/s | Converged |
|---|---|---|---|---|
| N = 1,000, k = 10 | DG + ETK | 5.0 s | 2,017 | 99.7% |
| N = 1,000, k = 10 | DG + ETK + MMFF | 8.0 s | 1,250 | 99.7% |
| N = 10,000, k = 1 | DG + ETK | 17.7 s | 565 | 99.6% |
| N = 10,000, k = 1 | DG + ETK + MMFF | 37.9 s | 264 | 99.6% |
| N = 10,000, k = 10 | DG + ETK | 38.1 s | 2,625 | 99.7% |
| N = 10,000, k = 10 | DG + ETK + MMFF | 67.9 s | 1,473 | 99.7% |
Historical batch-size sweep
20 molecule entries × 50 conformers. Larger batches reduced the number of kernel launches in this run.
| Batch | Batches | Time | Conformers/s |
|---|---|---|---|
| 100 | 10 | 0.62 s | 1,610 |
| 500 | 2 | 0.29 s | 3,394 |
| 1,000+ | 1 | 0.22 s | 4,442 |
Historical Enamine REAL clustering
Enamine REAL subset, Morgan fingerprints, Tanimoto cutoff 0.40. This implementation built the neighbour graph on the GPU and clustered it on the CPU.
| Molecules | Similarity → CSR | Butina | Total | Memory |
|---|---|---|---|---|
| 20,000 | 0.26 s | 0.09 s | 0.35 s | 0.1 MB |
| 50,000 | 1.26 s | 0.36 s | 1.62 s | 0.5 MB |
| 100,000 | 4.87 s | 0.97 s | 5.84 s | 1.3 MB |
GPU memory per conformer
BFGS keeps a dense (3n)² Hessian, so it grows as O(n²); the pipeline switches to L-BFGS above ~150 atoms.
| Atoms | DG (4D) | ETK (3D) | MMFF, BFGS | MMFF, L-BFGS |
|---|---|---|---|---|
| 5 | 1.9 KB | 1.4 KB | 1.3 KB | 1.4 KB |
| 12 | 4.4 KB | 3.3 KB | 6.0 KB | 3.3 KB |
| 21 | 7.6 KB | 5.7 KB | 17.2 KB | 5.7 KB |
| 30 | 10.8 KB | 8.1 KB | 34.1 KB | 8.1 KB |
| 50 | 18.0 KB | 13.5 KB | 92.0 KB | 13.5 KB |
| 64 | 23.1 KB | 17.3 KB | 149.2 KB | 17.3 KB |
The earlier pipeline used 2.6 MB for 10,000 conformers at a fixed batch size of 500, processing batches sequentially.