-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5269 5291 Update PyTorch base docker to 22.09 (#5293)
Fixes #5269 #5291 . ### Description This PR updated the PyTorch base docker to 22.09. ### 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: Nic Ma <[email protected]> Signed-off-by: monai-bot <[email protected]> Signed-off-by: Wenqi Li <[email protected]> Co-authored-by: monai-bot <[email protected]> Co-authored-by: Wenqi Li <[email protected]>
- Loading branch information
1 parent
9fa35cc
commit f040ec0
Showing
10 changed files
with
78 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
# To build with a different base image | ||
# please run `docker build` using the `--build-arg PYTORCH_IMAGE=...` flag. | ||
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:22.08-py3 | ||
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:22.09-py3 | ||
FROM ${PYTORCH_IMAGE} | ||
|
||
LABEL maintainer="[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ pydicom | |
h5py | ||
nni | ||
optuna | ||
opencv-python-headless |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) MONAI Consortium | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import unittest | ||
|
||
import torch | ||
import torch.distributed as dist | ||
from torch.cuda.amp import autocast | ||
|
||
# FIXME: test for the workaround of https://github.com/Project-MONAI/MONAI/issues/5291 | ||
from monai.config.deviceconfig import print_config | ||
from tests.utils import skip_if_no_cuda | ||
|
||
|
||
def main_worker(rank, ngpus_per_node): | ||
dist.init_process_group(backend="nccl", init_method="tcp://127.0.0.1:12345", world_size=ngpus_per_node, rank=rank) | ||
# `benchmark = True` is not compatible with openCV in PyTorch 22.09 docker for multi-gpu training | ||
torch.backends.cudnn.benchmark = True | ||
|
||
model = torch.nn.Conv3d(in_channels=1, out_channels=32, kernel_size=3, bias=True).to(rank) | ||
model = torch.nn.parallel.DistributedDataParallel( | ||
model, device_ids=[rank], output_device=rank, find_unused_parameters=False | ||
) | ||
x = torch.ones(1, 1, 192, 192, 192).to(rank) | ||
with autocast(enabled=True): | ||
model(x) | ||
|
||
|
||
@skip_if_no_cuda | ||
class TestCV2Dist(unittest.TestCase): | ||
def test_cv2_cuda_ops(self): | ||
print_config() | ||
ngpus_per_node = torch.cuda.device_count() | ||
torch.multiprocessing.spawn(main_worker, nprocs=ngpus_per_node, args=(ngpus_per_node,)) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |