Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Fix dispatcher log (#1869)
Browse files Browse the repository at this point in the history
  • Loading branch information
chicm-ms authored Dec 23, 2019
1 parent 9cbbf6f commit f9580cd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ class NNIManager implements Manager {
}

const nniEnv = {
SDK_PROCESS: 'dispatcher',
NNI_MODE: mode,
NNI_CHECKPOINT_DIRECTORY: dataDirectory,
NNI_LOG_DIRECTORY: getLogDir(),
Expand Down
9 changes: 6 additions & 3 deletions src/sdk/pynni/nni/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

from .trial import *
from .smartparam import *
from .nas_utils import training_update
from .env_vars import dispatcher_env_vars

if dispatcher_env_vars.SDK_PROCESS != 'dispatcher':
from .trial import *
from .smartparam import *
from .nas_utils import training_update

class NoMoreTrialError(Exception):
def __init__(self, ErrorInfo):
Expand Down
1 change: 1 addition & 0 deletions src/sdk/pynni/nni/env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
]

_dispatcher_env_var_names = [
'SDK_PROCESS',
'NNI_MODE',
'NNI_CHECKPOINT_DIRECTORY',
'NNI_LOG_DIRECTORY',
Expand Down
2 changes: 0 additions & 2 deletions src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import hyperopt as hp
import numpy as np
from nni.tuner import Tuner
from nni.nas_utils import rewrite_nas_space
from nni.utils import NodeType, OptimizeMode, extract_scalar_reward, split_index

logger = logging.getLogger('hyperopt_AutoML')
Expand Down Expand Up @@ -226,7 +225,6 @@ def _choose_tuner(self, algorithm_name):
return hp.anneal.suggest
raise RuntimeError('Not support tuner algorithm in hyperopt.')

@rewrite_nas_space
def update_search_space(self, search_space):
"""
Update search space definition in tuner by search_space in parameters.
Expand Down
4 changes: 3 additions & 1 deletion src/sdk/pynni/nni/platform/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

from ..env_vars import trial_env_vars
from ..env_vars import trial_env_vars, dispatcher_env_vars

assert dispatcher_env_vars.SDK_PROCESS != 'dispatcher'

if trial_env_vars.NNI_PLATFORM is None:
from .standalone import *
Expand Down

0 comments on commit f9580cd

Please sign in to comment.