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

Fixed CI build issues #2

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ language: python
python:
- "3.6"
before_install:
- sudo apt-get install -y python3-pip python3-setuptools
- wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz
- tar xf node-v10.9.0-linux-x64.tar.xz
- sudo mv node-v10.9.0-linux-x64 /usr/local/node
- export PATH=/usr/local/node/bin:$PATH
install:
- make
- sudo make dev-install
- make install
- export PATH=$HOME/.nni/bin:$PATH
before_script:
- cd test/naive
script:
- python run.py
- python3 run.py
39 changes: 18 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
BIN_PATH ?= /usr/bin
NODE_PATH ?= /usr/share
EXAMPLE_PATH ?= /usr/share/nni/examples
BIN_PATH ?= $(HOME)/.nni/bin/
NNI_PATH ?= $(HOME)/.nni/

SRC_DIR := ${PWD}

Expand All @@ -21,33 +20,33 @@ build:


install:
mkdir -p $(NODE_PATH)/nni
mkdir -p $(EXAMPLE_PATH)
mkdir -p $(NNI_PATH)
mkdir -p $(BIN_PATH)

### Installing NNI Manager ###
cp -rT src/nni_manager/dist $(NODE_PATH)/nni/nni_manager
cp -rT src/nni_manager/node_modules $(NODE_PATH)/nni/nni_manager/node_modules
cp -rT src/nni_manager/dist $(NNI_PATH)nni_manager
cp -rT src/nni_manager/node_modules $(NNI_PATH)nni_manager/node_modules

### Installing Web UI ###
cp -rT src/webui/build $(NODE_PATH)/nni/webui
ln -sf $(NODE_PATH)/nni/nni_manager/node_modules/serve/bin/serve.js $(BIN_PATH)/serve
cp -rT src/webui/build $(NNI_PATH)webui
ln -sf $(NNI_PATH)nni_manager/node_modules/serve/bin/serve.js $(BIN_PATH)serve

### Installing Python SDK dependencies ###
pip3 install -r src/sdk/pynni/requirements.txt
### Installing Python SDK ###
cd src/sdk/pynni && python3 setup.py install
cd src/sdk/pynni && pip3 install -e .

### Installing nnictl ###
cd tools && python3 setup.py install
cd tools && pip3 install -e .

echo '#!/bin/sh' > $(BIN_PATH)/nnimanager
echo 'cd $(NODE_PATH)/nni/nni_manager && node main.js $$@' >> $(BIN_PATH)/nnimanager
chmod +x $(BIN_PATH)/nnimanager
echo '#!/bin/sh' > $(BIN_PATH)nnimanager
echo 'cd $(NNI_PATH)nni_manager && node main.js $$@' >> $(BIN_PATH)nnimanager
chmod +x $(BIN_PATH)nnimanager

install -m 755 tools/nnictl $(BIN_PATH)/nnictl
install -m 755 tools/nnictl $(BIN_PATH)nnictl

### Installing examples ###
cp -rT examples $(EXAMPLE_PATH)
cp -rT examples $(NNI_PATH)examples


dev-install:
Expand All @@ -61,10 +60,8 @@ dev-install:


uninstall:
-rm -r $(EXAMPLE_PATH)
-rm -r $(NODE_PATH)/nni
-rm -r $(NNI_PATH)
-rm -r $(BIN_PATH)
-pip3 uninstall -y nnictl
-pip3 uninstall -y nni
-rm $(BIN_PATH)/nnictl
-rm $(BIN_PATH)/nnimanager
-rm $(BIN_PATH)/serve

4 changes: 2 additions & 2 deletions docs/EnableAssessor.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ assessor:
optimizationMode: Maximize
trial:
trialCommand: python mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-annotation
trialCodeDir: $HOME/.nni/examples/trials/mnist-annotation
trialGpuNum: 0
```
For our built-in assessors, you need to fill two fields: `assessorName` which chooses NNI provided assessors (refer to [here]() for built-in assessors), `optimizationMode` which includes Maximize and Minimize (you want to maximize or minimize your trial result).
Expand Down Expand Up @@ -54,7 +54,7 @@ assessor:
assessorGpuNum: 0
trial:
trialCommand: python mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-annotation
trialCodeDir: $HOME/.nni/examples/trials/mnist-annotation
trialGpuNum: 0
```
You only need to fill three field: `assessorCommand`, `assessorCodeDir` and `assessorGpuNum`.
12 changes: 6 additions & 6 deletions docs/GetStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Requirements:

Run the following command to create an experiemnt for [mnist]
```bash
nnictl create --config /usr/share/nni/examples/trials/mnist-annotation/config.yaml
nnictl create --config $HOME/.nni/examples/trials/mnist-annotation/config.yaml
```
This command will start the experiment and WebUI. The WebUI endpoint will be shown in the output of this command (for example, `http://localhost:8080`). Open this URL using your browsers. You can analyze your experiment through WebUI, or open trials' tensorboard.

Expand All @@ -69,9 +69,9 @@ An experiment is to run multiple trial jobs, each trial job tries a configuratio
* Provide a yaml experiment configure file
* (optional) Provide or choose an assessor

**Prepare trial**: Let's use a simple trial example, e.g. mnist, provided by NNI. After you installed NNI, NNI examples have been put in /usr/share/nni/examples, run `ls /usr/share/nni/examples/trials` to see all the trial examples. You can simply execute the following command to run the NNI mnist example:
**Prepare trial**: Let's use a simple trial example, e.g. mnist, provided by NNI. After you installed NNI, NNI examples have been put in $HOME/.nni/examples, run `ls $HOME/.nni/examples/trials` to see all the trial examples. You can simply execute the following command to run the NNI mnist example:

