Skip to content

fix(cli): run apply-inv-tf on the config's device - #595

Merged
talonchandler merged 1 commit into
mainfrom
fix/apply-inv-tf-device
Nov 10, 2026
Merged

talonchandler merged 1 commit into
mainfrom
fix/apply-inv-tf-device

Conversation

@srivarra

@srivarra srivarra commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Needed for Biohub/biahub#462, which runs Richardson-Lucy deconvolution in biahub's mantis-v2 reconstruct step.

Summary

apply-inv-tf and reconstruct ignore the config's device. apply_inverse_transfer_function_single_position calls the phase and fluorescence models without it, so they run on the CPU whatever the config says. A Richardson-Lucy config with device: cuda allocated no GPU memory on an A40.

This passes settings.device to the phase and fluorescence models. The birefringence models take no device and still run on the CPU.

Testing

  • New gpu test test_apply_inv_tf_runs_on_the_config_device, for phase and for fluorescence with RL. With device: cuda the reconstruction allocates GPU memory and matches the CPU result.

Checklist

  • I added or updated tests, or this change does not require tests.
  • I updated the documentation, or this change does not require documentation.
  • I confirmed this change does not include confidential or sensitive information.

apply_inverse_transfer_function_single_position never passed settings.device to the phase and fluorescence models, so apply-inv-tf and reconstruct ran them on the CPU whatever the config said, Richardson-Lucy included. Pass it through; the birefringence models take no device and stay on the CPU.
@talonchandler
talonchandler marked this pull request as ready for review November 10, 2026 17:57
@talonchandler
talonchandler self-requested a review as a code owner November 10, 2026 17:57
@talonchandler
talonchandler merged commit 0e25b9b into main Nov 10, 2026
10 checks passed
srivarra added a commit to Biohub/biahub that referenced this pull request Nov 10, 2026
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