MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

SlidingWindowInferer: option to adaptively stitch in cpu memory for large images

Open myron opened this issue 2 years ago • 0 comments

SlidingWindowInferer: option to adaptively stitch in cpu memory for large images.

This adds an option to provide maximum input image volume (number of elements) to dynamically change stitching to cpu memory (to avoid gpu memory crashes). For example with cpu_thresh=400*400*400, all input images with large volume will be stitched on cpu.

At the moment, a user must decide beforehand, to stitch ALL images on cpu or gpu (by specifying the 'device' parameter). But in many datasets, only a few large images require device==cpu, and running inference on cpu for ALL will be unnecessary slow.

It's related to https://github.com/Project-MONAI/MONAI/discussions/4625 https://github.com/Project-MONAI/MONAI/discussions/4495 https://github.com/Project-MONAI/MONAI/discussions/3497 https://github.com/Project-MONAI/MONAI/discussions/4726 https://github.com/Project-MONAI/MONAI/discussions/4588

Types of changes

  • [x] Non-breaking change (fix or new feature that would not break existing functionality).
  • [ ] Breaking change (fix or new feature that would cause existing functionality to change).
  • [ ] New tests added to cover the changes.
  • [ ] Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • [ ] Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • [ ] In-line docstrings updated.
  • [ ] Documentation updated, tested make html command in the docs/ folder.

myron avatar Oct 08 '22 18:10 myron