Repository navigation
Fix MAISI concatenation memory handling - #9255
slavaheroes wants to merge 2 commits into
Conversation
Replace the fixed dimension cutoff with GPU-first concatenation and CPU fallback on CUDA out-of-memory errors. Add an optional free-memory margin, a fallback warning, and correctness regression tests. Refs: Project-MONAI#9250 Assisted-by: OpenAI Codex Signed-off-by: Slava Shen <shen9910@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueTip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Replace the fixed dimension cutoff with GPU-first concatenation and CPU fallback on CUDA out-of-memory errors. Add an optional free-memory margin, a fallback warning, and correctness regression tests.
Refs: #9250
Assisted-by: OpenAI Codex
I reviewed the submitted change
Fixes #9250.
Description
Replace the fixed dimension threshold with GPU-first concatenation. If CUDA concatenation runs out of memory, emit a
RuntimeWarning, concatenate the tensors on the CPU.Add an optional
concat_memory_marginargument:None(default): attempt GPU concatenation and fall back to the CPU on CUDA OOM.Add regression tests and update the docstrings and documentation.
Types of changes
the fallback successfully.
For the issue's 512 × 512 × 16 benchmark, median runtime decreased
from 42.40 s to 0.440 s on an RTX 5090. Outputs were bitwise identical.
Peak PyTorch allocated memory increased from approximately
4.02 GiB to 4.25 GiB.
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.