Replies: 1 comment 3 replies
|
Huh, cool - didn't know their optimization would be this straightforward to apply- yeah agreed I think we should put this in the package and welcome the contribution. I'm a bit fuzzy on how the scheme compares to what we're doing (need to stare at the code), but I can't argue with the speedup, and the memory movement logic seems reasonable. In terms of integration: if you can slot this in by modifying the existing kernel templates (in a minimal-ish way), go ahead. If you find you need a total rewrite of the templates or would have to modify them in a way that would slow down other tensor products, then the best thing to do would be adding a new template file and we can branch on which one is selected for compilation at runtime. Feel free to open a PR and credit Sobek appropriately; we can version this so that their paper gets credit for speed up over the older version. @asglover was looking at Sobek as well, so he can review this diff. |
Uh oh!
There was an error while loading. Please reload this page.
I recently came across the Sobek paper and, with the help of Codex, explored whether its receiver-side streaming idea could accelerate channel-wise UVU tensor products in MACE. My implementation is available on the
streaming-kernelbranch.The main difference from the standard OEQ convolution kernels is the ownership. In the forward pass, each thread owns one
(receiver, channel)pair, scans the edges incident to that receiver, and reduces the convolution result locally. In the backward pass, each warp owns one edge, processes the channels in parallel, writes radial-weight gradients directly, reduces spherical-harmonic gradients across channels within the warp, and performs atomic additions for node feature gradients.I benchmarked prepared, receiver-sorted tensor-product workloads on a synthetic 5,000-node, 280,000-edge topology with a uniform degree of 56 edges per receiver, chosen to approximate the coordination of bulk HCP titanium with a 6 Å cutoff. I obtained the following timings on an NVIDIA A100 GPU (script streaming_speedup.py):
¹ The standard HVP exceeded the A100's 80 GB memory, while the streaming HVP completed.
Graph construction, including sorting, was outside the timed region. In my LAMMPS workflow, neighbor lists group neighbors by their central atom. Preserving the central atom as the MACE receiver when flattening the list therefore produces receiver-major edges without a separate sorting pass.
These results look promising to me, and I intend to use the kernels in my own work.
However, I would be happy to use this fast path directly from OEQ.
I have checked the kernel code and integration and provided it here as proof of concept.
My questions are:
All reactions