Skip to content

Make Auto3DSeg algo able to find algorithm templates#6436

Merged
wyli merged 17 commits intoProject-MONAI:devfrom
mingxin-zheng:fix-6435
Apr 27, 2023
Merged

Make Auto3DSeg algo able to find algorithm templates#6436
wyli merged 17 commits intoProject-MONAI:devfrom
mingxin-zheng:fix-6435

Conversation

@mingxin-zheng
Copy link
Copy Markdown
Contributor

@mingxin-zheng mingxin-zheng commented Apr 26, 2023

Fixes #6435 .

Description

In this PR, the changes are

  • Make template_path a property that's available for all Algo classes to find the path to instantiate the class. The default value of template_path is None.
  • Enhance algo_from_pickle function by making it search in a few candidate directories to instantiate the Algo class if needed.
  • Remove checking if an algo instance is BundleAlgo in HPO logics because template_path is universal for all Algo now.
  • Update out-of-date docstring for AutoRunner

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • 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.

@mingxin-zheng mingxin-zheng marked this pull request as draft April 26, 2023 14:42
@mingxin-zheng mingxin-zheng marked this pull request as ready for review April 26, 2023 15:18
@mingxin-zheng
Copy link
Copy Markdown
Contributor Author

mingxin-zheng commented Apr 26, 2023

/integration-test

Signed-off-by: Mingxin Zheng <[email protected]>
Signed-off-by: Mingxin Zheng <[email protected]>
Signed-off-by: Mingxin Zheng <[email protected]>
@mingxin-zheng
Copy link
Copy Markdown
Contributor Author

mingxin-zheng commented Apr 27, 2023

I found some deprecated documentations in AutoRunner about "CUDA_VISIBLE_DEVICES" usage. Removing them in this PR as well.

@mingxin-zheng
Copy link
Copy Markdown
Contributor Author

Since template_path is in Algo in this PR, there is no need to check if the instance is BundleAlgo and changes the logics in HPO.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Apr 27, 2023

/build

@wyli wyli merged commit 5f344cc into Project-MONAI:dev Apr 27, 2023
@mingxin-zheng mingxin-zheng deleted the fix-6435 branch April 27, 2023 09:29
wyli pushed a commit that referenced this pull request May 10, 2023
…templates folder (#6505)

Fixes #6502 
Fixes #6501

### Background
- BundleAlgo `template_path` points to `algorithm_templates/<Algo>` <=
MONAI 1.1. Recent PR #6436 changed that to `algorithm_templates` and
make it easier to instantiate the BundleAlgo from "algorithm_templates"
folder when the folders are moved.
- But `BundleGen` did not update accordingly and still save
`algorithm_templates/<Algo>` as the `template_path` , which breaks NNI
HPO feature which relies heavily on these paths.

### Description
- Make `template_path` points to `algorithm_templates`
- Avoid using the latest `filelock` (3.12.0) which breaks nni
- Fix comments in
#6485 (comment)
in #6485

### 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).
- [x] New tests added to cover the changes.
- [x] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.

---------

Signed-off-by: Mingxin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to load the Auto3DSeg algo after the working directory is moved

2 participants