python /usr/share/nni/examples/trials/mnist-annotation/mnist.py
python $HOME/.nni/examples/trials/mnist-annotation/mnist.py

This command will be filled in the yaml configure file below. Please refer to [here]() for how to write your own trial.

Expand All @@ -82,7 +82,7 @@ This command will be filled in the yaml configure file below. Please refer to [h

*tunerName* is used to specify a tuner in NNI, *optimizationMode* is to indicate whether you want to maximize or minimize your trial's result.

**Prepare configure file**: Since you have already known which trial code you are going to run and which tuner you are going to use, it is time to prepare the yaml configure file. NNI provides a demo configure file for each trial example, `cat /usr/share/nni/examples/trials/mnist-annotation/config.yaml` to see it. Its content is basically shown below:
**Prepare configure file**: Since you have already known which trial code you are going to run and which tuner you are going to use, it is time to prepare the yaml configure file. NNI provides a demo configure file for each trial example, `cat $HOME/.nni/examples/trials/mnist-annotation/config.yaml` to see it. Its content is basically shown below:

```
authorName: your_name
Expand All @@ -102,15 +102,15 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-annotation
trialCodeDir: $HOME/.nni/examples/trials/mnist-annotation
trialGpuNum: 0
```

Here *useAnnotation* is true because this trial example uses our python annotation (refer to [here]() for details). For trial, we should provide *trialCommand* which is the command to run the trial, provide *trialCodeDir* where the trial code is. The command will be executed in this directory. We should also provide how many GPUs a trial requires.

With all these steps done, we can run the experiment with the following command:

nnictl create --config /usr/share/nni/examples/trials/mnist-annotation/config.yaml
nnictl create --config $HOME/.nni/examples/trials/mnist-annotation/config.yaml

You can refer to [here](NNICTLDOC.md) for more usage guide of *nnictl* command line tool.

Expand Down
2 changes: 1 addition & 1 deletion docs/RemoteMachineMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-annotation
trialCodeDir: $HOME/.nni/examples/trials/mnist-annotation
trialGpuNum: 0
#machineList can be empty if the platform is local
machineList:
Expand Down
4 changes: 2 additions & 2 deletions examples/trials/cifar10/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ maxExecDuration: 1h
maxTrialNum: 1
#choice: local, remote
trainingServicePlatform: local
searchSpacePath: /usr/share/nni/examples/trials/cifar10/search_space.json
searchSpacePath: $HOME/.nni/examples/trials/cifar10/search_space.json
#choice: true, false
useAnnotation: false
tuner:
Expand All @@ -15,5 +15,5 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python3 cifar10.py
trialCodeDir: /usr/share/nni/examples/trials/cifar10
trialCodeDir: $HOME/.nni/examples/trials/cifar10
trialGpuNum: 0
4 changes: 2 additions & 2 deletions examples/trials/ga_squad/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ trainingServicePlatform: local
useAnnotation: false
tuner:
tunerCommand: python3 __main__.py
tunerCwd: /usr/share/nni/examples/tuners/ga_customer_tuner
tunerCwd: $HOME/.nni/examples/tuners/ga_customer_tuner
trial:
trialCommand: python3 trial.py
trialCodeDir: /usr/share/nni/examples/trials/ga_squad
trialCodeDir: $HOME/.nni/examples/trials/ga_squad
trialGpuNum: 0
2 changes: 1 addition & 1 deletion examples/trials/mnist-annotation/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python3 mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-annotation
trialCodeDir: $HOME/.nni/examples/trials/mnist-annotation
trialGpuNum: 0
4 changes: 2 additions & 2 deletions examples/trials/mnist-keras/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ maxExecDuration: 1h
maxTrialNum: 1
#choice: local, remote
trainingServicePlatform: local
searchSpacePath: /usr/share/nni/examples/trials/mnist-keras/search_space.json
searchSpacePath: $HOME/.nni/examples/trials/mnist-keras/search_space.json
#choice: true, false
useAnnotation: false
tuner:
Expand All @@ -15,5 +15,5 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python3 mnist-keras.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-keras
trialCodeDir: $HOME/.nni/examples/trials/mnist-keras
trialGpuNum: 0
2 changes: 1 addition & 1 deletion examples/trials/mnist-smartparam/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python3 mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist-smartparam
trialCodeDir: $HOME/.nni/examples/trials/mnist-smartparam
trialGpuNum: 0
4 changes: 2 additions & 2 deletions examples/trials/mnist/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ maxExecDuration: 1h
maxTrialNum: 1
#choice: local, remote
trainingServicePlatform: local
searchSpacePath: /usr/share/nni/examples/trials/mnist/search_space.json
searchSpacePath: $HOME/.nni/examples/trials/mnist/search_space.json
#choice: true, false
useAnnotation: false
tuner:
Expand All @@ -15,5 +15,5 @@ tuner:
optimizationMode: Maximize
trial:
trialCommand: python3 mnist.py
trialCodeDir: /usr/share/nni/examples/trials/mnist
trialCodeDir: $HOME/.nni/examples/trials/mnist
trialGpuNum: 0
2 changes: 1 addition & 1 deletion tools/nnicmd/webui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def start_web_ui(port):
'''start web ui'''
cmds = ['serve', '-s', '-n', '/usr/share/nni/webui', '-l', str(port)]
cmds = ['serve', '-s', '-n', '$HOME/.nni/webui', '-l', str(port)]
stdout_file = open(STDOUT_FULL_PATH, 'a+')
stderr_file = open(STDERR_FULL_PATH, 'a+')
webui_process = Popen(cmds, stdout=stdout_file, stderr=stderr_file)
Expand Down
3 changes: 2 additions & 1 deletion tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
install_requires = [
'requests',
'pyyaml',
'psutil'
'psutil',
'astor'
],

author = 'Microsoft NNI Team',
Expand Down