Commit 8fa633ca authored by Zejun Lin's avatar Zejun Lin Committed by QuanluZhang
Browse files

Update Trial's doc and move HowToDebug to Tutorial (#887)

* Add output_dir in trial's doc
parent dbace006
...@@ -5,4 +5,3 @@ Contribute to NNI ...@@ -5,4 +5,3 @@ Contribute to NNI
.. toctree:: .. toctree::
Development Setup<SetupNNIDeveloperEnvironment> Development Setup<SetupNNIDeveloperEnvironment>
Contribution Guide<CONTRIBUTING> Contribution Guide<CONTRIBUTING>
Debug HowTo<HowToDebug>
\ No newline at end of file
...@@ -125,6 +125,34 @@ In the YAML configure file, you need to set *useAnnotation* to true to enable NN ...@@ -125,6 +125,34 @@ In the YAML configure file, you need to set *useAnnotation* to true to enable NN
useAnnotation: true useAnnotation: true
``` ```
## Where are my trials?
### Local Mode
In NNI, every trial has a dedicated directory for them to output their own data. In each trial, an environment variable called `NNI_OUTPUT_DIR` is exported. Under this directory, you could find each trial's code, data and other possible log. In addition, each trial's log (including stdout) will be re-directed to a file named `trial.log` under that directory.
If NNI Annotation is used, trial's converted code is in another temporary directory. You can check that in a file named `run.sh` under the directory indicated by `NNI_OUTPUT_DIR`. The second line (i.e., the `cd` command) of this file will change directory to the actual directory where code is located. Below is an example of `run.sh`:
```shell
#!/bin/bash
cd /tmp/user_name/nni/annotation/tmpzj0h72x6 #This is the actual directory
export NNI_PLATFORM=local
export NNI_SYS_DIR=/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$
export NNI_TRIAL_JOB_ID=nrbb2
export NNI_OUTPUT_DIR=/home/user_name/nni/experiments/$eperiment_id$/trials/$trial_id$
export NNI_TRIAL_SEQ_ID=1
export MULTI_PHASE=false
export CUDA_VISIBLE_DEVICES=
eval python3 mnist.py 2>/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/stderr
echo $? `date +%s000` >/home/user_name/nni/experiments/$experiment_id$/trials/$trial_id$/.nni/state
```
### Other Modes
When runing trials on other platform like remote machine or PAI, the environment variable `NNI_OUTPUT_DIR` only refers to the output directory of the trial, while trial code and `run.sh` might not be there. However, the `trial.log` will be transmitted back to local machine in trial's directory, which defaults to `~/nni/experiments/$experiment_id$/trials/$trial_id$/`
For more information, please refer to [HowToDebug](HowToDebug.md)
<a name="more-examples"></a> <a name="more-examples"></a>
## More Trial Examples ## More Trial Examples
......
...@@ -13,3 +13,4 @@ Tutorials ...@@ -13,3 +13,4 @@ Tutorials
Training Platform<training_services> Training Platform<training_services>
How to use docker<HowToUseDocker> How to use docker<HowToUseDocker>
advanced advanced
Debug HowTo<HowToDebug>
\ No newline at end of file
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