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

support conda (#90) #110

Merged
merged 1 commit into from
Sep 26, 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
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