Skip to content

perf: vectorized, multithreaded, cuda-available calculation kernel - #107

Open
SYMSCAE wants to merge 3 commits into
diffpy:mainfrom
SYMSCAE:cuda
Open

SYMSCAE wants to merge 3 commits into
diffpy:mainfrom
SYMSCAE:cuda

Conversation

@SYMSCAE

@SYMSCAE SYMSCAE commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

This PR updates bindings for libdiffpy commit 994aaf2. See diffpy/libdiffpy#76 and diffpy/libdiffpy#78 for changes and benchmarks.

Additional changes

  • Add diffpy.srreal.calculationkernel to list and select CPU and CUDA kernels for calculators.
  • Add getAtomArrays() and setAtomArrays() to AtomicStructureAdapter for bulk access to atom data, and speed up conversion of diffpy.structure and pyobjcryst structures.
  • Include the cuda and cuda-mixed kernels in x86-64 wheels for Linux and Windows.

SYMSCAE and others added 3 commits November 19, 2026 22:38
Bind libdiffpy's CPU kernels and batch atomic structure conversion through
NumPy arrays. Preserve displacement tensors for shared atoms, honor custom
atom and crystal accessors, and reuse ObjCryst data for native crystals.
Validate site indices and cover converter registration and class lifetime.
Expose CUDA PDF and Debye kernels and their precision controls. Build
CUDA-enabled wheels and cover CPU fallback on Windows hosts without a
CUDA driver. Pin the embedded library to its upstream CUDA merge.
@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.89110% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.90%. Comparing base (2f2610f) to head (6b49427).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_calculationkernel.py 65.54% 41 Missing ⚠️
tests/test_allpairs.py 97.63% 3 Missing ⚠️
tests/test_objcrystconverters.py 98.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
- Coverage   98.69%   97.90%   -0.80%     
==========================================
  Files          26       29       +3     
  Lines        3834     4580     +746     
==========================================
+ Hits         3784     4484     +700     
- Misses         50       96      +46     
Files with missing lines Coverage Δ
tests/test_atomarrays.py 100.00% <100.00%> (ø)
tests/test_parallel.py 98.88% <100.00%> (ø)
tests/test_structureadapter.py 99.52% <100.00%> (+0.02%) ⬆️
tests/testutils.py 96.15% <100.00%> (-0.15%) ⬇️
tests/test_objcrystconverters.py 99.18% <98.93%> (-0.82%) ⬇️
tests/test_allpairs.py 97.63% <97.63%> (ø)
tests/test_calculationkernel.py 65.54% <65.54%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SYMSCAE
SYMSCAE marked this pull request as ready for review November 20, 2026 06:58
@SYMSCAE

SYMSCAE commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@sbillinge PR ready for review. Again, codecov is failing because it's not happy with cuda builds not being tested...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant