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

Commit

Permalink
support conda (#90)
Browse files Browse the repository at this point in the history
* support install from venv and travis CI

* support install from venv and travis CI

* support install from venv and travis CI

* support conda

* support conda

* modify example config path to relative path and increase maxTrialNum

* undo messy commit

* undo messy commit
  • Loading branch information
Crysple authored and QuanluZhang committed Sep 20, 2018
1 parent 45650c4 commit 36edf4c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Setting variables

SHELL := /bin/bash
PIP_INSTALL := python3 -m pip install
PIP_UNINSTALL := python3 -m pip uninstall

## Install directories
ifeq ($(shell id -u), 0) # is root
Expand Down Expand Up @@ -146,8 +148,8 @@ dev-install:

.PHONY: uninstall
uninstall:
-pip3 uninstall -y nni
-pip3 uninstall -y nnictl
-$(PIP_UNINSTALL) -y nni
-$(PIP_UNINSTALL) -y nnictl
-rm -rf $(INSTALL_PREFIX)/nni
-rm -f $(BIN_PATH)/nnimanager
-rm -f $(BIN_PATH)/nnictl
Expand Down Expand Up @@ -222,10 +224,10 @@ install-node-modules:
.PHONY: install-dev-modules
install-dev-modules:
#$(_INFO) Installing Python SDK $(_END)
cd src/sdk/pynni && pip3 install $(PIP_MODE) -e .
cd src/sdk/pynni && $(PIP_INSTALL) $(PIP_MODE) -e .

#$(_INFO) Installing nnictl $(_END)
cd tools && pip3 install $(PIP_MODE) -e .
cd tools && $(PIP_INSTALL) $(PIP_MODE) -e .

mkdir -p $(INSTALL_PREFIX)/nni

Expand Down
4 changes: 0 additions & 4 deletions src/nni_manager/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ function parseArg(names: string[]): string {
function getMsgDispatcherCommand(tuner: any, assessor: any): string {
let command: string = `python3 -m nni --tuner_class_name ${tuner.className}`;

if (process.env.VIRTUAL_ENV) {
command = path.join(process.env.VIRTUAL_ENV, 'bin/') +command;
}

if (tuner.classArgs !== undefined) {
command += ` --tuner_args ${JSON.stringify(JSON.stringify(tuner.classArgs))}`;
}
Expand Down
12 changes: 7 additions & 5 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,16 @@ class NNIManager implements Manager {
newCwd = cwd;
}
// TO DO: add CUDA_VISIBLE_DEVICES
let nniEnv = {
NNI_MODE: mode,
NNI_CHECKPOINT_DIRECTORY: dataDirectory,
NNI_LOG_DIRECTORY: getLogDir()
};
let newEnv = Object.assign({}, process.env, nniEnv);
const tunerProc: ChildProcess = spawn(command, [], {
stdio,
cwd: newCwd,
env: {
NNI_MODE: mode,
NNI_CHECKPOINT_DIRECTORY: dataDirectory,
NNI_LOG_DIRECTORY: getLogDir()
},
env: newEnv,
shell: true
});
this.dispatcherPid = tunerProc.pid;
Expand Down

0 comments on commit 36edf4c

Please sign in to comment.