Unverified Commit e25ffbda authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Merge pull request #141 from Microsoft/master

merge master
parents 17e719e0 7d91796c
......@@ -168,18 +168,13 @@ install-dependencies: $(NNI_NODE_TARBALL) $(NNI_YARN_TARBALL)
.PHONY: install-python-modules
install-python-modules:
#$(_INFO) Installing Python SDK $(_END)
cd src/sdk/pynni && sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && $(PIP_INSTALL) $(PIP_MODE) .
#$(_INFO) Installing nnictl $(_END)
cd tools && sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && $(PIP_INSTALL) $(PIP_MODE) .
sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && $(PIP_INSTALL) $(PIP_MODE) .
.PHONY: dev-install-python-modules
dev-install-python-modules:
#$(_INFO) Installing Python SDK $(_END)
cd src/sdk/pynni && sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && $(PIP_INSTALL) $(PIP_MODE) -e .
sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && $(PIP_INSTALL) $(PIP_MODE) .
#$(_INFO) Installing nnictl $(_END)
cd tools && sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && $(PIP_INSTALL) $(PIP_MODE) -e .
.PHONY: install-node-modules
install-node-modules:
......
trigger:
- master
- dev-remote-ci
jobs:
- job: 'Ubuntu_16_04'
pool: 'NNI CI GPU'
- job: 'basic_test_pr_ubuntu'
pool:
vmImage: 'Ubuntu 16.04'
strategy:
matrix:
Python36:
PYTHON_VERSION: '3.6'
steps:
- script: python3 -m pip install --upgrade pip setuptools --user
......@@ -12,15 +13,6 @@ jobs:
- script: |
source install.sh
displayName: 'Install nni toolkit via source code'
- script: |
python3 -m pip install scikit-learn==0.20.0 --user
python3 -m pip install torch==0.4.1 --user
python3 -m pip install torchvision==0.2.1 --user
python3 -m pip install keras==2.1.6 --user
python3 -m pip install tensorflow-gpu==1.10.0 --user
sudo apt-get install swig -y
nnictl package install --name=SMAC
displayName: 'Install dependencies for integration tests'
- script: |
cd test
source unittest.sh
......@@ -33,16 +25,12 @@ jobs:
cd test
PATH=$HOME/.local/bin:$PATH python3 tuner_test.py
displayName: 'Built-in tuners / assessors tests'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts local --local_gpu
displayName: 'Examples and advanced features tests on local machine'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
displayName: 'Trial job metrics test'
- job: 'macOS_10_13'
- job: 'basic_test_pr_macOS'
pool:
vmImage: 'macOS 10.13'
strategy:
......
......@@ -68,5 +68,10 @@ setup(
cmdclass={
'install': CustomInstallCommand
},
entry_points = {
'console_scripts' : [
'nnictl = nni_cmd.nnictl:parse_args'
]
}
)
......@@ -137,7 +137,7 @@ class Logger {
private log(level: string, param: any[]): void {
const buffer: WritableStreamBuffer = new WritableStreamBuffer();
buffer.write(`[${(new Date()).toISOString()}] ${level} `);
buffer.write(`[${(new Date()).toLocaleString()}] ${level} `);
buffer.write(format(param));
buffer.write('\n');
buffer.end();
......
......@@ -25,6 +25,7 @@ from io import TextIOBase
import logging
import os
import sys
import time
def _load_env_args():
......@@ -40,7 +41,7 @@ env_args = _load_env_args()
'''Arguments passed from environment'''
_time_format = '%Y-%m-%d %H:%M:%S'
_time_format = '%m/%d/%Y, %I:%M:%S %P'
class _LoggerFileWrapper(TextIOBase):
def __init__(self, logger_file):
self.file = logger_file
......@@ -64,8 +65,8 @@ def init_logger(logger_file_path):
logger_file_path = os.path.join(env_args.log_dir, logger_file_path)
logger_file = open(logger_file_path, 'w')
fmt = '[%(asctime)s] %(levelname)s (%(name)s/%(threadName)s) %(message)s'
logging.Formatter.converter = time.localtime
formatter = logging.Formatter(fmt, _time_format)
handler = logging.StreamHandler(logger_file)
handler.setFormatter(formatter)
......
......@@ -38,6 +38,7 @@ _logger = logging.getLogger(__name__)
_next_parameter_id = 0
_KEY = 'STEPS'
_epsilon = 1e-6
@unique
class OptimizeMode(Enum):
......@@ -141,8 +142,8 @@ class Bracket():
self.bracket_id = s
self.s_max = s_max
self.eta = eta
self.n = math.ceil((s_max + 1) * (eta**s) / (s + 1)) # pylint: disable=invalid-name
self.r = math.ceil(R / eta**s) # pylint: disable=invalid-name
self.n = math.ceil((s_max + 1) * (eta**s) / (s + 1) - _epsilon) # pylint: disable=invalid-name
self.r = math.ceil(R / eta**s - _epsilon) # pylint: disable=invalid-name
self.i = 0
self.hyper_configs = [] # [ {id: params}, {}, ... ]
self.configs_perf = [] # [ {id: [seq, acc]}, {}, ... ]
......@@ -157,7 +158,7 @@ class Bracket():
def get_n_r(self):
"""return the values of n and r for the next round"""
return math.floor(self.n / self.eta**self.i), self.r * self.eta**self.i
return math.floor(self.n / self.eta**self.i + _epsilon), self.r * self.eta**self.i
def increase_i(self):
"""i means the ith round. Increase i by 1"""
......@@ -305,7 +306,7 @@ class Hyperband(MsgDispatcherBase):
self.brackets = dict() # dict of Bracket
self.generated_hyper_configs = [] # all the configs waiting for run
self.completed_hyper_configs = [] # all the completed configs
self.s_max = math.floor(math.log(self.R, self.eta))
self.s_max = math.floor(math.log(self.R, self.eta) + _epsilon)
self.curr_s = self.s_max
self.searchspace_json = None
......
jobs:
- job: 'integration_test_local_ubuntu'
steps:
- script: python3 -m pip install --upgrade pip setuptools --user
displayName: 'Install python tools'
- script: |
source install.sh
displayName: 'Install nni toolkit via source code'
- script: |
python3 -m pip install scikit-learn==0.20.0 --user
python3 -m pip install torch==0.4.1 --user
python3 -m pip install torchvision==0.2.1 --user
python3 -m pip install keras==2.1.6 --user
python3 -m pip install tensorflow-gpu==1.10.0 --user
sudo apt-get install swig -y
nnictl package install --name=SMAC
displayName: 'Install dependencies for integration tests'
- script: |
cd test
source unittest.sh
displayName: 'Unit test'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 naive_test.py
displayName: 'Naive test'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 tuner_test.py
displayName: 'Built-in tuners / assessors tests'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts local --local_gpu
displayName: 'Examples and advanced features tests on local machine'
- script: |
cd test
PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
displayName: 'Trial job metrics test'
#!/bin/bash
set -e
CWD=${PWD}
# -------------For python unittest-------------
......
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