зеркало из https://github.com/microsoft/nni.git
update experiment dir (#2753)
This commit is contained in:
Родитель
3fdbbdb3af
Коммит
6ec2adeed3
|
@ -81,6 +81,3 @@ venv.bak/
|
||||||
# VSCode
|
# VSCode
|
||||||
.vscode
|
.vscode
|
||||||
.vs
|
.vs
|
||||||
|
|
||||||
# In case you place source code in ~/nni/
|
|
||||||
/experiments
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ assessor:
|
||||||
|
|
||||||
Please noted in **2**. The object `trial_history` are exact the object that Trial send to Assessor by using SDK `report_intermediate_result` function.
|
Please noted in **2**. The object `trial_history` are exact the object that Trial send to Assessor by using SDK `report_intermediate_result` function.
|
||||||
|
|
||||||
The working directory of your assessor is `<home>/nni/experiments/<experiment_id>/log`, which can be retrieved with environment variable `NNI_LOG_DIRECTORY`,
|
The working directory of your assessor is `<home>/nni-experiments/<experiment_id>/log`, which can be retrieved with environment variable `NNI_LOG_DIRECTORY`,
|
||||||
|
|
||||||
More detail example you could see:
|
More detail example you could see:
|
||||||
> * [medianstop-assessor](https://github.com/Microsoft/nni/tree/master/src/sdk/pynni/nni/medianstop_assessor)
|
> * [medianstop-assessor](https://github.com/Microsoft/nni/tree/master/src/sdk/pynni/nni/medianstop_assessor)
|
||||||
|
|
|
@ -75,7 +75,7 @@ Then search with evolution tuner.
|
||||||
nnictl create --config config_search.yml
|
nnictl create --config config_search.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
The final architecture exported from every epoch of evolution can be found in `checkpoints` under the working directory of your tuner, which, by default, is `$HOME/nni/experiments/your_experiment_id/log`.
|
The final architecture exported from every epoch of evolution can be found in `checkpoints` under the working directory of your tuner, which, by default, is `$HOME/nni-experiments/your_experiment_id/log`.
|
||||||
|
|
||||||
### Step 3. Train from Scratch
|
### Step 3. Train from Scratch
|
||||||
|
|
||||||
|
|
|
@ -156,19 +156,19 @@ If NNI Annotation is used, the trial's converted code is in another temporary di
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd /tmp/user_name/nni/annotation/tmpzj0h72x6 #This is the actual directory
|
cd /tmp/user_name/nni/annotation/tmpzj0h72x6 #This is the actual directory
|
||||||
export NNI_PLATFORM=local
|
export NNI_PLATFORM=local
|
||||||
export NNI_SYS_DIR=/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$
|
export NNI_SYS_DIR=/home/user_name/nni-experiments/$experiment_id$/trials/$trial_id$
|
||||||
export NNI_TRIAL_JOB_ID=nrbb2
|
export NNI_TRIAL_JOB_ID=nrbb2
|
||||||
export NNI_OUTPUT_DIR=/home/user_name/nni/experiments/$eperiment_id$/trials/$trial_id$
|
export NNI_OUTPUT_DIR=/home/user_name/nni-experiments/$eperiment_id$/trials/$trial_id$
|
||||||
export NNI_TRIAL_SEQ_ID=1
|
export NNI_TRIAL_SEQ_ID=1
|
||||||
export MULTI_PHASE=false
|
export MULTI_PHASE=false
|
||||||
export CUDA_VISIBLE_DEVICES=
|
export CUDA_VISIBLE_DEVICES=
|
||||||
eval python3 mnist.py 2>/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/stderr
|
eval python3 mnist.py 2>/home/user_name/nni-experiments/$experiment_id$/trials/$trial_id$/stderr
|
||||||
echo $? `date +%s%3N` >/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/.nni/state
|
echo $? `date +%s%3N` >/home/user_name/nni-experiments/$experiment_id$/trials/$trial_id$/.nni/state
|
||||||
```
|
```
|
||||||
|
|
||||||
### Other Modes
|
### Other Modes
|
||||||
|
|
||||||
When running trials on other platforms like remote machine or PAI, the environment variable `NNI_OUTPUT_DIR` only refers to the output directory of the trial, while the trial code and `run.sh` might not be there. However, the `trial.log` will be transmitted back to the local machine in the trial's directory, which defaults to `~/nni/experiments/$experiment_id$/trials/$trial_id$/`
|
When running trials on other platforms like remote machine or PAI, the environment variable `NNI_OUTPUT_DIR` only refers to the output directory of the trial, while the trial code and `run.sh` might not be there. However, the `trial.log` will be transmitted back to the local machine in the trial's directory, which defaults to `~/nni-experiments/$experiment_id$/trials/$trial_id$/`
|
||||||
|
|
||||||
For more information, please refer to [HowToDebug](../Tutorial/HowToDebug.md).
|
For more information, please refer to [HowToDebug](../Tutorial/HowToDebug.md).
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ advisor:
|
||||||
arg1: value1
|
arg1: value1
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note that** The working directory of your advisor is `<home>/nni/experiments/<experiment_id>/log`, which can be retrieved with environment variable `NNI_LOG_DIRECTORY`.
|
**Note that** The working directory of your advisor is `<home>/nni-experiments/<experiment_id>/log`, which can be retrieved with environment variable `NNI_LOG_DIRECTORY`.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ parameters = {"dropout": 0.3, "learning_rate": 0.4}
|
||||||
value = 0.93
|
value = 0.93
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note that** The working directory of your tuner is `<home>/nni/experiments/<experiment_id>/log`, which can be retrieved with environment variable `NNI_LOG_DIRECTORY`, therefore, if you want to access a file (e.g., `data.txt`) in the directory of your own tuner, you cannot use `open('data.txt', 'r')`. Instead, you should use the following:
|
**Note that** The working directory of your tuner is `<home>/nni-experiments/<experiment_id>/log`, which can be retrieved with environment variable `NNI_LOG_DIRECTORY`, therefore, if you want to access a file (e.g., `data.txt`) in the directory of your own tuner, you cannot use `open('data.txt', 'r')`. Instead, you should use the following:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
_pwd = os.path.dirname(__file__)
|
_pwd = os.path.dirname(__file__)
|
||||||
|
|
|
@ -59,7 +59,7 @@ If you want to save and load the **best model**, the following methods are recom
|
||||||
```python
|
```python
|
||||||
# 1. Use NNI API
|
# 1. Use NNI API
|
||||||
## You can get the best model ID from WebUI
|
## You can get the best model ID from WebUI
|
||||||
## or `nni/experiments/experiment_id/log/model_path/best_model.txt'
|
## or `nni-experiments/experiment_id/log/model_path/best_model.txt'
|
||||||
|
|
||||||
## read the json string from model file and load it with NNI API
|
## read the json string from model file and load it with NNI API
|
||||||
with open("best-model.json") as json_file:
|
with open("best-model.json") as json_file:
|
||||||
|
|
|
@ -266,7 +266,7 @@ class DLTSTrainingService implements TrainingService {
|
||||||
public async submitTrialJob(form: TrialJobApplicationForm): Promise<TrialJobDetail> {
|
public async submitTrialJob(form: TrialJobApplicationForm): Promise<TrialJobDetail> {
|
||||||
const trialJobId: string = uniqueString(5);
|
const trialJobId: string = uniqueString(5);
|
||||||
const trialWorkingFolder: string = path.join(
|
const trialWorkingFolder: string = path.join(
|
||||||
'/nni/experiments', getExperimentId(),
|
'/nni-experiments', getExperimentId(),
|
||||||
'/trials/', trialJobId);
|
'/trials/', trialJobId);
|
||||||
const trialJobDetail = new DLTSTrialJobDetail(
|
const trialJobDetail = new DLTSTrialJobDetail(
|
||||||
trialJobId, // id
|
trialJobId, // id
|
||||||
|
|
|
@ -54,7 +54,7 @@ abstract class PAITrainingService implements TrainingService {
|
||||||
this.metricsEmitter = new EventEmitter();
|
this.metricsEmitter = new EventEmitter();
|
||||||
this.trialJobsMap = new Map<string, PAITrialJobDetail>();
|
this.trialJobsMap = new Map<string, PAITrialJobDetail>();
|
||||||
this.jobQueue = [];
|
this.jobQueue = [];
|
||||||
this.expRootDir = path.join('/nni', 'experiments', getExperimentId());
|
this.expRootDir = path.join('/nni-experiments', getExperimentId());
|
||||||
this.experimentId = getExperimentId();
|
this.experimentId = getExperimentId();
|
||||||
this.paiJobCollector = new PAIJobInfoCollector(this.trialJobsMap);
|
this.paiJobCollector = new PAIJobInfoCollector(this.trialJobsMap);
|
||||||
this.paiTokenUpdateInterval = 7200000; //2hours
|
this.paiTokenUpdateInterval = 7200000; //2hours
|
||||||
|
|
|
@ -175,7 +175,7 @@ class ShellExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRemoteExperimentRootDir(experimentId: string): string {
|
public getRemoteExperimentRootDir(experimentId: string): string {
|
||||||
return this.joinPath(this.tempPath, 'nni', 'experiments', experimentId);
|
return this.joinPath(this.tempPath, 'nni-experiments', experimentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public joinPath(...paths: string[]): string {
|
public joinPath(...paths: string[]): string {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"trainingServicePlatform": "local",
|
"trainingServicePlatform": "local",
|
||||||
"tuner": {
|
"tuner": {
|
||||||
"builtinTunerName": "Random",
|
"builtinTunerName": "Random",
|
||||||
"checkpointDir": "/home/user/nni/experiments/TN5K0Qju/checkpoint"
|
"checkpointDir": "/home/user/nni-experiments/TN5K0Qju/checkpoint"
|
||||||
},
|
},
|
||||||
"versionCheck": true,
|
"versionCheck": true,
|
||||||
"clusterMetaData": [
|
"clusterMetaData": [
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "AKVcExIf",
|
"id": "AKVcExIf",
|
||||||
"revision": 29,
|
"revision": 29,
|
||||||
"execDuration": 172,
|
"execDuration": 172,
|
||||||
"logDir": "/home/v-yugzh/nni/experiments/AKVcExIf",
|
"logDir": "/home/v-yugzh/nni-experiments/AKVcExIf",
|
||||||
"nextSequenceId": 10,
|
"nextSequenceId": 10,
|
||||||
"params": {
|
"params": {
|
||||||
"authorName": "default",
|
"authorName": "default",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "GD5MnU8G",
|
"id": "GD5MnU8G",
|
||||||
"revision": 22,
|
"revision": 22,
|
||||||
"execDuration": 172,
|
"execDuration": 172,
|
||||||
"logDir": "/home/user/nni/experiments/GD5MnU8G",
|
"logDir": "/home/user/nni-experiments/GD5MnU8G",
|
||||||
"nextSequenceId": 3,
|
"nextSequenceId": 3,
|
||||||
"params": {
|
"params": {
|
||||||
"authorName": "default",
|
"authorName": "default",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "mw3lSbde",
|
"id": "mw3lSbde",
|
||||||
"revision": 3,
|
"revision": 3,
|
||||||
"execDuration": 8,
|
"execDuration": 8,
|
||||||
"logDir": "/***/nni/experiments/mw3lSbde",
|
"logDir": "/***/nni-experiments/mw3lSbde",
|
||||||
"nextSequenceId": 1,
|
"nextSequenceId": 1,
|
||||||
"params": {
|
"params": {
|
||||||
"authorName": "NNI Example",
|
"authorName": "NNI Example",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "mw3lSbde",
|
"id": "mw3lSbde",
|
||||||
"revision": 34,
|
"revision": 34,
|
||||||
"execDuration": 233,
|
"execDuration": 233,
|
||||||
"logDir": "/***/nni/experiments/mw3lSbde",
|
"logDir": "/***/nni-experiments/mw3lSbde",
|
||||||
"nextSequenceId": 9,
|
"nextSequenceId": 9,
|
||||||
"params": {
|
"params": {
|
||||||
"authorName": "NNI Example",
|
"authorName": "NNI Example",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "mw3lSbde",
|
"id": "mw3lSbde",
|
||||||
"revision": 39,
|
"revision": 39,
|
||||||
"execDuration": 265,
|
"execDuration": 265,
|
||||||
"logDir": "/***/nni/experiments/mw3lSbde",
|
"logDir": "/***/nni-experiments/mw3lSbde",
|
||||||
"nextSequenceId": 11,
|
"nextSequenceId": 11,
|
||||||
"params": {
|
"params": {
|
||||||
"authorName": "NNI Example",
|
"authorName": "NNI Example",
|
||||||
|
|
|
@ -75,7 +75,7 @@ _nnictl()
|
||||||
|
|
||||||
# add experiment IDs to candidates if desired
|
# add experiment IDs to candidates if desired
|
||||||
if [[ $__nnictl_2nd_expid_cmds =~ " ${COMP_WORDS[1]} " ]]; then
|
if [[ $__nnictl_2nd_expid_cmds =~ " ${COMP_WORDS[1]} " ]]; then
|
||||||
local experiments=$(ls ~/nni/experiments 2>/dev/null)
|
local experiments=$(ls ~/nni-experiments 2>/dev/null)
|
||||||
COMPREPLY+=($(compgen -W "$experiments" -- $cur))
|
COMPREPLY+=($(compgen -W "$experiments" -- $cur))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ def _expand_file_annotations(src_path, dst_path, nas_mode):
|
||||||
def _generate_specific_file(src_path, dst_path, exp_id, trial_id, module):
|
def _generate_specific_file(src_path, dst_path, exp_id, trial_id, module):
|
||||||
with open(src_path) as src, open(dst_path, 'w') as dst:
|
with open(src_path) as src, open(dst_path, 'w') as dst:
|
||||||
try:
|
try:
|
||||||
with open(os.path.expanduser('~/nni/experiments/%s/trials/%s/parameter.cfg'%(exp_id, trial_id))) as fd:
|
with open(os.path.expanduser('~/nni-experiments/%s/trials/%s/parameter.cfg'%(exp_id, trial_id))) as fd:
|
||||||
para_cfg = json.load(fd)
|
para_cfg = json.load(fd)
|
||||||
annotated_code = specific_code_generator.parse(src.read(), para_cfg["parameters"], module)
|
annotated_code = specific_code_generator.parse(src.read(), para_cfg["parameters"], module)
|
||||||
if annotated_code is None:
|
if annotated_code is None:
|
||||||
|
|
|
@ -445,9 +445,9 @@ def remote_clean(machine_list, experiment_id=None):
|
||||||
sshKeyPath = machine.get('sshKeyPath')
|
sshKeyPath = machine.get('sshKeyPath')
|
||||||
passphrase = machine.get('passphrase')
|
passphrase = machine.get('passphrase')
|
||||||
if experiment_id:
|
if experiment_id:
|
||||||
remote_dir = '/' + '/'.join(['tmp', 'nni', 'experiments', experiment_id])
|
remote_dir = '/' + '/'.join(['tmp', 'nni-experiments', experiment_id])
|
||||||
else:
|
else:
|
||||||
remote_dir = '/' + '/'.join(['tmp', 'nni', 'experiments'])
|
remote_dir = '/' + '/'.join(['tmp', 'nni-experiments'])
|
||||||
sftp = create_ssh_sftp_client(host, port, userName, passwd, sshKeyPath, passphrase)
|
sftp = create_ssh_sftp_client(host, port, userName, passwd, sshKeyPath, passphrase)
|
||||||
print_normal('removing folder {0}'.format(host + ':' + str(port) + remote_dir))
|
print_normal('removing folder {0}'.format(host + ':' + str(port) + remote_dir))
|
||||||
remove_remote_directory(sftp, remote_dir)
|
remove_remote_directory(sftp, remote_dir)
|
||||||
|
@ -520,7 +520,7 @@ def experiment_clean(args):
|
||||||
home = str(Path.home())
|
home = str(Path.home())
|
||||||
local_dir = nni_config.get_config('experimentConfig').get('logDir')
|
local_dir = nni_config.get_config('experimentConfig').get('logDir')
|
||||||
if not local_dir:
|
if not local_dir:
|
||||||
local_dir = os.path.join(home, 'nni', 'experiments', experiment_id)
|
local_dir = os.path.join(home, 'nni-experiments', experiment_id)
|
||||||
local_clean(local_dir)
|
local_clean(local_dir)
|
||||||
experiment_config = Experiments()
|
experiment_config = Experiments()
|
||||||
print_normal('removing metadata of experiment {0}'.format(experiment_id))
|
print_normal('removing metadata of experiment {0}'.format(experiment_id))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче