Skip to content

Conversation

@myron
Copy link
Collaborator

@myron myron commented Mar 27, 2023

SlidingWindowInfererAdapt extends SlidingWindowInferer to automatically switch to buffered and then to CPU stitching, when OOM on GPU. It also records a size of such large images to automatically try CPU stitching for the next large image of a similar size. If the stitching 'device' input parameter is provided,
automatic adaptation won't be attempted, please keep the default option device = None for adaptive behavior.
Note: the output might be on CPU (even if the input was on GPU), if the GPU memory was not sufficient.


also fixes #6340 by adding one line to the resampling

@myron myron added the enhancement New feature or request label Mar 27, 2023
@myron myron added this to the Auto3DSeg enhancement [P0 v1.2] milestone Mar 27, 2023
@myron myron requested a review from wyli March 27, 2023 22:29
@myron
Copy link
Collaborator Author

myron commented Mar 27, 2023

I'm not sure why it fails premerge/flake test. It's fine for me. can someone help plz @mingxin-zheng @wyli

@mingxin-zheng
Copy link
Contributor

mingxin-zheng commented Mar 28, 2023

Hi @myron , as I replied in the slack channel, this could be caused by using a different version of isort.

I ran ./runtests --autofix and it shows the line 623 and 630 should be removed in monai/inferers/inferer.py

@wyli wyli force-pushed the sliding branch 3 times, most recently from 31a67b5 to ad83119 Compare March 29, 2023 09:20
@wyli wyli marked this pull request as draft March 30, 2023 14:17
Signed-off-by: myron <amyronenko@nvidia.com>
@myron myron marked this pull request as ready for review April 14, 2023 02:25
myron added 3 commits April 13, 2023 19:34
Signed-off-by: myron <amyronenko@nvidia.com>
Signed-off-by: myron <amyronenko@nvidia.com>
Signed-off-by: myron <amyronenko@nvidia.com>
@myron
Copy link
Collaborator Author

myron commented Apr 14, 2023

@wyli I've updated this PR to include buffered case handling, please check and merge

also mypy complained on the super().call_() lines with error:

mypy
mypy 1.2.0 (compiled: yes)
monai/inferers/inferer.py:509:20: error: "__call__" of "SlidingWindowInferer" gets multiple values for keyword argument "inputs"  [misc]
monai/inferers/inferer.py:509:20: error: "__call__" of "SlidingWindowInferer" gets multiple values for keyword argument "network"  [misc]
monai/inferers/inferer.py:519:23: error: "__call__" of "SlidingWindowInferer" gets multiple values for keyword argument "inputs"  [misc]
monai/inferers/inferer.py:519:23: error: "__call__" of "SlidingWindowInferer" gets multiple values for keyword argument "network"  [misc]

even though, the code looks correct.
I added "type:ignore" , because I couldn't figure it out, may be there is better way.

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks, I'll test and merge it soon

wyli added 2 commits April 14, 2023 02:27
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli
Copy link
Contributor

wyli commented Apr 14, 2023

/build

@wyli wyli enabled auto-merge (squash) April 14, 2023 06:40
@wyli wyli merged commit 3633b1c into Project-MONAI:dev Apr 14, 2023
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.

lazy.utils.resample output dtype

3 participants