This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[nas] fix issue introduced by the trial recovery feature #5109
Merged
Louis-J
merged 92 commits into
microsoft:master
from
QuanluZhang:dev-new-nas-experiment
Oct 12, 2022
Merged
Changes from 85 commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
e766a22
update
QuanluZhang 0a39a09
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang e074967
update
QuanluZhang 1f4eeea
update
QuanluZhang b9c788b
update
QuanluZhang 1e97e04
update
QuanluZhang c4be6d5
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 9e39e92
runnable
QuanluZhang 6ebd774
update
QuanluZhang 81ff246
update
QuanluZhang 5d3e681
fix pylint
QuanluZhang 9c580d5
fix pyright
QuanluZhang 1c2f6de
update
QuanluZhang 5086e0a
fix pyright
QuanluZhang db9f4e4
update
QuanluZhang 9097175
minor
QuanluZhang 879aa56
minor
QuanluZhang 1d723ad
update
QuanluZhang 3d9e10c
resolve some comments
QuanluZhang a8c15ea
resolve comments
QuanluZhang 05d71fe
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 5f4b32c
minor
QuanluZhang 6743fa7
pyright
QuanluZhang aa85f16
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang d1ea7f5
fix ut
QuanluZhang a3b55c2
minor
QuanluZhang f895116
fix cgo pipe
QuanluZhang 33fd0b0
refactor
QuanluZhang 7609983
fix pylint
QuanluZhang c51a520
minor
QuanluZhang 7edef1a
fix pyright
QuanluZhang 644cc72
resolve comments
QuanluZhang d610d43
resolve all the comments
QuanluZhang 42824fd
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 6e9ca35
add comment
QuanluZhang 3e4a84a
fix bug
QuanluZhang b6876eb
remove print
QuanluZhang 1055399
remove trailing whitespace
QuanluZhang 874d19b
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang aaab676
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang e0be690
fix not exist issue
QuanluZhang 811e44e
add unittest
QuanluZhang bc849a1
add one more test
QuanluZhang 2fbc261
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 77ae20b
resolve comments
QuanluZhang b664a0a
update
QuanluZhang ecf87c3
fix pipeline
QuanluZhang 49fa868
add timeout for one test
QuanluZhang 8d44079
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang fc99b43
release note
QuanluZhang a94cdf9
resolve comments
QuanluZhang 11e458d
Merge branch 'v2.8' of github.com:microsoft/nni into dev-new-nas-expe…
QuanluZhang 57a03f7
add doc links
QuanluZhang 09ba2c5
update
QuanluZhang ad4e90e
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 72f3ff8
nas experiment view
QuanluZhang e0342eb
minor
QuanluZhang 99374f3
support nas experiment resume
QuanluZhang cbaad0f
fix pylint
QuanluZhang 0abe5a3
finish main functionality
QuanluZhang 811ade7
fix pylint
QuanluZhang 7b2d042
fix pyright
QuanluZhang 6e2019c
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 36103d8
update
QuanluZhang 12334d6
resolve comments
QuanluZhang 49b1dc4
minor
QuanluZhang adf87a8
add ut
QuanluZhang 6ecfd3a
minor
QuanluZhang 8f20b2f
fix pylint
QuanluZhang ece0771
fix ut
QuanluZhang bb71804
fix ut
QuanluZhang 3185609
minor
QuanluZhang 0b4cc96
resolve comments
QuanluZhang e520c0d
resolve comments
QuanluZhang a6cb74d
fix pylint
QuanluZhang e6f0fea
resolve comments
QuanluZhang f4faa73
move test
QuanluZhang 7572627
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang eab49a6
fix bug and add doc
QuanluZhang bccb126
resolve comment
QuanluZhang 2b8d58e
Merge branch 'master' of github.com:microsoft/nni into dev-new-nas-ex…
QuanluZhang 4d17783
fix issue
QuanluZhang 097a781
fix
QuanluZhang ca4d86d
update
QuanluZhang eadfeb9
minor
QuanluZhang 2439a57
fix pylint
QuanluZhang c17256d
fix bug
QuanluZhang 7d905ec
resolve comments
QuanluZhang e679b4a
quick fix
QuanluZhang b115deb
fix incomplete test data
QuanluZhang abf7116
Merge branch 'master' of https://github.com/microsoft/nni into dev-ne…
QuanluZhang ef10426
fix test of cgo engine
QuanluZhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -6,12 +6,16 @@ | |
'_advisor' # FIXME: hack to make it importable for tests | ||
] | ||
|
||
import logging | ||
import time | ||
import warnings | ||
from typing import NewType, Any | ||
|
||
import nni | ||
from nni.common.version import version_check | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
# NOTE: this is only for passing flake8, we cannot import RetiariiAdvisor | ||
# because it would induce cycled import | ||
RetiariiAdvisor = NewType('RetiariiAdvisor', Any) | ||
|
@@ -41,7 +45,11 @@ def send_trial(parameters: dict, placement_constraint=None) -> int: | |
Send a new trial. Executed on tuner end. | ||
Return a ID that is the unique identifier for this trial. | ||
""" | ||
return get_advisor().send_trial(parameters, placement_constraint) | ||
advisor = get_advisor() | ||
while not advisor.initialized: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest putting this into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
_logger.info('Wait for RetiariiAdvisor to be initialized...') | ||
time.sleep(0.5) | ||
return advisor.send_trial(parameters, placement_constraint) | ||
|
||
def receive_trial_parameters() -> dict: | ||
""" | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is it possible that
handld_add_customized_trial
is never called and_advisor_initialized
is never set to true?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.
good point!
handle_add_customized_trial
is called when experiment is resumed (even no trial should be recovered), but will not be called when experiment is created, this is a bug introduced by me...I moved this flag to
handle_request_trial_jobs
, which means if trial is not requested,send_trial
will be blocked. And "request trial" will always be sent by nnimanager