Skip to content

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

Merged
Nic-Ma merged 9 commits intoProject-MONAI:devfrom
myron:sliding
Oct 13, 2022
Merged

SlidingWindowInferer: option to adaptively stitch in cpu memory for large images#5297
Nic-Ma merged 9 commits intoProject-MONAI:devfrom
myron:sliding

Conversation

@myron
Copy link
Copy Markdown
Collaborator

@myron myron commented Oct 8, 2022

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
#4625
#4495
#3497
#4726
#4588

Types of changes

  • 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 myron added the enhancement New feature or request label Oct 8, 2022
@myron myron added this to the Auto3D Seg framework [P0 v1.0] milestone Oct 8, 2022
@Nic-Ma
Copy link
Copy Markdown
Contributor

Nic-Ma commented Oct 13, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor

Nic-Ma commented Oct 13, 2022

/build

@Nic-Ma Nic-Ma enabled auto-merge (squash) October 13, 2022 17:28
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Oct 13, 2022

/build

@Nic-Ma Nic-Ma merged commit dae09ff into Project-MONAI:dev Oct 13, 2022
wyli added a commit to wyli/MONAI that referenced this pull request Oct 15, 2022
…arge images (Project-MONAI#5297)

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 
Project-MONAI#4625
Project-MONAI#4495
Project-MONAI#3497
Project-MONAI#4726
Project-MONAI#4588 


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [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.

Signed-off-by: myron <[email protected]>
Co-authored-by: Wenqi Li <[email protected]>
bhashemian pushed a commit to JHancox/MONAI that referenced this pull request Oct 20, 2022
…arge images (Project-MONAI#5297)

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 
Project-MONAI#4625
Project-MONAI#4495
Project-MONAI#3497
Project-MONAI#4726
Project-MONAI#4588 


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [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.

Signed-off-by: myron <[email protected]>
Co-authored-by: Wenqi Li <[email protected]>
Signed-off-by: Behrooz <[email protected]>
@myron myron deleted the sliding branch October 22, 2022 18:50
KumoLiu pushed a commit that referenced this pull request Nov 2, 2022
…arge images (#5297)

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 
#4625
#4495
#3497
#4726
#4588 


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [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.

Signed-off-by: myron <[email protected]>
Co-authored-by: Wenqi Li <[email protected]>
Signed-off-by: KumoLiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants