Skip to main content

OpenEquivariance

OEQ C++ Extension Build Verification License

[PyTorch Examples] [JAX Examples] [Citation and Acknowledgements]

OpenEquivariance is a CUDA, HIP, and SYCL (new! beta) kernel generator for the Clebsch-Gordon tensor product, a key kernel in rotation-equivariant deep neural networks. It implements some of the tensor products that e3nn supports commonly found in graph neural networks (e.g. Nequip or MACE). To get started, make sure that you have PyTorch installed and run:

pip install openequivariance

We provide up to an order of magnitude acceleration over e3nn perform on par with the latest version of NVIDIA cuEquivariance, which has a closed-source kernel package. We also offer fused equivariant graph convolutions that can reduce computation and memory consumption significantly.

For detailed instructions on tests, benchmarks, MACE / Nequip, and our API, check out the documentation.

⭐️ SYCL (beta): Thanks to @abagusetty, OpenEquivariance now supports Intel XPUs on PyTorch by compiling SYCL kernels. See our installation guide for more details.

⭐️ JAX: We support JAX for NVIDIA and AMD GPUs. See the section below for example usage and our API page for more details.

PyTorch Examples

Here's a CG tensor product implemented by e3nn:

import torch
import e3nn.o3 as o3

gen = torch.Generator(device='cuda')

batch_size = 1000
X_ir, Y_ir, Z_ir = o3.Irreps("1x2e"), o3.Irreps("1x3e"), o3.Irreps("1x2e") 
X = torch.rand(batch_size, X_ir.dim, device='cuda', generator=gen)
Y = torch.rand(batch_size, Y_ir.dim, device='cuda', generator=gen)

instructions=[(0, 0, 0, "uvu", True)]

tp_e3nn = o3.TensorProduct(X_ir, Y_ir, Z_ir, instructions,
        shared_weights=False, internal_weights=False).to('cuda')
W = torch.rand(batch_size, tp_e3nn.weight_numel, device='cuda', generator=gen)

Z = tp_e3nn(X, Y, W)
print(torch.norm(Z))

And here's the same tensor product using openequivariance. We require that your tensors are stored on a CUDA device for this to work:

import openequivariance as oeq

problem = oeq.TPProblem(X_ir, Y_ir, Z_ir, instructions, shared_weights=False, internal_weights=False)
tp_fast = oeq.TensorProduct(problem, torch_op=True)

Z = tp_fast(X, Y, W) # Reuse X, Y, W from earlier
print(torch.norm(Z))

Our interface for oeq.TPProblem is almost a strict superset of o3.TensorProduct (two key differences: we impose internal_weights=False and add support for multiple datatypes). You can pass e3nn Irreps instances directly or use oeq.Irreps, which is identical.

We recommend reading the e3nn documentation and API reference first, then using our kernels as drop-in replacements. We support most "uvu" and "uvw" tensor products; see this section for an up-to-date list of supported configurations.

Important: For many configurations, our kernels return results identical to e3nn up to floating point roundoff (this includes all "uvu" problems with multiplicity 1 for all irreps in the second input). For other configurations (e.g. any "uvw" connection modes), we return identical results up to a well-defined reordering of the weights relative to e3nn.

If you're executing tensor products as part of a message passing graph neural network, we offer fused kernels that save both memory and compute time:

from torch_geometric import EdgeIndex

node_ct, nonzero_ct = 3, 4

# Receiver, sender indices for message passing GNN
edge_index = EdgeIndex(
                [[0, 1, 1, 2],  # Receiver 
                 [1, 0, 2, 1]], # Sender 
                device='cuda',
                dtype=torch.long)

X = torch.rand(node_ct, X_ir.dim, device='cuda', generator=gen)
Y = torch.rand(nonzero_ct, Y_ir.dim, device='cuda', generator=gen)
W = torch.rand(nonzero_ct, problem.weight_numel, device='cuda', generator=gen)

tp_conv = oeq.TensorProductConv(problem, torch_op=True, deterministic=False) # Reuse problem from earlier
Z = tp_conv.forward(X, Y, W, edge_index[0], edge_index[1]) # Z has shape [node_ct, z_ir.dim]
print(torch.norm(Z))

If you can guarantee EdgeIndex is sorted by receiver index and supply the transpose permutation, we can provide even greater speedup (and deterministic results) by avoiding atomics:

_, sender_perm = edge_index.sort_by("col")            # Sort by sender index 
edge_index, receiver_perm = edge_index.sort_by("row") # Sort by receiver index

