---
title: "An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep"
description: "OpenEquivariance generates GPU kernels for sparse Clebsch–Gordon tensor products, speeding up equivariant graph networks and force…"
canonical: "https://research.elamur.ai/free/en/papers/bharadwaj-2025-efficient-sparse-kernel-generator-o/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bharadwaj-2025-efficient-sparse-kernel-generator-o/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2025](https://md.research.elamur.ai/free/en/papers/2025/) / An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks

# An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks

Paper · 2025 · Vivek Bharadwaj, Austin Glover, Aydin Buluc et al.

**Authors:** Vivek Bharadwaj, Austin Glover, [Aydin Buluc](https://md.research.elamur.ai/free/en/authors/aydin-buluc/) and James Demmel · **Year:** 2025 · **Venue:** arXiv:2501.13986 · **Licence:** [CC BY 4.0 (arXiv)](http://creativecommons.org/licenses/by/4.0/)

Cited by **5** papers in our library of more than 163,000 papers whose bibliographies we read · [licence](http://creativecommons.org/licenses/by/4.0/)

- [PDF](https://arxiv.org/pdf/2501.13986)
- [arXiv 2501.13986](https://arxiv.org/abs/2501.13986)

## Summary

A system that predicts forces between atoms has to respect a simple rule. If the atoms are rotated together, the predicted forces should rotate with them. Equivariant networks build this relationship into their layers, but one of the operations that makes it possible can be expensive. The Clebsch–Gordon tensor product combines feature vectors by applying a fixed pattern of coefficients and then mixing the results with learned weights. Many of the fixed coefficients are zero, yet implementations built from dense operations can still spend time processing them. Repeating the operation across a large graph makes that cost significant.

The authors introduce OpenEquivariance, a generator that specializes GPU code for the tensor products a network actually uses. It identifies the non-zero coefficients before execution, turns them into arithmetic instructions, and schedules the computation around the amount of fast memory available to each group of GPU threads. Small operands stay in registers while the generated instructions use them. The generator also produces code for derivatives and can combine the tensor product with graph aggregation so that intermediate edge results need less space in GPU memory. The same mathematical operator is used throughout.

On representative tensor products with diagonal weight blocks, the median FP32 speedups over e3nn were 5.9x for the forward pass and 4.8x for the backward pass. The corresponding FP32 forward median against NVIDIA’s cuEquivariance was 1.6x, while backward performance was closer and varied with the configuration. The second-derivative benchmarks showed a wider split. OpenEquivariance achieved speedups of 5.5x to 35x over e3nn, but its median speedup over cuEquivariance was 0.73x in FP32 and 0.93x in FP64. For the MACE chemistry foundation network, the paper reports up to 6.2x faster FP64 inference over the original unoptimized implementation.

The end-to-end comparisons show why the choice of baseline matters. In the FP32 MACE simulation, the authors’ implementation achieved a 5.1x speedup over e3nn. Its speedup against the newer cuEquivariance release was 0.73x, even though device time spent on the tensor product was close. The remaining gap came from other layers and the layouts in which they received their data. The paper thus measures both what specialized sparse arithmetic can save and how much of that saving survives when the operator is put back into a full network.

## Deep dive: An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks

OpenEquivariance generates GPU kernels for sparse Clebsch–Gordon tensor products, speeding up equivariant graph networks and force calculations. · about 38 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What it means for a prediction to follow a rotation

Imagine expressing the same arrangement of atoms in a rotated coordinate system. The network might be asked to predict the arrangement’s energy or the forces acting on its atoms. Energy is a scalar, so both descriptions should give the same value. A force has a direction, so the second description should give the force in the rotated coordinates. The first property is invariance. The second is equivariance. By making the appropriate relationship hold inside each layer, a network designer can carry it through the complete prediction.

The paper studies transformations in O(3), which includes rotations and reflections. Hidden features can have more complicated transformation rules than those for an energy or an ordinary spatial vector. A layer may carry several kinds of features at once, with each kind occupying a known span of the feature vector. The designer chooses those kinds and specifies which of them the next layer should produce. The operation joining two feature vectors must respect the transformation rules on both inputs as well as the desired rule on the output.

This is especially relevant to graph networks for interatomic potentials. An atom can have a feature vector summarizing its current state in the network, while the relationship between that atom and a neighbor supplies an edge feature vector. A message combines the two, and the receiving atom aggregates messages from its neighborhood. The Clebsch–Gordon tensor product is one way of performing that combination with the required transformation behavior. Its cost recurs for each edge that uses it and each layer that calls for it. Force calculations also require derivatives of the operation, so the forward evaluation is only part of the workload.

The authors place this use of symmetry alongside earlier work in spatial learning. They point to protein structure prediction in [AlphaFold](https://md.research.elamur.ai/free/en/papers/jumper-2021-highly-accurate-protein-structure-prediction/) and to molecular docking in [DiffDock](https://md.research.elamur.ai/free/en/papers/corso-2022-diffdock-diffusion-steps-twists-turns/). They also discuss the use of equivariant graph networks for molecular energy prediction in Cormorant, Nequip, and Allegro. MACE and ChargE3Net illustrate how message-passing architectures can incorporate higher-order equivariant features. The generator addresses a shared computational primitive within this family of work. Its performance depends on the particular way each architecture uses that primitive.

#### Why sparsity creates a GPU programming problem

One general way to combine two vectors is to form every pairwise product of their components. This yields a vector whose length is the product of the original lengths. A change of basis organizes that vector into spans with known transformation rules. The network can keep the spans it needs and mix compatible features through learned weights. The operator that performs the change of basis has a great deal of structure, so its possible cost is much larger than the amount of arithmetic the wanted output actually requires.

There are two kinds of sparsity to account for. At the scale of the full tensor, many blocks make no contribution to a given output. Within a block that does contribute, many individual coefficients are still zero. In addition, the same small block may appear repeatedly because the feature vectors contain multiple copies of a transformation type. A dense routine can take advantage of regular data layouts, but treating each block as a dense array may ask it to perform arithmetic on explicit zeros. A generic sparse routine can skip those zeros, but it may have to read indices and use them to determine the operands of each calculation.

The operation therefore poses a problem in [GPU parallel computing](https://md.research.elamur.ai/free/en/topics/gpu-parallel-computing/). A large batch provides many independent jobs. Within a job, however, the useful arithmetic frequently consists of small contractions interspersed with movement of feature values, weights, and partial outputs. If the GPU repeatedly loads the same input to perform a modest amount of arithmetic, the time spent moving data can dominate. If a separate routine handles every small block, data used across blocks can be harder to retain close to the arithmetic. The authors ask what becomes possible when the implementation can see the full block sequence of the operator before running it.

The memory hierarchy shapes their answer. Registers are local to GPU threads and can hold the small pieces used repeatedly in a contraction. Shared memory provides a larger staging area for a group of threads, but it has limited capacity and is divided among the warps assigned to a thread block. Global memory holds the full batch. Efficient access there depends partly on arranging related loads and stores so that threads access contiguous locations. The CG tensor product has enough repetition to benefit from all three levels, provided the work is grouped at the right scale.

#### How earlier approaches handle the cost

The paper describes e3nn as a general package for building equivariant operations, including CG tensor products, Wigner matrices, and spherical harmonic features. Its tensor products are a natural baseline because they express the same mathematical operation. The authors point to implementations that fill contributing coefficient blocks with explicit zeros and pass them to dense routines. They also describe GELib and e3nn.c as precedents for more fine-grained treatment of individual blocks. Their generator extends specialization across the whole sequence of blocks, including the loads and stores that join them.

NVIDIA’s cuEquivariance was released while the project was in development. It is the strongest competing implementation in the paper’s experiments and changed appreciably between the releases that the authors tested. Its closed kernel backend limits what the authors can establish about its treatment of within-block sparsity. Other packages discussed in the paper, including Sphericart and Equitriton, accelerate spherical harmonic evaluation. That operation can appear in the same network, but it occupies a different place in the calculation.

The related work also includes approaches that change the computation required by the architecture. Allegro reduces the number of tensor products and lowers communication between GPUs by changing the message-passing design. The Cartesian approach discussed by the authors avoids CG products. Another approach aligns node embeddings with spherical harmonic edge features before the interaction, making the interaction tensor sparser for the SO(3) convolution it addresses. The Gaunt tensor product uses a connection to products of spherical harmonics and the fast Fourier transform. The paper also records a qualification from Xie and colleagues about the comparability and expressive capacity of that alternative.

OpenEquivariance takes the network’s chosen CG product as its starting point. The way features transform, the output types selected by the designer, and the pattern of trainable weights are already specified. The design problem is to execute that operator and the surrounding graph reduction efficiently. This scope makes it possible to compare implementations on the same features and weights, with floating-point agreement checked separately from execution time.

### The method, step by step

#### From geometric symmetry to a fixed coefficient tensor

To define equivariance precisely, the paper represents each geometric transformation by matrices describing its effect on the input and output features. Applying two transformations in sequence must have the same effect as multiplying their representation matrices in the corresponding order.

```
Dᵢₙ(g₁ · g₂) = Dᵢₙ(g₁) · Dᵢₙ(g₂)
```

Here `Dᵢₙ` is the input representation. The symbols `g₁` and `g₂` denote transformations in the group `G`, which is O(3) in the paper. The dot on the left composes transformations, and the dot on the right multiplies matrices. The output representation `Dₒᵤₜ` has the same composition property.

```
f(Dᵢₙ(g) · v) = Dₒᵤₜ(g) · f(v)
```

Here `f` maps an input vector `v` to an output vector, and `g` is any transformation in the group. On the left, the input is transformed before calling `f`. On the right, the original output is transformed under `Dₒᵤₜ`. The defining requirement is that these two routes agree. When `Dₒᵤₜ(g)` is the identity matrix for every `g`, the expression gives invariance. In a stack of equivariant layers, the output representation of one layer becomes the input representation of the next. The equality then applies successively through the stack.

The representations used in the network are organized as blocks. Each block contains a copy of an elementary representation, described using a Wigner D-matrix and identified by an order. In the general expression, a similarity transformation brings the representation into that block form.

```
D(g) = S⁻¹ · diag(D⁽ⁱ¹⁾(g), …, D⁽ⁱᴰ⁾(g)) · S
```

Here `D` to the left of the parentheses is the full representation, and `S` is the change-of-basis matrix, with inverse `S⁻¹`. Inside `diag`, the superscripts stand for the orders `i₁` through `iᴰ` of the blocks along the diagonal. The superscript labels a representation type, rather than a matrix power. The individual blocks are Wigner D-matrices. A block of order `ℓ` has `2ℓ+1` rows and columns. In the specifications the authors target, the blocks are already in canonical form, so the change of basis in this expression is the identity.

The notation `3x1e + 1x2o` describes a feature layout. Its first term gives multiplicity `3` for order `1`, and its second gives multiplicity `1` for order `2`. Multiplicity counts copies of the same kind of transforming feature. The suffix `e` denotes even parity and `o` denotes odd parity, which supply the reflection behavior. The order and multiplicity serve different purposes in the kernel. Order controls the length of one elementary feature vector and the shape of the coefficient block. Multiplicity controls how many such vectors share a block pattern or take part in the weight multiplication.

The tensor product starts from two features, called `x` and `y`. In a graph they can belong to a node and an edge, respectively. Their Kronecker product lists every pairwise product and transforms under the Kronecker product of their representations. The network can apply a basis transform that breaks this combined representation into elementary parts. Once the components are grouped in this way, the designer may omit whole parts without disrupting the transformation law of the retained ones. The subsequent learned weight operation combines compatible components into the features specified for the output.

```
z = TP(𝒫, x, y, W) = W · P · (x ⊗ y)
```

Here `TP` is the full Clebsch–Gordon tensor product as the paper uses the term, including the multiplication by learned weights. The two inputs are `x` and `y`, `⊗` forms their Kronecker product, and `z` is the output. The matrix `P` applies the fixed CG basis transform, keeping the rows selected by the specification. The tensor `𝒫` stores the same retained coefficients with separate indices for components of `x`, components of `y`, and the intermediate output. The structured matrix `W` maps the intermediate result into the final output representation.

```
z[k′] = ∑ᵢⱼₖ W[k′, k] · 𝒫[i, j, k] · x[i] · y[j]
```

Here `i` and `j` index the two input vectors, `k` indexes the vector produced by the fixed contraction, and `k′` indexes the final output. The brackets select an element, and `∑ᵢⱼₖ` is a sum over the three indicated indices. The entry `W[k′, k]` maps intermediate component `k` to final component `k′`. This expression uses a column-vector convention for `W`. The sparsity exploited by the generator is in the fixed values of `𝒫` and the known structure of `W`. The feature values and the stored weight values still arrive at execution time.

Writing the contraction as an indexed sum explains where the generated arithmetic comes from. For each non-zero coefficient at position `i, j, k`, the code multiplies the indicated input components and the coefficient, then adds the contribution at `k`. Both the coefficient and the locations it addresses are already known. The generator can encode those locations in the operations themselves. It also knows which blocks have the same pattern and which parts of the inputs are needed again.

#### How a full product is divided into small contractions

A single coefficient block connects one order from each input to one output order. The three dimensions of the block are set by the numbers of components at those orders. The paper uses a small contraction followed by a weight tile to illustrate this basic unit. It calls that isolated pattern kernel A. Real specifications can repeat an identical block many times because they combine several copies of one input type with the same edge feature. The generator targets two ways of organizing that repetition.

In kernel B, several rows of `x` share one vector `y`. The rows of `x` are collected into a matrix, and each row undergoes the same type of contraction with `y`. The weight tile is diagonal. Each row of the intermediate result can therefore be scaled independently and added to the appropriate output row. The authors identify this pattern in Nequip and MACE. A warp can give separate row calculations to its threads and share the logic of the coefficient contraction across them.

Kernel C starts with the same row-wise contraction. Its weight tile is dense, so an output row can draw from multiple intermediate rows. The number of input rows may also differ from the number of output rows. Once the thread-local contractions are complete, the warp carries out a small matrix multiplication to mix their results. The authors identify this pattern in DiffDock and in an earlier spatial shape classification application. The dense stage matters to the performance comparison because it consumes a different share of the work from the sparse stage.

The paper gives a concrete tensor-product specification with `32x2e + 32x1e` for the first input, `1x3e + 1x1e` for the second input, and `32x5e + 16x2e + 32x3e` for the output. Each term corresponds to a segment. A subkernel instruction identifies the two input segments, the output segment, and the weight pattern. The first instruction uses kernel B with the first segment of each input and the first output segment, with multiplicity `32`. The next instruction pairs the first segment of `x` with the second segment of `y` using kernel C. It maps from `32` input rows to `16` output rows in the second output segment. A further kernel C instruction reuses those same input segments for the third output segment.

Several consequences follow directly from the specification. The generator can identify that an input segment will be used in consecutive instructions. It can determine the size of each weight tile and where the result will go. It also knows when multiple subkernels contribute to the same output segment. These properties govern the execution schedule. They come from the architecture’s feature and instruction lists and are available before a graph or batch of features is passed to the kernel.

From a tensor-product specification to GPU execution The steps in order.

#### Scheduling the work around fast memory

For a standalone product, a warp handles one input triple consisting of `x`, `y`, and `W`. A warp is a group of threads that can execute the same instruction together. Each warp has its own slice of the thread block’s shared memory, and the input triples are independent. This allows different warps in a block to progress without requiring a barrier across the block. The threads can cooperate on contiguous global-memory reads and writes when staging operands or sending the results back.

Large batches make this division of labor useful. The paper notes that the batch can reach millions of products and that some common configurations can exceed 100K FLOPs per item. The implementation uses 4-8 warps per thread block and launches a number of blocks chosen as a multiple of the GPU’s streaming multiprocessor count. Work within each block still needs to fit the shared memory actually allocated. For large Nequip and MACE configurations, the combined lengths of the feature vectors can exceed 10,000 data words, before the weights are accounted for. Giving every warp room for all of its operands at once would exceed the available scratch space.

The generator deals with this by dividing the instruction sequence into phases. A phase contains enough subkernel work to make productive use of its staged data, while the required input, weight, and output slices fit within the warp’s share of memory. Phase boundaries are chosen before execution. The corresponding loads, initialization, and output stores are written into the generated code. Wherever a phase produces only part of an output segment, its contribution is added to the results from other phases.

The paper describes two scheduling cases. If the full input vectors can remain in shared memory, the schedule keeps them there and streams weight and output slices. Instructions contributing to a given output slice can then run while that slice is resident. This is useful when the output or weight arrays cause the total size to exceed the budget but both input vectors fit. The same input segment may take part in many instructions without requiring another global-memory trip each time.

If the inputs also exceed the budget, the schedule is greedy. It packs a phase with the segments needed by as many instructions as it can accommodate. When a later phase needs values that have been displaced, they are loaded again. The paper presents this as a practical heuristic for generating a legal schedule with limited traffic. It uses the known access pattern to decide what to stage and when, while leaving room for further tuning of memory allocations and launch settings.

#### Turning coefficient positions into instructions

Within a phase, a thread can load a row of the staged input matrix along with the common short `y` vector into registers. It also initializes a small register vector to collect the unweighted result. In configurations of interest to the authors, notably Nequip and MACE, the elementary orders satisfy `ℓₓ, ℓᵧ, ℓ𝓏 ≤ 4`. At these orders, a single contraction uses short feature vectors even when the full feature arrays are long. Larger multiplicities are handled by splitting the row work, so that the generated subkernels use tiles with row dimensions no greater than `32` where required.

```
zᵣₑg[k] ← zᵣₑg[k] + v · xᵣₑg[i] · yᵣₑg[j]
```

Here `xᵣₑg` and `yᵣₑg` are the register-resident input pieces, and `zᵣₑg` is the thread’s intermediate result. The indices `i`, `j`, and `k` identify the input components and destination component of one non-zero entry. In this expression `v` is that entry’s coefficient. The arrow denotes updating the accumulator. The generator emits the arithmetic for each known entry, so the indexed update describes the generated work without requiring a runtime loop that reads a sparse index array.

A sequence of these operations gives the GPU independent arithmetic to issue wherever the operands and destinations permit. Some instructions naturally depend on an earlier update to the same accumulator. Others operate on different components or reuse a value that is already available in a register. The paper calls the ability to issue independent instructions within a thread instruction-level parallelism. Specializing across adjacent subkernels also lets the code keep values in registers when a following contraction will need them.

After the contraction, a diagonal weight tile lets each thread scale its own result and accumulate it into the output staged in shared memory. A dense weight tile requires a collective step. The intermediate rows are placed in shared memory, and the warp computes the weight multiplication cooperatively. Both cases use the same fixed coefficient pattern for the contraction. The difference is when threads need one another’s results and how much of the overall time the weight operation consumes.

The software uses the e3nn interface for tensor-product specifications and QuTiP to obtain CG coefficients. The generated kernels are compiled through a C++ extension using NVIDIA and AMD HIP runtime compilers. This is just-in-time compilation in the sense relevant to the operator. Its layout and coefficient pattern are resolved when the network configuration is available, before the compiled kernel is used for actual inputs. The authors checked the results against e3nn within floating-point roundoff, accounting for a known permutation of weight entries in configurations that require it. The package includes a function to perform that reordering.

#### Computing forces and the first backward pass

An interatomic potential predicts an energy for a configuration. Forces are obtained by differentiating that energy with respect to the atomic positions. Thus a force evaluation can require the backward pass of the tensor product even during inference. The differentiated value comes from a scalar energy, but the upstream gradient arriving at a particular tensor product is a vector shaped like its output.

```
Fₚᵣ(R, W) = −∂E(R, W)/∂R
```

Here `R` is the coordinate array for `s` atoms and has shape `s×3`. The row for each atom holds its spatial coordinates. The scalar function `E` is the predicted energy, `W` here denotes the trainable parameters of the network, and `Fₚᵣ` is the predicted force array with the same shape as `R`. The partial derivative acts on the coordinate array, and the minus sign supplies the force convention.

Locally, the backward pass starts with `g𝓏`, the derivative of the scalar quantity with respect to `z`. The same coefficient entries visited in the forward pass determine where each gradient contribution goes. It is useful to first carry the output gradient back through the weight operation.

```
h = Wᵀ · g𝓏
```

Here `g𝓏` is the gradient at the weighted output, `W` is again the tensor product’s structured weight matrix, `Wᵀ` is its transpose, and `h` is the gradient at the intermediate output of the fixed contraction. For a dense weight tile, this calculation requires a warp-level matrix multiplication. For a diagonal tile, it reduces to independent scaling.

```
∂E/∂x[i] = ∑ⱼₖ 𝒫[i, j, k] · y[j] · h[k]
```

Here the partial derivative gives the gradient with respect to component `i` of `x`. The sum ranges over the components `j` of `y` and intermediate positions `k`, using the corresponding coefficient from `𝒫` and the intermediate gradient `h[k]`. The implementation visits the non-zero coefficient entries contributing to this sum.

```
∂E/∂y[j] = ∑ᵢₖ 𝒫[i, j, k] · x[i] · h[k]
```

Here the partial derivative is for component `j` of `y`. The sum now ranges over components `i` of `x` and intermediate positions `k`. The same coefficient tensor `𝒫` and intermediate gradient `h` appear, while the retained forward operand is `x`. Since several threads process different rows against the same `y`, their contributions to its gradient must be summed across the warp.

```
∂E/∂W[k′, k] = g𝓏[k′] · ∑ᵢⱼ 𝒫[i, j, k] · x[i] · y[j]
```

Here the partial derivative is with respect to a stored weight mapping intermediate component `k` to output component `k′`. The sum over `i` and `j` reconstructs the forward contraction at `k`, and `g𝓏[k′]` weights its contribution to the gradient. In the dense row-mixing case, the backward subkernel collects the unweighted results for the rows and uses a second warp-level matrix multiplication to form the weight gradients.

These formulas share the same sparse traversal. At a given coefficient, gradient accumulation for `x` takes the value of `y` and the intermediate gradient. Accumulation for `y` takes the value of `x` and the intermediate gradient. Reconstructing the unweighted forward contraction uses `x` and `y`. The generated backward kernel can perform this work together while these operands are available. Its main additions to the forward structure are the transpose weight multiplication, the reduction for the shared `y` gradient, and the accumulation of weight gradients.

#### Differentiating a force objective

Training an interatomic potential against reference forces adds a derivative through the force calculation. The paper describes a force loss based on the squared Frobenius norm. This is the sum of squared discrepancies over the entries of the force arrays. The reference forces come from a more expensive simulation. The objective explains why the generator supplies a double-backward operation. The performance experiments use existing networks and selected workloads, so this mathematical description serves to specify the derivatives instead of a new training protocol.

```
minᵂ L(R, W) = minᵂ ‖Fₚᵣ(R, W) − F𝓰ₜ(R)‖²ꜰ
```

Here `L` is the force discrepancy objective and `minᵂ` denotes minimization over the network weights `W`. The predicted force array `Fₚᵣ` depends on the coordinates `R` and the weights. The reference force array `F𝓰ₜ` is associated with `R`. The squared norm `‖ · ‖²ꜰ` combines the errors across atoms and spatial components. The paper allows for other loss terms and isolates the force term because it requires the higher derivative.

```
∂L/∂W = −2 · vec(Fₚᵣ(R, W) − F𝓰ₜ(R))ᵀ · ∂²E/(∂R∂W)
```

Here `vec` flattens the force difference into a vector and `ᵀ` makes it a row vector for the displayed multiplication. The mixed derivative `∂²E/(∂R∂W)` describes how the coordinate derivative of the energy changes with the weights. Its rows index the `3s` coordinate entries and its columns index the weights. The factor `2` comes from the squared loss and the minus sign from the force definition. Automatic differentiation can organize the calculation once the custom tensor-product backward kernel supplies its own derivative.

The double-backward method reuses existing forward and backward kernels. Let `backward(x, y, W, g𝓏)` return the first gradients `a`, `b`, and `C` for `x`, `y`, and `W`, in that order. The second call to differentiation supplies gradients of `L` with respect to these results. Denote the incoming gradients of `a`, `b`, and `C` by `u`, `v`, and `H`, respectively. The letter `v` now names a vector of derivatives, separate from the coefficient value in the register update. The double-backward pass returns contributions for the original arguments `x`, `y`, and `W`, as well as for the original upstream gradient `g𝓏`.

```
∂L/∂g𝓏 = TP(𝒫, u, y, W) + TP(𝒫, x, v, W) + TP(𝒫, x, y, H)
```

Here `g𝓏` is the upstream gradient entering the first backward operation. The fixed coefficient tensor is `𝒫`, and `TP` has the same operand order as the forward operation. The terms replace the first input with `u`, the second input with `v`, and the weights with `H`, respectively. Each forward call gives the contribution of one incoming derivative because the original operator is linear separately in each of those operands.

For the other outputs, each first derivative depends on the operands that survive differentiating the forward contraction. The first gradient `a` contains `y` and `W`, so its incoming gradient `u` contributes to the second derivatives with respect to those arguments. In the same way, the first gradient `b` contains `x` and `W`, and the first weight gradient `C` contains `x` and `y`. This gives the routing for backward calls with a single substituted argument.

```
∂L/∂x = backward(x, v, W, g𝓏)[1] + backward(x, y, H, g𝓏)[1]
```

Here `[1]` selects the `x` gradient from the backward call. The term from `v` comes through `b`, and the term from `H` comes through `C`. The other arguments `x`, `y`, `W`, and `g𝓏` are as in the original call unless replaced in the expression.

```
∂L/∂y = backward(u, y, W, g𝓏)[2] + backward(x, y, H, g𝓏)[2]
```

Here `[2]` selects the `y` gradient. The first call uses `u` to propagate through `a`. The second uses `H` to propagate through `C`.

```
∂L/∂W = backward(u, y, W, g𝓏)[3] + backward(x, v, W, g𝓏)[3]
```

Here `[3]` selects the weight gradient. The incoming derivatives `u` and `v` enter through `a` and `b`, the first derivatives that depend on the weights.

The paper lists seven dispatches in its description. Its printed combination for `∂L/∂x` and `∂L/∂y` selects from a call that substitutes both input gradients at once. Under the paper’s own first-gradient definitions, that call pairs the first returned gradient with `v` and the second with `u`, as the single-substitution expressions show. In fact, the two selected components agree with those expressions because each first gradient is independent of the corresponding primal input. The first component depends on the call’s second input and the second component depends on its first input. This is how one call can supply both contributions. In the implementation, the authors also group the forward evaluations into a fused kernel and group backward evaluations in a similar way, reducing repeated launches and operand traffic.

#### Aggregating graph messages without materializing the edge batch

In the graph application, the product computes a message from a source node’s features and the features and weights of its edge. The receiving node sums the messages over its neighborhood. The same source feature vector can be used by several edges. A standalone product interface can accommodate this by building a batch with a copy of the source vector for each edge, producing an edge-indexed output batch, and then performing a scatter-sum into the receiving nodes. The resulting copies and intermediate outputs can occupy substantial global memory.

```
zⱼ = ∑₍ⱼ,ₖ,ₑ₎ ∈ N(j) TP(𝒫, xₖ, yₑ, Wₑ)
```

Here `j` is the receiving node, `k` is a source node, and `e` identifies their edge. The neighbor set `N(j)` contains the triples used for receiver `j`. The vectors `xₖ` and `yₑ` hold node and edge features, `Wₑ` holds the edge weights, and `zⱼ` is the aggregated output for that node. The fixed coefficient tensor `𝒫` is shared according to the product specification. The sum defines the same graph operation whether the individual messages are stored or consumed immediately.

The authors borrow the access pattern of sparse-dense matrix multiplication. Think of a row of the graph’s adjacency matrix as a receiver and its non-zero positions as the participating edges. The deterministic kernel expects an edge list sorted by receiver. It places the tensor product’s scheduling phases outside the edge traversal. Within a phase, the warp takes each successive edge, reads the indicated node features and edge-specific data, and updates a running output buffer for the receiver. It can keep contributing to that buffer until it moves to the next receiver.

The boundary between warps requires special handling because a receiver’s edges can span two or more assignments. The first row handled by each warp is written to a separate fixup buffer. The fixup procedure combines partial contributions where the assignments meet. The paper describes the main aggregation’s global output writes as changing from order `|E|` to order `|V|`, where `|E|` counts edges and `|V|` counts vertices. This is a statement about writing partial outputs during aggregation. Edges still have to be visited, and the phase count and boundary corrections still affect the total traffic. The analogous deterministic backward procedure needs an input permutation corresponding to the transposed adjacency.

An alternative fused kernel accumulates with atomic operations. An atomic update lets a warp add its contribution to a destination even if another warp is updating that destination concurrently. It can work with unsorted graphs and without the adjacency transpose permutation, at the cost of a global atomic update for each processed edge contribution. The order of additions may vary, yielding nondeterministic floating-point sums. Both forms of fusion remove the need to hold a full, separately produced array of edge outputs between the tensor product and the reduction. They offer different ways to arrange the output updates and different input requirements.

### Experiments and results

#### What was timed

The experiments move from isolated tensor products to graph convolution and then to full force evaluation or simulation. At the smallest scale, the authors select costly representative products from existing network configurations and build large batches. These runs measure how many tensor products can be processed per unit of time, including separate forward, backward, and second-derivative tests. The graph experiments keep a selected product and change the way messages are gathered and summed on specific graphs. The integration experiments time broader workloads where other layers, layouts, and software paths also influence the result.

Most measurements were made on A100 GPU nodes at NERSC Perlmutter with AMD EPYC 7763 CPUs. The paper compares the GPU’s observed behavior with the advertised bandwidth and throughput ceilings in the [NVIDIA A100 architecture report](https://md.research.elamur.ai/free/en/papers/nvidia-2020-nvidia-a100-tensor-core-gpu/). It also includes measurements on the NVIDIA A5000 and on a single GPU die of an AMD MI250x. These hardware comparisons matter because the same product can draw differently on memory bandwidth, arithmetic resources, and the runtime that compiles the kernel.

The main baselines are e3nn v0.5.6 and cuEquivariance v0.4.0, called cuE in the paper’s figures. The authors use `torch.compile` for e3nn where memory permits. Most of the isolated throughput comparisons and the graph fusion comparison use the same PyTorch interface and include the overhead of that interface. The roofline and the MACE device-time breakdown use kernel measurements with the PyTorch overhead excluded. This distinction matters when comparing a device timeline with an application-level speedup.

The experiments also include cuEquivariance v0.2.0 to show how a previous release performed. The newer release improves throughput and introduces features that affect the comparisons, including a fused convolution. Results against both releases are informative about the history of the competing implementation. The release named next to a speedup identifies the baseline for that particular result.

#### Isolated forward and backward products

The kernel B configurations come from Nequip and MACE. They use diagonal weight blocks, leaving the sparse CG contraction and data movement as substantial parts of the work. On batches of 50K, the authors report a median FP32 forward speedup of 5.9x and a median FP32 backward speedup of 4.8x over e3nn. They report a maximum of 9.2x for the forward pass in that FP32 comparison. The caption separately highlights more than 10x improvement over e3nn on a difficult configuration, Nequip-benzene, whose output vectors are particularly large.

Against cuEquivariance, the median forward speedup on the kernel B group is 1.6x in FP32 and 1.3x in FP64. The backward pass is more closely contested. Its FP64 speedups range from 0.72x to 1.32x. A speedup below parity means the tested OpenEquivariance path takes longer than the corresponding cuEquivariance path. The range is important because the additional data flow in the backward pass can make two products with the same broad weight pattern behave differently.

The chart below shows one isolated MACE-large measurement in absolute time. A batch runtime puts the result in units that can be compared directly across the implementations in the same experiment. The comparison uses the unfused product in FP32, so it leaves out graph aggregation and the rest of the network.

A100 forward runtime for the unfused MACE-large tensor product, FP32 batch of 50K OpenEquivariance completes the forward batch fastest among the tested implementations.

**The numbers**

| System or setting | ms |
| --- | --- |
| e3nn | 13 |
| cuEquivariance | 2.8 |
| OpenEquivariance (this paper) | 2.0 |

A100 backward runtime for the unfused MACE-large tensor product, FP32 batch of 50K cuEquivariance leads on this backward batch, with OpenEquivariance close behind.

**The numbers**

| System or setting | ms |
| --- | --- |
| e3nn | 21 |
| cuEquivariance | 3.5 |
| OpenEquivariance (this paper) | 3.7 |

The kernel C benchmarks use the Tetris polynomial from e3nn’s documentation and two configurations based on DiffDock. They use batches of 50K. On the DiffDock products, the speedups over cuEquivariance range from 1.4x to 2.0x across the forward and backward passes. The improvements over e3nn are less pronounced in kernel C than in kernel B. The authors attribute this to the share of the kernel C workload spent on the small dense weight multiplications, which the sparse coefficient specialization leaves in place.

The additional hardware measurements use the MACE-large product in Table 2. On the A5000, OpenEquivariance takes 3.8 ms for the forward batch and 11 ms for the backward batch, both FP32 and unfused at batch size 50K. On the AMD MI250x die, it takes 3.0 ms and 15 ms for those two batches, respectively. The authors relate the A5000’s performance to its lower memory bandwidth compared with the A100. On the MI250x, they observe lower bandwidth utilization than they anticipated. The table includes e3nn on that GPU, while it has no cuEquivariance entries there.

#### Higher derivatives and arithmetic intensity

The second-derivative evaluation revisits the chemistry and docking product configurations at batch size 20K. It leaves out the Tetris polynomial because that benchmark has no need for the double-backward pass. Across the tested products and precisions, OpenEquivariance’s speedups range from 5.5x to 35x against e3nn and from 0.69x to 1.69x against cuEquivariance. Against cuEquivariance, the median is 0.73x in FP32 and 0.93x in FP64. OpenEquivariance still has lower runtimes on both DiffDock configurations and on several Nequip configurations. The derivative identity supplies a way to reuse kernels, while the speed measurements establish how well that reuse performs for the individual products.

The roofline experiment looks at how the time spent moving data and the time spent on arithmetic constrain performance. Arithmetic intensity measures the amount of arithmetic performed for a given quantity of data transferred. A low-intensity product can run into a memory bandwidth ceiling. Increasing the work per byte can move the workload towards a ceiling set by arithmetic throughput. The roofline provides these resource limits as context for the achieved throughput.

The authors profile single-subkernel B configurations in FP32, varying their arithmetic intensity and using batches of 200K. OpenEquivariance and the newer cuEquivariance track the slope associated with global-memory bandwidth. The older cuEquivariance release shows lower utilization. At the compute end of the experiment, the kernels level off at 58% of the FP32 peak. The authors suggest that the instruction mix helps explain this result. A workload with a significant share of instructions other than fused multiply-adds has less opportunity to reach the throughput represented by the advertised peak.

#### Fused graph convolution on molecular structures

The fusion comparison uses three graphs. The authors obtain atomic coordinates for DHFR and the SARS-CoV-2 spike from the Protein Data Bank and use Scikit-Learn to form radius-neighbor graphs. In such a graph, distance determines which atom pairs are joined. They also use a carbon lattice supplied as a representative MACE workload. The DHFR structure, identified as `1DRF`, has 1.8K nodes and 56K non-zero adjacency entries. The spike structure, `6VXX`, has 23K nodes and 136K entries. The carbon lattice has 1K nodes and 158K entries. These are counts of the graph work presented to the convolution. The structures serve as performance inputs.

The test uses the most expensive tensor product selected from MACE-large. The baseline called cuE-scattersum expands the node features into an edge batch, computes the tensor products with cuEquivariance, and then reduces the outputs by receiver. The comparison also includes the fused convolution available in cuEquivariance v0.4.0. This gives two baselines with different aggregation paths and makes clear which gains are available against an already fused implementation.

Against cuEquivariance’s fused convolution, the clearest forward advantage reported for the deterministic OpenEquivariance kernel is on the carbon lattice in FP64, at roughly 1.3x. The backward comparison favors cuEquivariance’s fused path, which delivers a 1.3-1.4x speedup. Graph fusion therefore changes the balance of work in both directions. The forward pass particularly benefits when a receiver’s many contributions can be accumulated in a running buffer. The backward pass also has to propagate gradients to the features and weights, and its competitive result differs.

#### Force evaluation and simulation in full networks

The Nequip experiment times force evaluation through the Nequip-ASE calculator on a 5184-atom box of water. The network is a 4-layer FP32 configuration. The authors use the nondeterministic fused convolution for the integrated test and compare with unmodified Nequip through its Python interface, without JITScript or `torch.compile`. The results also include an integration using the authors’ unfused product. They therefore show what is gained by replacing the tensor product alone as well as what is gained when switching to the fused graph path.

A100 force-evaluation speedup over unmodified Nequip on the 5184-atom water box The fused OpenEquivariance integration gives the larger speedup on the tested water workload.

**The numbers**

| System or setting | speedup factor |
| --- | --- |
| OpenEquivariance unfused | 6.3 |
| OpenEquivariance fused (this paper) | 7.8 |

On the MI250x die, the same FP32 water-box comparison reports 4.4x speedup for the fused integration and 3.9x for the unfused integration. These figures are relative to unmodified Nequip on that hardware. The comparison is useful because both OpenEquivariance variants already contain the specialized tensor product. The additional improvement with fusion comes from changing the integrated path that prepares and aggregates graph messages.

The MACE experiment measures molecular dynamics simulation on the carbon lattice. The authors patch MACE to sort its adjacency entries in compressed sparse row order, which provides the grouping required by their deterministic convolution. They also configure a species dictionary with eight elements, although the lattice uses one. They do so to exercise an inefficiency in the baseline related to how the code handles species-specific weight matrices. The authors’ package includes an optimization for that inefficiency, so the simulation result reflects more than a substitution of the isolated tensor-product kernel.

In FP32, the OpenEquivariance integration achieves 5.1x the simulation rate of the e3nn integration and 1.5x that of the older cuEquivariance v0.2.0 integration. The older release lacks the fused convolution used in the newer comparison. The abstract reports up to 6.2x FP64 inference speedup over the original unoptimized MACE implementation. Against the newer cuEquivariance release, the main MACE comparison reports a speedup of 0.73x. The authors adopt cuEquivariance’s preferred feature layout and apply its optimizations to graph convolution, symmetric tensor contraction, and linear combination layers.

The device breakdown helps locate the remaining time. The tensor-product times are within 2-3 milliseconds of cuEquivariance. Once the costly product runs faster, the remaining network components become more significant, even though they account for under 15% of the model’s runtime before optimization. A hybrid implementation pairs the authors’ fused graph convolution with cuEquivariance’s linear and symmetric contraction layers. This closes part of the gap. The newer full cuEquivariance integration still makes better use of those layers because it transposes key weight matrices, whereas the hybrid keeps the original MACE layout. That difference affects inference speed and also changes how weights trained without cuEquivariance are prepared for use with it.

### What the ablations show

The paper contains no conventional ablation that disables each optimization in isolation, but it supplies controlled product benchmarks, fusion comparisons, a roofline analysis, and a hybrid network with a device-time breakdown.

#### Sparse contraction and dense weight mixing

The B and C comparisons help identify which part of the calculation offers room for this generator to improve runtime. In B, rows can be weighted independently, so eliminating zero-coefficient arithmetic and reusing data can affect a large share of the operation. In C, substantial time may remain in the dense multiplication that mixes intermediate rows. This explains why the authors view the smaller e3nn gains in C as consistent with the kernel design. The improvement in the sparse contraction can account for only its share of total time.

These benchmark families differ in more than the weight layout. They come from different applications and use distinct feature configurations, so their results cannot isolate the effect of replacing a diagonal tile with a dense one in an otherwise identical test. They do, however, show two places where a bottleneck can occur. The backward measurements make the distinction especially useful. The backward calculation inherits the sparse traversal and adds work to propagate and reduce gradients. A design that performs particularly well on a forward contraction can be more closely matched once that additional work dominates.

The roofline analysis provides a more controlled view of the hardware behavior because it varies arithmetic intensity within a single-subkernel family. At low intensity, the newer competing kernel and OpenEquivariance follow the rising bandwidth slope. This supports the claim that the generated code uses global memory efficiently across these products. At higher intensity both reach a compute plateau. The paper attributes that plateau provisionally to the instruction mix. The measurements do not separate the individual benefits of register reuse, instruction unrolling, and warp scheduling, because the generated kernels use these mechanisms together.

The older and newer cuEquivariance measurements help establish that a comparison can move substantially even when the mathematical product stays fixed. The later release runs closer to the same roofline and also adds fusion. Because the implementation details of its backend are opaque, the paper can show that its observed behavior improved and document the features available in the release. It cannot attribute the performance change to a particular change in its sparse arithmetic.

#### What changes when aggregation is fused

The graph comparison moves the boundary of the kernel while keeping the message-passing equation fixed. In the separate path, performance includes building edge-indexed inputs and placing tensor-product outputs in memory before reducing them. In the fused path, the consumer of a message is present when the message is produced. The deterministic implementation additionally accumulates work for the current receiver and writes it when leaving that row. This establishes a mechanism for reducing intermediate storage and output traffic that goes beyond eliminating a launch.

The graph structures make that mechanism observable under different patterns of reuse. The carbon lattice combines a small node count with a large number of adjacency entries. It offers many opportunities to reuse node features and defer a write while adding contributions to a receiver. It is also where the authors report their strongest deterministic forward comparison against the fused cuEquivariance path. The experiment does not vary graph density alone, so the result describes the tested lattice and product combination. The other graphs vary in both size and adjacency structure.

The Nequip experiment provides a complementary comparison within one application workload. Both the fused and unfused integrations use the authors’ kernels, and the fused integration improves on the unfused one on both tested GPU architectures. Since the operator is already specialized in both cases, the comparison shows a benefit from the graph execution path in addition to the benefit from the isolated kernel. It also places the forward and backward work in the context in which it is actually called to evaluate forces.

The authors implement both sorted deterministic and atomic versions, but the integration tests use them in different networks and workloads. The Nequip water-box timings use the atomic path, while the MACE carbon-lattice integration uses the deterministic path. Comparing those full-system figures cannot establish the isolated cost of atomic updates or sorting. The more direct graph fusion measurements show that a forward win can coexist with a backward deficit against another fused kernel.

#### What the hybrid reveals about the end-to-end gap

The MACE hybrid asks what happens when the authors keep their tensor product and graph fusion but adopt another provider’s implementations of some of the remaining layers. The device breakdown has already put the tensor product close to its competitor. The hybrid result then shows that the performance gap can be narrowed by changing other layers while retaining the authors’ convolution. This helps locate where additional runtime remains in the full simulation.

The hybrid also highlights the effect of data layout. It uses optimized primitives while preserving the original MACE layout. The full cuEquivariance implementation can reorder key weight matrices and use its preferred layout across the relevant layers. The remaining gap is therefore consistent with the authors’ explanation that primitive choice and operand layout both matter. The experiment is a comparison among available integration paths. The paper does not independently switch every matrix layout and layer implementation while holding all the others fixed.

A baseline component with a small share of runtime can become important after a larger one is accelerated. The MACE breakdown shows this concretely. The isolated product timing establishes that OpenEquivariance handles the targeted bottleneck competitively. The full simulation measures the performance after that bottleneck has shifted. The two experiments answer different questions about the same integration and account for why their lead or deficit need not match.

### Limitations

#### Limits identified by the authors

The implementation emphasizes patterns the authors found frequently. Kernel B and kernel C cover diagonal and dense mixing after one edge feature is contracted with multiple rows of the other input. The paper describes additional patterns, including grouping several segments of the second input, but reports finding little reason to target them in existing architectures. The register strategy is also motivated by the short elementary vectors of configurations such as Nequip and MACE. The paper leaves performance for larger orders and uncommon interaction patterns open.

Tuning remains incomplete. The authors point to choices such as warps per block, total block count, and shared memory per block as possible ways to narrow cuEquivariance’s lead on some Nequip and MACE double-backward products. The reported medians and ranges reflect the generator’s existing heuristics. The proposed tuning is a direction for improving those results. The lower-than-expected bandwidth utilization on the MI250x similarly leaves room to investigate how the schedule and memory behavior translate across devices.

The arithmetic implementation uses the GPUs’ SIMT cores for FP32 and FP64. The authors identify lower-precision execution and access to specialized matrix-multiply-accumulate hardware as future work. They also discuss extending the fused convolution to use Kahan summation. The contemplated change would reduce roundoff when adding many neighbor contributions, with energy conservation in simulation as the motivation. The paper does not present measurements of energy conservation for that modification.

The deterministic graph kernel imposes layout requirements on its inputs. Receiver-sorted edges enable a warp to keep a running sum for the current row, and the analogous backward path needs a transpose permutation. The atomic alternative allows unsorted edges and has an order-dependent floating-point sum. A network’s graph preparation and reproducibility needs therefore affect which implementation can be used. The Nequip measurement was also limited by recent software changes and the time available for integration, so the paper reports only the nondeterministic fused option for that network.

#### Limits visible in the experimental setup

Most isolated products were chosen as expensive representatives, and the batches in the throughput tests are large. These settings are relevant when a molecular graph supplies many edge operations, but they leave smaller batches and workloads with different reuse patterns underexplored. The primary evidence comes from one GPU platform, supplemented by selected measurements on two other architectures. The portability tests establish that the generated approach can be run on NVIDIA and AMD hardware and show how some workloads perform there. They do not form a broad comparison across devices, precisions, and graph families.

The baseline choices also limit how far a speedup can be generalized. The e3nn throughput experiments use compilation where it fits, so some measurements compare against a compiled baseline and some against a baseline constrained by memory. The end-to-end Nequip comparison uses the unmodified Python interface without the compilation options named in the paper. Its speedup applies to that software path. In MACE, the species dictionary intentionally exercises an inefficiency, and the fused substitution is accompanied by adjacency sorting and an optimization for species handling. The headline application speedups therefore describe particular configurations and integrations.

At the numerical level, the correctness checks establish agreement with e3nn up to roundoff on the tested configurations, after handling the known weight permutation when needed. The paper does not report a wider assessment of error accumulation across long trajectories or compare force and energy accuracy after training with different kernels. Nor do the derivative speed benchmarks constitute a comparison of training time, convergence, or eventual prediction quality. They measure operations required by force training. End-to-end evidence concerns the force-evaluation and simulation workloads that were actually run.

Finally, the complete deployment cost depends on how long the generated kernels are reused and how graph preprocessing fits the application. The throughput measurements show the cost of running prepared kernels through the specified interfaces. The paper does not provide a separate study of compilation latency or an amortization analysis for short-lived configurations. Sorted adjacency and any required permutation similarly matter when the input graph changes. Their significance can differ from the effect of fusion during the timed computation.

### What came after

No later citing work is available to document which parts of OpenEquivariance were adopted, changed, or extended. The paper’s own experiments record software developments that took place while the work was underway, including the addition of fused convolution and improved throughput in cuEquivariance. Those comparisons show how the baseline changed during the project. They do not establish that the competing release built on this generator. The authors leave lower-precision execution, more stable neighbor summation, and integration into additional equivariant networks as directions for subsequent work.

## Cite

Cite as Vivek Bharadwaj, Austin Glover, Aydin Buluc and James Demmel. 2025. An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks. arXiv:2501.13986.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.2501.13986](https://doi.org/10.48550/arxiv.2501.13986) · [arXiv 2501.13986](https://arxiv.org/abs/2501.13986)

```bibtex
@misc{bharadwaj2025efficient,
  title = {{An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks}},
  author = {Vivek Bharadwaj, Austin Glover, Aydin Buluc and James Demmel},
  year = {2025},
  doi = {10.48550/arxiv.2501.13986},
  eprint = {2501.13986},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2501.13986}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
