perf(neighbors): tile partial naive neighbor lists#134
Open
zubatyuk wants to merge 2 commits into
Open
Conversation
Add target-aware CUDA tile dispatch for compact topology-only rows across native, JAX, and Torch APIs. Preserve scalar fallbacks for unsupported outputs and add JAX graph replay plus dispatch and parity regressions. Signed-off-by: Roman Zubatyuk <rzubatiuk@nvidia.com>
Greptile SummaryThis PR adds CUDA tile-cooperative support for partial (compact
Important Files Changed
Reviews (2): Last reviewed commit: "fix(neighbors): clean up partial tile di..." | Re-trigger Greptile |
Avoid redundant shifted-position work in partial PBC tile kernels and centralize JAX CPU dispatch and target validation. Update the CPU dispatch regression to exercise the shared helper directly. Signed-off-by: Roman Zubatyuk <rzubatiuk@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ALCHEMI Toolkit-Ops Pull Request
Description
Accelerate native, JAX, and Torch naive neighbor-list rebuilds that update a compact subset of atoms. The previous implementation used scalar traversal in framework partial paths even when a CUDA tile-cooperative topology-only specialization was available, making large-system partial rebuilds disproportionately expensive. Expose the native specialization consistently through JAX and Torch, preserve scalar behavior for unsupported outputs, and retain optional JAX-only Warp graph replay for callers that keep all graph inputs and outputs at stable addresses.
The new compact-row path maps each output row to its global source atom:
For batched selective rebuilds, reset compact output rows using the target atom's owning system rather than the compact-row index:
Type of Change
Related Issues
N/A
Changes Made
target_indicesrows, including no-PBC, wrapped PBC, and prewrapped PBC paths.strategy="auto".graph_mode="warp"replay for tiled partial topology calls with persistent caller-owned buffers; reject dynamic COO output in this mode.(neighbor, periodic-shift)parity, graph configuration isolation, persistent-graph constraints, batched routing, and target-aware resets.Testing
make pytest)make lint)Checklist
Additional Notes
Tile execution is CUDA-only and intentionally limited to topology-only results. Requests for distances, vectors, pair functions, or selective rebuilds continue to use scalar kernels. Scalar and tiled neighbor rows may have different entry order; their active neighbor and periodic-shift multisets are equivalent. The benchmark numbers below are JAX measurements; this PR makes no Torch performance claim.
Controlled RTX 6000 Ada benchmarks used a 9,660-atom periodic system, six target rows, a 12 Å cutoff, and a capacity of 4,096 neighbors per row. Isolated synchronized neighbor-list calls measured:
Every scalar/tile run returned 2,074 active edges with exact count equality and exact order-independent
(neighbor, periodic-shift)multiset equality.With stable pointers, optional Warp graph replay reduced isolated tiled partial-call latency from 228.4 to 125.2 µs for float32 (1.82x) and from 255.2 to 153.5 µs for float64 (1.66x). Fresh input addresses made graph replay slower, so graph replay remains opt-in and requires persistent buffers.
Tip
This repository uses Greptile, an AI code review service, to help conduct
pull request reviews. We encourage contributors to read and consider suggestions
made by Greptile, but note that human maintainers will provide the necessary
reviews for merging: Greptile's comments are not a qualitative judgement
of your code, nor is it an indication that the PR will be accepted/rejected.
We encourage the use of emoji reactions to Greptile comments, depending on
their usefulness and accuracy.