# Now we can use the faster deterministic algorithm
tp_conv = oeq.TensorProductConv(problem, torch_op=True, deterministic=True) 
Z = tp_conv.forward(X, Y[receiver_perm], W[receiver_perm], edge_index[0], edge_index[1], sender_perm) 
print(torch.norm(Z))

Note: you don't need Pytorch geometric to use our kernels. When deterministic=False, the sender and receiver indices can have arbitrary order.

JAX Examples

After installation, use the library as follows. Set OEQ_NOTORCH=1 in your environment to avoid the PyTorch import in the regular openequivariance package.

import jax
import os

os.environ["OEQ_NOTORCH"] = "1"
import openequivariance as oeq

seed = 42
key = jax.random.PRNGKey(seed)

batch_size = 1000
X_ir, Y_ir, Z_ir = oeq.Irreps("1x2e"), oeq.Irreps("1x3e"), oeq.Irreps("1x2e")
problem = oeq.TPProblem(X_ir, Y_ir, Z_ir, [(0, 0, 0, "uvu", True)], shared_weights=False, internal_weights=False)


node_ct, nonzero_ct = 3, 4
edge_index = jax.numpy.array(
    [
        [0, 1, 1, 2],
        [1, 0, 2, 1],
    ],
    dtype=jax.numpy.int32, # NOTE: This int32, not int64
)

X = jax.random.uniform(key, shape=(node_ct, X_ir.dim), minval=0.0, maxval=1.0, dtype=jax.numpy.float32)
Y = jax.random.uniform(key, shape=(nonzero_ct, Y_ir.dim),
                        minval=0.0, maxval=1.0, dtype=jax.numpy.float32)
W = jax.random.uniform(key, shape=(nonzero_ct, problem.weight_numel),
                        minval=0.0, maxval=1.0, dtype=jax.numpy.float32)

tp_conv = oeq.jax.TensorProductConv(problem, deterministic=False)
Z = tp_conv.forward(
    X, Y, W, edge_index[0], edge_index[1]
)
print(jax.numpy.linalg.norm(Z))

# Test JAX JIT
jitted = jax.jit(lambda X, Y, W, e1, e2: tp_conv.forward(X, Y, W, e1, e2))
print(jax.numpy.linalg.norm(jitted(X, Y, W, edge_index[0], edge_index[1])))

Citation and Acknowledgements

If you find this code useful, please cite our paper:

@inbook{openequivariance,
author={Vivek Bharadwaj and Austin Glover and Aydin Buluc and James Demmel},
title={An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks}, 
booktitle = {SIAM Conference on Applied and Computational Discrete Algorithms (ACDA25)},
chapter = {},
url={https://arxiv.org/abs/2501.13986},
publisher={Society for Industrial and Applied Mathematics},
year={2025}
}

Our codebase includes a lightweight clone of e3nn's frontend interface (in particular, the TensorProduct and Irreps classes). We removed references to Pytorch and separated the implementation from the problem description (for future frontend support outside of torch). We also extracted the Wigner 3j tensor generating code from QuTiP. Thank you to the current developers and maintainers!

Copyright (c) 2025, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Intellectual Property Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.

Metadata

Release files for openequivariance 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openequivariance 0.8.2
File Size Uploaded Provenance Actions
openequivariance-0.8.2.tar.gz 116.8 kB With provenance Details for openequivariance-0.8.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for openequivariance 0.8.2
File Interpreter ABI Platform Actions
openequivariance-0.8.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details for openequivariance-0.8.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
openequivariance-0.8.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details for openequivariance-0.8.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Total release size: 1.7 MB

Release files / openequivariance-0.8.2.tar.gz

Download URL openequivariance-0.8.2.tar.gz
Size 116.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2cb26f52c0ea1d7c2e7cab4debdb99d173f94ad7542657fbc9e9cdb6b1e96d31
BLAKE2b-256 checksum
How to use checksums
5bd7fda901b79f9d1d03d8472e0af22c52b15c005fec2a55a49f98ea47768093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / openequivariance-0.8.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL openequivariance-0.8.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
652c6a484ef408246a7754c5171250006b5b118bcf848e2f2754ee8cc02c45e1
BLAKE2b-256 checksum
How to use checksums
50f26be9bedf6c5f74d359b8c9eb67de15162cefd8e5f90b03563785deaf6b49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / openequivariance-0.8.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL openequivariance-0.8.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 555.5 kB
Tags CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
a494621bb15d746db8c9064c879ee72a56b8e94b6a833638abff94d3078a4c4f
BLAKE2b-256 checksum
How to use checksums
3a79442eb1a2d51c436524f7463ccccd3ea3bc3a436befeab7a180e45ec2b32e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for openequivariance 0.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for openequivariance-0.8.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page