atlas

Research map / Large language models / Agents, code and math

Einsum Benchmark: Enabling the Development of Next-Generation Tensor Execution Engines

NeurIPS 2024 · Large language models › Agents, code and math · approach: LLM-guided program synthesis · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces a benchmark of 168 einsum problems across seven categories plus generators and converters, and uses it to expose performance pitfalls in current einsum libraries.

Problem

Current einsum libraries are tuned for a few large, dense, floating-point tensors, while practical einsum expressions (tensor networks, hyperedges, Hadamard products, traces, sparse and integer tensors) are much broader and lack a public benchmark.

Approach

A curated and generated benchmark of diverse real-world and synthetic einsum expressions with metadata and precomputed contraction paths, plus generators and converters, used to probe concrete weaknesses of opt_einsum, cotengra, NumPy, PyTorch, TensorFlow, JAX and SQLite.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use sparse tensor storage instead of dense tensorseinsum execution on PyTorch versus SQLite · mc_2021_036execution time (seconds): 43.2 ± 0.09 -> 34.2 ± 0.04Helped
Optimize contraction paths for intermediate size rather than operation countopt_einsum with PyTorch backend · qc_circuit_n49_m14_s9_e6_pEFGH_simplifiedaverage execution time (seconds): 6.37 s (SD: 2.68) -> 1.78 s (SD: 0.27)Helped
Use GPU-only execution instead of CPU-only executionPyTorch · mc_2020_082execution time (seconds): 4.71 ± 0.03 -> 6.48 ± 0.04Hurt
Use hybrid CPU-GPU execution for pairwise contractionsPyTorch · mc_2020_082execution time (seconds): 4.71 ± 0.03 -> 3.28 ± 0.01Helped
Use PyTorch instead of TensorFlow for floating-point pairwise contractionsopt_einsum backends · mc_rw_blockmap_05_01.netexecution time (seconds): 42.30 ± 0.11 -> 7.93 ± 0.29Helped
Use JAX int16 instead of JAX int32JAX · mc_rw_blockmap_05_01.netexecution time (seconds): 25.27 ± 0.13 -> 220.18 ± 0.91Hurt

Surprising findings

Limitations

Experimental setup

Datasets: UAI 2022 Competition graphical model instances model counting competition instances (2020-2023) weighted model counting competition instances opt_einsum random equations cotengra generators

Benchmarks: Einsum Benchmark

Metrics: execution time in seconds path computation time theoretical number of operations speedup

Baselines: opt_einsum cotengra NumPy einsum PyTorch TensorFlow JAX SQLite

Builds on: opt_einsum cotengra

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy