Commit 252f36f8 authored by Deshui Yu's avatar Deshui Yu
Browse files

NNI dogfood version 1

parent 781cea26
.user{
background: rgb(236,240,245);
overflow: hidden;
}
.userCon{
width: 100%;
padding-left: 30px;
box-sizing: border-box;
}
/* add job */
.addtrial{
width: 100%;
}
div.addtitle{
height: 64px;
text-align: center;
line-height: 64px;
margin-top: 16px;
color: #333;
font-size: 20px;
}
/* textarea margin 0 auto */
.userInput{
width: 80%;
margin: 0 auto;
color: #333;
}
#userInputJob, #InputUpdate{
color: #333;
}
/* two btn style */
.addBtubox{
width: 80%;
height: 30px;
margin: 0 auto;
margin-top: 10px;
}
.addBtubox Button{
float: right;
height: 30px;
color: #fff;
background-color: #3c8dbc;
border-color: #3c8dbc;
}
.addBtubox Button:hover, .addBtubox Button:focus{
background-color: #3c8dbc;
border-color: #3c8dbc;
}
/* add job btn style end */
.updatesear{
line-height: 64px;
text-align: center;
margin-top: 16px;
color: #333;
font-size: 20px;
}
.line{
font-weight: bold;
color: rgb(60,141,188);
padding-right: 20px;
}
/* search box style */
.searchbox{
width: 100%;
}
\ No newline at end of file
.log{
width: 98%;
margin: 10px auto;
}
.log pre{
white-space: pre-wrap;
color: #333;
border: 1px solid #e8e8e8;
border-top: none;
margin-top: -17px;
padding: 14px;
}
.marginTab{
margin-right: 5px;
}
.pai{
position: fixed;
top: 16px;
right: 1%;
}
\ No newline at end of file
.para{
margin-top: 50px;
}
.paraCon{
width: 80%;
margin: 0 auto;
border: 2px solid #ccc;
box-shadow: 0px 2px 0px rgba(204,204,204,.8);
}
.paraTitle{
width: 100%;
height: 60px;
padding-left: 20px;
padding-right: 20px;
line-height: 60px;
font-size: 20px;
color: #333;
border-bottom: 1px solid #ccc;
}
.paraLeft{
float: left;
}
.paraRight{
float: right;
width: 60%;
}
.paraRight .parapercent{
margin-right: 10px;
}
/* user exchange search space yAxis */
.paraExchange{
width: 100%;
height: 60px;
padding-left: 20px;
padding-right: 20px;
line-height: 60px;
font-size: 20px;
color: #333;
}
Button.changeBtu, Button.changeBtu:hover, Button.changeBtu:focus{
background-color: #3c8dbc;
border-color: #3c8dbc;
}
.paraGra{
position: relative;
}
.paraGra .paraNodata{
position: absolute;
left: 49%;
top: 2.5%;
font-size: 13px;
color: rgba(0, 0, 0, 0.45)
}
\ No newline at end of file
.session {
width: 98%;
margin: 30px auto;
}
.headRow{
border: 1px solid red;
}
.boxLitt{
border-right: 1px solid #eee;
}
.box1 b{
font-size: 18px;
color: #333;
}
.box1 span{
margin-left: 10px;
font-size: 16px;
/* color: #999; */
}
/* long long ago */
.session .head{
width: 100%;
height: 120px;
margin: 0 auto;
margin-bottom: 10px;
}
.headCon{
margin: 0 auto;
}
.session .head .headCon>div{
float: left;
width: 17%;
min-width: 230px;
height: 120px;
margin-right: 1.4%;
margin-bottom: 10px;
}
.session .head .headCon>div>div:first-child{
float: left;
width: 50%;
}
.session .head .headCon>div>div:last-child{
float: right;
width: 50%;
}
.session .head .headCon>div .message{
width: 30px;
height: 100%;
margin: 0 auto;
padding-left: 6px;
box-sizing: border-box;
}
.runtime{
padding-left: 6px;
box-sizing: border-box;
}
/* trial profile author id ... */
.message span, .message p{
color: #999;
font-size: 14px;
}
.proKey {
padding-top: 16px;
padding-bottom: 10px;
color: #999;
}
.proTime{
padding-top: 16px;
}
.message .trialNum{
padding-top: 32px;
}
.session .head .headCon>div .logo{
width: 100%;
height: 100%;
}
.session .head .headCon>div .logo i{
width: 60px;
height: 60px;
line-height: 60px;
margin-left: 38%;
margin-top: 19%;
font-size: 38px;
border-radius: 50%;
}
/* logo color backcolor */
.tyellow{
color: #FAE5B6;
border: 2px solid #FAE5B6;
}
.bone {
color: #9DC6E0;
border: 2px solid #9DC6E0;
}
.thrpink{
color: #F4C3C6;
border: 2px solid #F4C3C6;
}
.fogreen{
color: #B2E7CF;
border: 2px solid #B2E7CF;
}
/* four block color backcolor */
.session .head .author{
background: #CEE8F7;
border:2px solid #B1D6E8;
}
.session .head .type{
background: #FCF5DB;
border:2px solid #F4EAC6;
}
.session .head .runtime{
background: #FCDEE3;
border:2px solid #F4C3C6;
}
.session .head .cdf{
background: #DAF6E8;
border:2px solid #CAEEDD;
margin-right: 0;
}
.messcont{
padding-left: 10px;
font-size: 14px;
}
.searchTitle {
/* font-size: 30px; */
color: #333;
margin-top: 15px;
}
.jsonbox>div{
float: left;
width: 45%;
}
.jsonbox>div:first-child{
margin-right: 8%;
}
.jsonbox .trialProfile{
height: 246px;
}
.clear{
clear: both;
}
.searchSpace{
height: 246px;
}
.searchSpace, .trialProfile{
padding: 5px;
border: 1px solid white;
border-radius: 15px;
background-color: rgba(60,141,188,.1);
}
.jsontree ul, .jsontree ul li{
background: none !important;
}
.selectInline{
margin-bottom: 15px;
}
.selectItem{
display: inline;
padding-right: 8px;
}
.ant-select{
width: 90px;
}
#description {
text-align: left;
}
/* react-json-view background */
#description ul, #description ul li{
background: none !important;
}
.comtable{
width: 100%;
border: 1px solid #ccc;
padding: 23px 24px 5px 24px;
margin-bottom: 30px;
}
.tabuser1, .tabuser2{
color: #333;
}
.tabuser1, .tabuser2{
margin-right: 8px;
}
.cdf{
width: 100%;
border: 1px solid #ccc;
}
.cdf>div:first-child{
position: relative;
}
.cdf .addNodata{
position: absolute;
left: 48.5%;
top: 75%;
font-size: 13px;
color: rgba(0, 0, 0, 0.45)
}
\ No newline at end of file
.slider{
position: fixed;
top: 60px;
left: 0;
background: #222d32;
border-right: 1px solid #ccc;
width: 250px;
height: calc(100% - (60px));
z-index: 1000;
}
.nav{
list-style: none;
width: 100%;
margin: 0;
padding: 0;
}
.nav li{
width: 100%;
height: 40px;
line-height: 40px;
border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav .icon{
padding-left: 13px;
padding-right: 13px;
}
.nav .floicon {
font-size: 16px;
float: right;
margin-right: 10px;
line-height: 40px;
}
.nav li a{
display: block;
width: 100%;
height: 40px;
line-height: 40px;
font-size: 16px;
text-decoration: none;
color: #b8c7ce;
}
.nav li a:hover{
color: white;
background: #1e282c;
}
.nav .high{
color: white;
background: #1e282c;
}
\ No newline at end of file
/* iframe include tensorborad page */
.tensor{
width: 98%;
height: 800px;
margin: 25px auto;
}
.tensor .title{
color: #333;
font-size: 16px;
}
.tensor iframe{
width: 100%;
height: 840px;
border: none;
margin-top: 10px;
}
\ No newline at end of file
.hyper{
width: 98%;
margin: 30px auto;
}
.rungraph{
width: 100%;
}
/* add the brother selector to increase the priority */
#tableCenter .tables th, #session .tables th{
background: rgb(217,222,228);
/* the center of the table title */
text-align: center;
font-weight: 700;
}
#tableCenter .tables tr, #session .tables tr{
text-align: center;
color:#333;
}
pre.hyperpar{
text-align: left;
}
.tables{
width: 100%;
}
/* the color of id */
#tableCenter .tables .ant-table-thead .tableHead>span{
color: #333;
}
/* the position of the pagination */
.ant-table-pagination.ant-pagination{
margin: 16px 0;
float: right;
margin-right: 30px;
}
/* the pagination of next and prev */
.ant-pagination-prev .ant-pagination-item-link:after{
content: "Previous";
display: block;
font-size: 14px;
color: #333;
padding-left: 5px;
padding-right: 5px;
}
.ant-pagination-next .ant-pagination-item-link:after {
content: "NEXT";
display: block;
font-size: 14px;
color: #333;
padding-left: 5px;
padding-right: 5px;
}
Button.tableButton{
background: #3c8dbc;
border-color: #3c8dbc;
height: 26px;
line-height: 26px;
/* padding: 3px 4px; */
}
/* status bgcolor */
.commonStyle{
border-radius: 3px;
color: white;
}
.RUNNING{
padding: 3px 8px;
background: #3c8dbc;
}
.FAILED{
padding: 3px 24px;
background: #dd4b39;
}
.USER_CANCELED{
padding: 3px 8px;
background: #FF4500;
}
.SUCCEEDED{
padding: 3px 6px;
background: #00a65a;
}
.UNKNOWN{
padding: 3px 15px;
background: #FF8C00;
}
.SYS_CANCELED{
padding: 3px 24px;
background: red;
}
.WAITING{
padding: 3px 24px;
background: #008B8B;
}
.hyperpar ul, .hyperpar ul li{
background: none !important;
}
/* kill btn style: delete its own hover style */
/* after button click the color not change */
Button.tableButton:hover, Button.tableButton:focus{
background-color: #3c8dbc;
border-color: #3c8dbc;
}
{
"compilerOptions": {
"outDir": "build/dist",
"module": "esnext",
"target": "esnext",
"lib": [
"esnext",
"dom"
],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"baseUrl": "."
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
\ No newline at end of file
{
"extends": "./tsconfig.json"
}
\ No newline at end of file
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs"
}
}
\ No newline at end of file
{
"extends": [
"tslint-react"
],
"rules": {
"align": [
true,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": false,
"forin": true,
"indent": [
true,
"spaces"
],
"interface-name": [
true,
"never-prefix"
],
"jsdoc-format": true,
"jsx-no-lambda": false,
"jsx-no-multiline-js": false,
"label-position": true,
"max-line-length": [
true,
120
],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-any": true,
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"log",
"error",
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-consecutive-blank-lines": true,
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": false,
"no-unused-expression": true,
"no-use-before-declare": true,
"one-line": [
true,
"check-catch",
"check-else",
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"single",
"jsx-double"
],
"radix": true,
"semicolon": [
true,
"always"
],
"switch-default": true,
"trailing-comma": [
false
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef": [
true,
"parameter",
"property-declaration"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-module",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
1 1
2 7
3 2
5 3
7 2
8 3
DONE
4 1048576
6 60466176
9 3486784401
10 10000000000
DONE
authorName: nni
experimentName: naive
trialConcurrency: 3
maxExecDuration: 1h
maxTrialNum: 10
#choice: local, remote
trainingServicePlatform: local
searchSpacePath: search_space.json
#choice: true, false
useAnnotation: false
tuner:
tunerCommand: python naive_tuner.py
tunerCwd: .
tunerGpuNum: 0
assessor:
assessorCommand: python naive_assessor.py
assessorCwd: .
assessorGpuNum: 0
trial:
trialCommand: python naive_trial.py
trialCodeDir: .
trialGpuNum: 0
#machineList can be empty if the platform is local
machineList:
- ip:
port:
username:
passwd:
import logging
from nni.assessor import Assessor, AssessResult
_logger = logging.getLogger('NaiveAssessor')
_logger.info('start')
_result = open('assessor_result.txt', 'w')
class NaiveAssessor(Assessor):
def __init__(self):
self._killed = set()
_logger.info('init')
def assess_trial(self, trial_job_id, trial_history):
_logger.info('assess trial %s %s' % (trial_job_id, trial_history))
id_ = trial_history[0]
if id_ in self._killed:
return AssessResult.Bad
s = 0
for i, val in enumerate(trial_history):
s += val
if s % 11 == 1:
self._killed.add(id_)
_result.write('%d %d\n' % (id_, i + 1))
_result.flush()
return AssessResult.Bad
return AssessResult.Good
try:
NaiveAssessor().run()
_result.write('DONE\n')
except Exception as e:
_logger.exception(e)
_result.write('ERROR\n')
_result.close()
import time
import nni
params = nni.get_parameters()
print('params:', params)
x = params['x']
for i in range(1, 10):
nni.report_intermediate_result(x ** i)
time.sleep(0.5)
nni.report_final_result(x ** 10)
import json
import logging
from nni.tuner import Tuner
_logger = logging.getLogger('NaiveTuner')
_logger.info('start')
_result = open('tuner_result.txt', 'w')
class NaiveTuner(Tuner):
def __init__(self):
self.cur = 0
_logger.info('init')
def generate_parameters(self, parameter_id):
self.cur += 1
_logger.info('generate parameters: %s' % self.cur)
return { 'x': self.cur }
def receive_trial_result(self, parameter_id, parameters, reward):
_logger.info('receive trial result: %s, %s, %s' % (parameter_id, parameters, reward))
_result.write('%d %d\n' % (parameters['x'], reward))
_result.flush()
def update_search_space(self, search_space):
_logger.info('update_search_space: %s' % search_space)
with open('tuner_search_space.json', 'w') as file_:
json.dump(search_space, file_)
try:
NaiveTuner().run()
_result.write('DONE\n')
except Exception as e:
_logger.exception(e)
_result.write('ERROR\n')
_result.close()
#!/bin/sh
python3 -m nnicmd.nnictl $@
#!/bin/sh
cd ../../src/nni_manager && node dist/main.js $@
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