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

Commit

Permalink
Manually cherry-pick bug fix PRs (#4532)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhe-lz authored Feb 18, 2022
1 parent 0d3802a commit 4e33e43
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 21 deletions.
3 changes: 2 additions & 1 deletion dependencies/required.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ json_tricks >= 3.15.5
psutil
pyyaml >= 5.4
requests
responses
responses ; python_version >= "3.7"
responses < 0.18 ; python_version < "3.7"
schema
typeguard
PythonWebHDFS
Expand Down
4 changes: 2 additions & 2 deletions dependencies/required_extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ConfigSpaceNNI
smac4nni

# BOHB
ConfigSpace==0.4.11
statsmodels==0.12.0
ConfigSpace>=0.4.11
statsmodels>=0.12.0

# PPOTuner
gym
Expand Down
9 changes: 6 additions & 3 deletions nni/algorithms/hpo/tpe_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from nni.tuner import Tuner
from nni.common.hpo_utils import OptimizeMode, format_search_space, deformat_parameters, format_parameters
from nni.utils import extract_scalar_reward
from . import random_tuner

_logger = logging.getLogger('nni.tuner.tpe')
Expand Down Expand Up @@ -126,9 +127,11 @@ def generate_parameters(self, parameter_id, **kwargs):
self._running_params[parameter_id] = params
return deformat_parameters(params, self.space)

def receive_trial_result(self, parameter_id, _parameters, loss, **kwargs):
if self.optimize_mode is OptimizeMode.Maximize:
loss = -loss
def receive_trial_result(self, parameter_id, _parameters, value, **kwargs):
if self.optimize_mode is OptimizeMode.Minimize:
loss = extract_scalar_reward(value)
else:
loss = -extract_scalar_reward(value)
if self.liar:
self.liar.update(loss)
params = self._running_params.pop(parameter_id)
Expand Down
2 changes: 1 addition & 1 deletion nni/tools/nnictl/ts_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'remote',
'openpai', 'pai',
'aml',
'dlc'
'dlc',
'kubeflow',
'frameworkcontroller',
'adl',
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-aml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
echo "Build docker image: $(build_docker_image)"
python3 -m pip install --upgrade pip setuptools
displayName: Prepare
- script: |
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-hybrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
python3 -m pip install --upgrade pip setuptools
displayName: Prepare
- script: |
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-kubeflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
python3 -m pip install --upgrade pip setuptools
displayName: Prepare
- script: |
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-openpai-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
echo "Build docker image: $(build_docker_image)"
python3 -m pip install --upgrade pip setuptools
displayName: Prepare
- script: |
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-remote-l2l.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
python3 -m pip install --upgrade pip setuptools
displayName: Prepare
- script: |
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-remote-l2w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
echo "Build ID: $(Build.BuildId)"
python3 -m pip install --upgrade pip setuptools
python3 setup.py clean --all
displayName: Prepare on Linux manager
Expand All @@ -44,7 +43,6 @@ jobs:
sshEndpoint: $(worker)
runOptions: commands
commands: |
conda activate l2w & python -m pip install --upgrade pip setuptools
conda activate l2w & python /tmp/nnitest/$(Build.BuildId)/test/vso_tools/install_nni.py $(NNI_RELEASE)
failOnStdErr: false
displayName: Install NNI on Windows worker
Expand Down
2 changes: 0 additions & 2 deletions pipelines/integration-test-trt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
echo "Working directory: ${PWD}"
echo "NNI version: ${NNI_RELEASE}"
python3 -m pip install --upgrade pip setuptools
displayName: Prepare
- script: |
Expand Down
2 changes: 2 additions & 0 deletions test/ut/sdk/test_builtin_tuners.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def receive(*args):
return receive

def send_trial_result(self, tuner, parameter_id, parameters, metrics):
if parameter_id % 2 == 1:
metrics = {'default': metrics, 'extra': 'hello'}
tuner.receive_trial_result(parameter_id, parameters, metrics)
tuner.trial_end(parameter_id, True)

Expand Down

0 comments on commit 4e33e43

Please sign in to comment.