Skip to content

AutoRunner enhancements: local folder and algorithm subsets#5623

Merged
wyli merged 18 commits into
Project-MONAI:devfrom
myron:auto_folder
Dec 5, 2022
Merged

AutoRunner enhancements: local folder and algorithm subsets#5623
wyli merged 18 commits into
Project-MONAI:devfrom
myron:auto_folder

Conversation

@myron

@myron myron commented Dec 1, 2022

Copy link
Copy Markdown
Collaborator

AutoRunner class improvements

  • adds auto-runner option templates_path_or_url to optionally accept a local templates folder location. The default (None) is the same: to download the release zip e.g. AutoRunner(templates_path_or_url='/my/local/algorithm_templates')

  • enhances algos input option to define a subset of algorithm names to run (e.g. AutoRunner(algos=['segresnet','dints'])

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.

Signed-off-by: myron <amyronenko@nvidia.com>
@myron myron added the enhancement New feature or request label Dec 1, 2022
@myron myron requested a review from mingxin-zheng December 1, 2022 11:03
@myron

myron commented Dec 1, 2022

Copy link
Copy Markdown
Collaborator Author

the windows tests are failing again , for some unrelated reason...

@mingxin-zheng mingxin-zheng requested a review from wyli December 1, 2022 14:04
@wyli wyli requested a review from Nic-Ma December 1, 2022 14:06
@Nic-Ma

Nic-Ma commented Dec 1, 2022

Copy link
Copy Markdown
Contributor

I see the flake8 tests didn't pass, could you please help fix it?

Thanks.

@mingxin-zheng

Copy link
Copy Markdown
Collaborator

I checked out the branch and run the integration test for AutoRunner. Some failures need to be fixed:

(base) root@adminn-MS-7D31:/workspace/monai/monai-in-dev# python tests/test_integration_autorunner.py
2022-12-01 15:16:54,155 - INFO - AutoRunner using work directory /tmp/tmplf3777to/work_dir
2022-12-01 15:16:54,156 - INFO - Loading input config /tmp/tmplf3777to/data_src_cfg.yaml
2022-12-01 15:16:54,157 - INFO - The output_dir is not specified. /tmp/tmplf3777to/work_dir/ensemble_output will be used to save ensemble predictions
2022-12-01 15:16:54,157 - INFO - Directory /tmp/tmplf3777to/work_dir/ensemble_output is created to save ensemble predictions
2022-12-01 15:16:54,157 - INFO - Running data analysis...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 45.86it/s]
algo_templates.tar.gz: 296kB [00:01, 243kB/s]                                                                                                                                          
2022-12-01 15:16:55,743 - INFO - Downloaded: /tmp/tmpphes5ts9/algo_templates.tar.gz
2022-12-01 15:16:55,744 - INFO - Expected md5 is None, skip md5 check for file /tmp/tmpphes5ts9/algo_templates.tar.gz.
2022-12-01 15:16:55,744 - INFO - Writing into directory: /tmp/tmplf3777to/work_dir.
E2022-12-01 15:16:55,897 - INFO - AutoRunner using work directory /tmp/tmpvo558ukw/work_dir
2022-12-01 15:16:55,898 - INFO - Loading input config /tmp/tmpvo558ukw/data_src_cfg.yaml
2022-12-01 15:16:55,898 - INFO - The output_dir is not specified. /tmp/tmpvo558ukw/work_dir/ensemble_output will be used to save ensemble predictions
2022-12-01 15:16:55,898 - INFO - Directory /tmp/tmpvo558ukw/work_dir/ensemble_output is created to save ensemble predictions
2022-12-01 15:16:55,898 - INFO - Running data analysis...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 75.03it/s]
algo_templates.tar.gz: 296kB [00:01, 298kB/s]                                                                                                                                          
2022-12-01 15:16:57,142 - INFO - Downloaded: /tmp/tmp2m08_yi6/algo_templates.tar.gz
2022-12-01 15:16:57,142 - INFO - Expected md5 is None, skip md5 check for file /tmp/tmp2m08_yi6/algo_templates.tar.gz.
2022-12-01 15:16:57,143 - INFO - Writing into directory: /tmp/tmpvo558ukw/work_dir.
E
======================================================================
ERROR: test_autorunner (__main__.TestAutoRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_integration_autorunner.py", line 108, in test_autorunner
    runner.run()
  File "/workspace/monai/monai-in-dev/monai/apps/auto3dseg/auto_runner.py", line 566, in run
    bundle_generator = BundleGen(
  File "/workspace/monai/monai-in-dev/monai/apps/auto3dseg/bundle_gen.py", line 349, in __init__
    for name in algos:
TypeError: 'NoneType' object is not iterable

======================================================================
ERROR: test_autorunner_hpo (__main__.TestAutoRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_integration_autorunner.py", line 138, in test_autorunner_hpo
    runner.run()
  File "/workspace/monai/monai-in-dev/monai/apps/auto3dseg/auto_runner.py", line 566, in run
    bundle_generator = BundleGen(
  File "/workspace/monai/monai-in-dev/monai/apps/auto3dseg/bundle_gen.py", line 349, in __init__
    for name in algos:
TypeError: 'NoneType' object is not iterable

----------------------------------------------------------------------
Ran 2 tests in 3.141s

FAILED (errors=2)

Comment thread monai/apps/auto3dseg/bundle_gen.py Outdated
Comment thread monai/apps/auto3dseg/bundle_gen.py
Comment thread monai/apps/auto3dseg/bundle_gen.py Outdated
Comment thread monai/apps/auto3dseg/bundle_gen.py Outdated
Comment thread monai/apps/auto3dseg/auto_runner.py Outdated
Comment thread monai/apps/auto3dseg/auto_runner.py
myron added 3 commits December 1, 2022 10:00
Signed-off-by: myron <amyronenko@nvidia.com>
Signed-off-by: myron <amyronenko@nvidia.com>
Comment thread monai/apps/auto3dseg/bundle_gen.py Outdated
myron added 2 commits December 1, 2022 15:08
Signed-off-by: myron <amyronenko@nvidia.com>
Signed-off-by: myron <amyronenko@nvidia.com>
Comment thread monai/apps/auto3dseg/bundle_gen.py
myron and others added 3 commits December 1, 2022 15:42
Signed-off-by: myron <amyronenko@nvidia.com>
Signed-off-by: myron <amyronenko@nvidia.com>
@wyli wyli requested a review from mingxin-zheng December 1, 2022 23:50
myron added 3 commits December 1, 2022 16:59
Signed-off-by: myron <amyronenko@nvidia.com>
Signed-off-by: myron <amyronenko@nvidia.com>
@myron

myron commented Dec 2, 2022

Copy link
Copy Markdown
Collaborator Author

I see the flake8 tests didn't pass, could you please help fix it?

Thanks.

done

@myron

myron commented Dec 2, 2022

Copy link
Copy Markdown
Collaborator Author

I checked out the branch and run the integration test for AutoRunner. Some failures need to be fixed:

done

Signed-off-by: myron <amyronenko@nvidia.com>

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks, I put some some comments inline

Comment thread monai/apps/auto3dseg/auto_runner.py Outdated
Comment thread monai/apps/auto3dseg/auto_runner.py Outdated
Comment thread monai/apps/auto3dseg/auto_runner.py Outdated
Comment thread monai/apps/auto3dseg/bundle_gen.py
@myron

myron commented Dec 2, 2022

Copy link
Copy Markdown
Collaborator Author

@wyli @mingxin-zheng I've made the requested changes, plz take a look.

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me, please confirm @mingxin-zheng

Comment thread monai/apps/auto3dseg/bundle_gen.py
@mingxin-zheng

Copy link
Copy Markdown
Collaborator

Hi @myron , I just had a small comment and everything else looked good! Thx

@wyli

wyli commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

/build

@wyli wyli enabled auto-merge (squash) December 5, 2022 17:34
@wyli wyli merged commit aef2ecc into Project-MONAI:dev Dec 5, 2022
@wyli wyli mentioned this pull request Dec 6, 2022
3 tasks
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.

4 participants