Skip to content

Fix SSF issues on large grids#197

Open
vmitq wants to merge 1 commit intowavefunction91:masterfrom
vmitq:fixup/ssf-large-grids
Open

Fix SSF issues on large grids#197
vmitq wants to merge 1 commit intowavefunction91:masterfrom
vmitq:fixup/ssf-large-grids

Conversation

@vmitq
Copy link
Copy Markdown

@vmitq vmitq commented Apr 24, 2026

Large molecules (e.g. ubiquitin) could fail during SSF grid reweighting step. Changing lddist type to size_t seems to fix it.

Large molecules (e.g. ubiquitin) could fail during SSF grid reweighting.
Changing lddist type to size_t seems to fix it.
@awvwgk awvwgk requested a review from Copilot May 4, 2026 07:20
@awvwgk awvwgk added the bug Something isn't working label May 4, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR widens the CUDA SSF distance-stride (lddist) from int32_t to size_t so the 1D SSF weight and derivative kernels can index the per-point distance scratch buffer without 32-bit overflow on large workloads. In the GauXC CUDA Scheme1 path, this change is aimed at the SSF reweighting logic used after grid-to-center distances are computed.

Changes:

  • Update the CUDA SSF 1D kernel declarations/definitions to take size_t lddist.
  • Propagate the widened stride type through the CUDA Scheme1 weight and first-derivative wrappers.
  • Keep the CUDA Scheme1 call chain consistent with the existing size_t-based get_ldatoms() device stride.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/xc_integrator/local_work_driver/device/cuda/kernels/cuda_ssf_1d.hpp Widened SSF 1D function declarations to use size_t for the distance stride.
src/xc_integrator/local_work_driver/device/cuda/kernels/cuda_ssf_1d.cu Widened the SSF 1D kernel/function implementations for weight and derivative paths.
src/xc_integrator/local_work_driver/device/cuda/cuda_aos_scheme1_weights.hpp Updated CUDA Scheme1 wrapper declarations to pass a size_t stride.
src/xc_integrator/local_work_driver/device/cuda/cuda_aos_scheme1_weights.cu Propagated the widened stride through the CUDA Scheme1 wrapper implementations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const double* coords,
const double* dist_scratch,
int32_t lddist,
size_t lddist,
const double* points_z,
const double* dist_scratch,
int32_t lddist,
size_t lddist,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants