Skip to content

fix float max_neighbors passed to nvalchemi - #296

Merged
Luthaf merged 1 commit into
metatensor:mainfrom
joehart2001:cutoff-fix
Jul 30, 2026
Merged

fix float max_neighbors passed to nvalchemi#296
Luthaf merged 1 commit into
metatensor:mainfrom
joehart2001:cutoff-fix

Conversation

@joehart2001

Copy link
Copy Markdown
Contributor

Summary

Fix a type error in the CUDA/nvalchemi neighbour-list backend for large cutoffs.

#259 added a max_neighbors estimate:

len(system) * max(128, cutoff**3)

cutoff is a float, so this expression is also a float once cutoff**3 > 128 (i.e. above roughly 5 Å). However, nvalchemi requires max_neighbors to be an integer.

I noticed this whilst running benchmarks on ml-peg with pet-cam-xl. this can be reproduced by running e.g. the lattice constant benchmark on gpu.

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

@frostedoyster frostedoyster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@Luthaf
Luthaf merged commit 97f739f into metatensor:main Jul 30, 2026
10 checks passed
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.

3 participants