"vscode:/vscode.git/clone" did not exist on "f96e4a16adb4c31bab4c0a3d0d145ed2b086ecb0"
Unverified Commit 6645bd33 authored by QuanluZhang's avatar QuanluZhang Committed by GitHub
Browse files

fix multi-thread issue (#3899)

parent 703f6de5
...@@ -310,6 +310,11 @@ class RetiariiExperiment(Experiment): ...@@ -310,6 +310,11 @@ class RetiariiExperiment(Experiment):
""" """
_logger.info('Stopping experiment, please wait...') _logger.info('Stopping experiment, please wait...')
atexit.unregister(self.stop) atexit.unregister(self.stop)
# stop strategy first
if self._dispatcher_thread is not None:
self._dispatcher.stopping = True
self._dispatcher_thread.join(timeout=1)
if self.id is not None: if self.id is not None:
nni.runtime.log.stop_experiment_log(self.id) nni.runtime.log.stop_experiment_log(self.id)
...@@ -326,9 +331,6 @@ class RetiariiExperiment(Experiment): ...@@ -326,9 +331,6 @@ class RetiariiExperiment(Experiment):
if self._pipe is not None: if self._pipe is not None:
self._pipe.close() self._pipe.close()
if self._dispatcher_thread is not None:
self._dispatcher.stopping = True
self._dispatcher_thread.join(timeout=1)
self.id = None self.id = None
self.port = None self.port = None
......
...@@ -639,8 +639,6 @@ class NNIManager implements Manager { ...@@ -639,8 +639,6 @@ class NNIManager implements Manager {
this.trialConcurrencyChange = requestTrialNum; this.trialConcurrencyChange = requestTrialNum;
} }
this.requestTrialJobs(requestTrialNum);
// check maxtrialnum and maxduration here // check maxtrialnum and maxduration here
// NO_MORE_TRIAL is more like a subset of RUNNING, because during RUNNING tuner // NO_MORE_TRIAL is more like a subset of RUNNING, because during RUNNING tuner
// might tell nnimanager that this is no more trials. In NO_MORE_TRIAL state, the experiment is viewed // might tell nnimanager that this is no more trials. In NO_MORE_TRIAL state, the experiment is viewed
...@@ -665,6 +663,8 @@ class NNIManager implements Manager { ...@@ -665,6 +663,8 @@ class NNIManager implements Manager {
} }
} }
} else { } else {
this.requestTrialJobs(requestTrialNum);
if (this.status.status === 'DONE') { if (this.status.status === 'DONE') {
delete this.experimentProfile.endTime; delete this.experimentProfile.endTime;
await this.storeExperimentProfile(); await this.storeExperimentProfile();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment