-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support saving search space in experiment load&save command #2886
Conversation
Merge master
merge master
merge master
merge master
merge master
merge master
merge master
Chinese translation (microsoft#2458)
merge master
merge master
merge master
merge master
merge master
merge master
merge master
merge master
tools/nni_cmd/nnictl_utils.py
Outdated
target_path = os.path.join(os.getcwd(), target_path) | ||
print_normal('Expand search space path to %s' % target_path) | ||
nnictl_exp_config['searchSpacePath'] = target_path | ||
# if the path alerady has a search space file, use the original one, otherwise use archived one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
print_error('Archive file does not contain search space file!') | ||
exit(1) | ||
else: | ||
for file in os.listdir(archive_search_space_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a dir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For storage data and classify. There are a few folders in archive folder, including 'code', 'nnictl', 'experiment', 'searchSpace', the search space file's name is random, put this file into 'searchSpace' folder for identify.
source_path = os.path.join(archive_search_space_dir, file) | ||
os.makedirs(os.path.dirname(target_path), exist_ok=True) | ||
shutil.copyfile(source_path, target_path) | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw error when no file is found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is already a judgement in lint 955, don't need to throw error here anymore.
tools/nni_cmd/nnictl.py
Outdated
@@ -159,6 +159,8 @@ def parse_args(): | |||
parser_load_experiment.add_argument('--codeDir', '-c', required=True, help='the path of codeDir for loaded experiment, \ | |||
this path will also put the code in the loaded experiment package') | |||
parser_load_experiment.add_argument('--logDir', '-l', required=False, help='the path of logDir for loaded experiment') | |||
parser_load_experiment.add_argument('--searchSpacePath', '-s', required=True, help='the path of search space file for \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some experiments do not have search space.
Even for the experiment with search space, can we just load search space file to codeDir by default? If there is an naming conflict loading search space into codeDir, then we report error and ask use to specify --searchSpacePath.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
tools/nni_cmd/nnictl_utils.py
Outdated
search_space_path = nni_config.get_config('experimentConfig').get('searchSpacePath') | ||
if search_space_path: | ||
if not os.path.exists(search_space_path): | ||
print_error('search space %s does not exist!' % search_space_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning might be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
No description provided.