Skip to content

Conversation

@mdw771
Copy link
Collaborator

@mdw771 mdw771 commented Jan 9, 2026

Features/fixes

Added PtychographyTask.set_large_tensor_device, which moves following data between GPU and CPU:

  • object buffer
  • probe buffer
  • forward model intermediate variables
  • diffraction patterns

Usage:

# Offloading tensors to CPU
task.set_large_tensor_device("cpu")

# Reloading tensors to GPU
task.set_large_tensor_device("cuda")

Related issues (optional)

#52

Mentions

@yijiang1

Checklist

Have you...

  • Formatted your code properly adhering to PEP-8? Considering using RUFF to format your code automatically.
  • Resolved all merge conflicts with the main branch?
  • Checked the diffs between your branch and the main branch to ensure that your changes are not introducing any regressions or unnecessary/irrelevant changes?

@mdw771 mdw771 merged commit d30b091 into main Jan 9, 2026
2 checks passed
@mdw771 mdw771 deleted the tensor_offload branch January 9, 2026 20:12
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.

2 participants