From b78b39073c17f2a4faa9a953fa0b5c8f9420c05a Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Mon, 28 Mar 2022 14:05:01 +0100 Subject: [PATCH 1/9] fixes unit test Signed-off-by: Wenqi Li --- tests/test_mmar_download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_mmar_download.py b/tests/test_mmar_download.py index 50a69fe007..577c26a482 100644 --- a/tests/test_mmar_download.py +++ b/tests/test_mmar_download.py @@ -94,7 +94,7 @@ "item": "clara_pt_pathology_metastasis_detection", "map_location": "cuda" if torch.cuda.is_available() else "cpu", }, - "TorchVisionFullyConvModel", + "TorchVisionFCModel", np.array( [ [-0.00693138, -0.00441378, -0.01057985, 0.05604396, 0.03526996, -0.00399302, -0.0267504], From 238d883a92d11bea021ebd605837c9cdbfc78d2f Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Mon, 28 Mar 2022 14:06:12 +0100 Subject: [PATCH 2/9] temp tests Signed-off-by: Wenqi Li --- .github/workflows/integration.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8ed9790dca..2073daaa19 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -3,6 +3,9 @@ name: integration on: repository_dispatch: type: [integration-test-command] + push: + branches: + - 4010-mmar jobs: integration-py3: From d4616d1edaf4ec9ed9bf97442850c3de143c3a72 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Mon, 28 Mar 2022 14:20:19 +0100 Subject: [PATCH 3/9] adds docker version tests Signed-off-by: Wenqi Li --- .github/workflows/cron.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index b6ed2274ee..17c65aaf89 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -62,7 +62,7 @@ jobs: if: github.repository == 'Project-MONAI/MONAI' strategy: matrix: - container: ["pytorch:21.02", "pytorch:22.02"] # 21.02 for backward comp. + container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.02"] # 21.02, 21.10 for backward comp. container: image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image options: "--gpus all" @@ -106,7 +106,7 @@ jobs: if: github.repository == 'Project-MONAI/MONAI' strategy: matrix: - container: ["pytorch:21.02", "pytorch:22.02"] # 21.02 for backward comp. + container: ["pytorch:21.02", "pytorch:21.10", "pytorch:22.02"] # 21.02, 21.10 for backward comp. container: image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image options: "--gpus all" @@ -204,7 +204,7 @@ jobs: if: github.repository == 'Project-MONAI/MONAI' needs: cron-gpu # so that monai itself is verified first container: - image: nvcr.io/nvidia/pytorch:21.09-py3 # testing with the latest pytorch base image + image: nvcr.io/nvidia/pytorch:22.02-py3 # testing with the latest pytorch base image options: "--gpus all --ipc=host" runs-on: [self-hosted, linux, x64, common] steps: From df2756ede52c65f3091dc028f5bf2bdf80fbe312 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Mon, 28 Mar 2022 14:58:59 +0100 Subject: [PATCH 4/9] fixes #4016 Signed-off-by: Wenqi Li --- monai/networks/nets/dints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monai/networks/nets/dints.py b/monai/networks/nets/dints.py index a4aaf32eed..978695c5d0 100644 --- a/monai/networks/nets/dints.py +++ b/monai/networks/nets/dints.py @@ -817,8 +817,8 @@ def get_topology_entropy(self, probs): probs: path activation probabilities """ if hasattr(self, "node2in"): - node2in = self.node2in - node2out = self.node2out + node2in = self.node2in # pylint: disable=E0203 + node2out = self.node2out # pylint: disable=E0203 else: # node activation index to feasible input child_idx node2in = [[] for _ in range(len(self.node_act_list))] From ae24c2b7adaad165e1a2f35615a6c5c1387999f5 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Mon, 28 Mar 2022 19:54:27 +0100 Subject: [PATCH 5/9] local tests Signed-off-by: Wenqi Li --- tests/test_mmar_download.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_mmar_download.py b/tests/test_mmar_download.py index 577c26a482..42deb411bd 100644 --- a/tests/test_mmar_download.py +++ b/tests/test_mmar_download.py @@ -97,13 +97,13 @@ "TorchVisionFCModel", np.array( [ - [-0.00693138, -0.00441378, -0.01057985, 0.05604396, 0.03526996, -0.00399302, -0.0267504], - [0.00805358, 0.01016939, -0.10749951, -0.28787708, -0.27905375, -0.13328083, -0.00882593], - [-0.01909848, 0.04871106, 0.2957697, 0.60376877, 0.53552634, 0.24821444, 0.03773781], - [0.02449462, -0.07471243, -0.30943492, -0.43987238, -0.26549947, -0.00698426, 0.04395606], - [-0.03124012, 0.00807883, 0.06797771, -0.04612541, -0.30266526, -0.39722857, -0.25109962], - [0.02480375, 0.03378576, 0.06519791, 0.24546203, 0.41867673, 0.393786, 0.16055048], - [-0.01529332, -0.00062494, -0.016658, -0.06313603, -0.1508078, -0.09107386, -0.01239121], + [-0.00540746, -0.00274996, -0.00837622, 0.05415914, 0.03555066, -0.00071636, -0.02325751], + [0.00564625, 0.00674562, -0.1098334, -0.2936509, -0.28384757, -0.13580588, -0.00737865], + [-0.02159783, 0.04615543, 0.29717407, 0.6001161, 0.53496915, 0.2528417, 0.04530451], + [0.0225903, -0.07556137, -0.3070122, -0.43984795, -0.26286602, -0.00172576, 0.05003437], + [-0.0320133, 0.00855468, 0.06824744, -0.04786247, -0.30358723, -0.3960023, -0.24895012], + [0.02412516, 0.03411723, 0.06513759, 0.24332047, 0.41664436, 0.38999054, 0.15957521], + [-0.01303542, -0.00166874, -0.01965466, -0.06620175, -0.15635538, -0.10023144, -0.01698002], ] ), ), From 463d657c4e38c3f3d0e68d957cd1e96a8916ca40 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Mon, 28 Mar 2022 21:37:18 +0100 Subject: [PATCH 6/9] remove mmar cache daily Signed-off-by: Wenqi Li --- .github/workflows/cron-mmar.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cron-mmar.yml b/.github/workflows/cron-mmar.yml index f61ba59368..5fc3ad2d22 100644 --- a/.github/workflows/cron-mmar.yml +++ b/.github/workflows/cron-mmar.yml @@ -32,6 +32,7 @@ jobs: key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }} - name: Install dependencies run: | + rm -rf /github/home/.cache/torch/hub/mmars/ python -m pip install --upgrade pip wheel python -m pip install -r requirements-dev.txt - name: Loading MMARs From 1b5a4ce344392cc86c21be00baa8c1aabd07614f Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 29 Mar 2022 10:20:25 +0100 Subject: [PATCH 7/9] remove cache Signed-off-by: Wenqi Li --- .github/workflows/integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2073daaa19..e788196740 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -39,6 +39,7 @@ jobs: python -m pip uninstall -y torch torchvision python -m pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html python -m pip install -r requirements-dev.txt + rm -rf /github/home/.cache/torch/hub/mmars/ - name: Run integration tests run: | python -m pip list From f578045dc178c1baae32516cb493c794fbbc6d0b Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 29 Mar 2022 10:42:05 +0100 Subject: [PATCH 8/9] Revert "temp tests" This reverts commit 238d883a92d11bea021ebd605837c9cdbfc78d2f. Signed-off-by: Wenqi Li --- .github/workflows/integration.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e788196740..c38b66eda4 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -3,9 +3,6 @@ name: integration on: repository_dispatch: type: [integration-test-command] - push: - branches: - - 4010-mmar jobs: integration-py3: From d47e0aed403dcfdbd5577cb71597be7d4635f464 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 29 Mar 2022 11:58:46 +0100 Subject: [PATCH 9/9] fixes typo Signed-off-by: Wenqi Li --- monai/engines/workflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/engines/workflow.py b/monai/engines/workflow.py index 245571c6db..65bb313e53 100644 --- a/monai/engines/workflow.py +++ b/monai/engines/workflow.py @@ -274,7 +274,7 @@ def run(self) -> None: """ if self.state.epoch_length == 0: warnings.warn( - "`dataloader` is emply or the specified `epoch_length` is 0, skip the `run`." + "`dataloader` is empty or the specified `epoch_length` is 0, skip the `run`." " if running distributed training, the program may hang in `all-gather`, `all-reduce`, etc." " because not all the ranks run the same computation logic." )