Skip to content

Migrate VDW buffers to model device inside _build_vdw_restraints#19

Merged
HatPdotS merged 1 commit into
HatPdotS:mainfrom
krlun:fix/mps-vdw-rebuild-device-migration
May 24, 2026
Merged

Migrate VDW buffers to model device inside _build_vdw_restraints#19
HatPdotS merged 1 commit into
HatPdotS:mainfrom
krlun:fix/mps-vdw-rebuild-device-migration

Conversation

@krlun
Copy link
Copy Markdown
Contributor

@krlun krlun commented May 22, 2026

The rebuild path left fresh VDW pair list, h_topo, and h_excl_hash
on CPU because only build_restraints migrated them. After a
maintenance-triggered rebuild, the next forward pass on MPS (and
potentially CUDA) hit a device mismatch.

Use the already-captured target_device to migrate at the end of
_build_vdw_restraints so both call sites are correct.

Verified on MPS.

The rebuild path left fresh VDW pair list, h_topo, and h_excl_hash
on CPU because only build_restraints migrated them. After a
maintenance-triggered rebuild, the next forward pass on MPS (and
potentially CUDA) hit a device mismatch.

Use the already-captured target_device to migrate at the end of
_build_vdw_restraints so both call sites are correct.

Verified on MPS.
Copy link
Copy Markdown
Owner

@HatPdotS HatPdotS left a comment

Choose a reason for hiding this comment

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

Thank you, I was aiming to centralize device handling, and it seems that I missed some things. This looks like the correct fix.

@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@HatPdotS HatPdotS merged commit 442c4ce into HatPdotS:main May 24, 2026
10 of 11 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