"nni provides nnicli module as a python wrapper for its restful APIs, which can be used to retrieve nni experiment and trial job information in your python code. This notebook shows how to use nnicli module.\n",
"\n",
"Following are the functions available in nnicli module:\n",
"\n",
"#### start_nni(config_file)\n",
"Starts nni experiment with specified configuration file\n",
"\n",
"#### stop_nni()\n",
"Stop nni experiment.\n",
"\n",
"#### set_endpoint(endpoint)\n",
"Set nni endpoint for nnicli, the endpoint is showed while nni experiment is started successfully using nnictl command or start_nni function\n",
"\n",
"#### version()\n",
"Returns nni version\n",
"\n",
"#### get_experiment_profile()\n",
"Returns experiment profile.\n",
"\n",
"#### get_experiment_status()\n",
"Returns nni experiment status.\n",
"\n",
"#### get_job_metrics(trial_job_id)\n",
"Returns specified trial job metrics, including final results and intermediate results.\n",
"\n",
"#### get_job_statistics()\n",
"Returns trial job statistics information\n",
"\n",
"#### get_trial_job(trial_job_id)\n",
"Returns information of a specified trial job.\n",
"\n",
"#### list_trial_jobs()\n",
"Returns information of all trial jobs of current experiment."
"For a full nnicli API reference, please refer to [this documentation](https://nni.readthedocs.io/en/latest/nnicli_ref.html)."
]
},
{
...
...
@@ -46,104 +16,43 @@
"metadata": {},
"source": [
"### Start nni experiment using specified configuration file\n",
"Let's use a configruation file in nni examples directory to start an experiment."
"Let's use a configruation file in nni examples directory to start an experiment. Make sure you have installed nni, seaborn and pytorch in your environment."
"text": "INFO: expand searchSpacePath: search_space.json to /home/xxx/nni/examples/trials/mnist-pytorch/search_space.json\nINFO: expand codeDir: . to /home/xxx/nni/examples/trials/mnist-pytorch/.\nINFO: Starting restful server...\nINFO: Successfully started Restful server!\nINFO: Setting local config...\nINFO: Successfully set local config!\nINFO: Starting experiment...\nINFO: Successfully started experiment!\n------------------------------------------------------------------------------------\nThe experiment id is OhHNEkLQ\nThe Web UI urls are: http://127.0.0.1:8080 http://xxx.xxx.xxx.xxx:8080 http://172.17.0.1:8080\n------------------------------------------------------------------------------------\n\nYou can use these commands to get more information about the experiment\n------------------------------------------------------------------------------------\ncommands description\n1. nnictl experiment show show the information of experiments\n2. nnictl trial ls list all of trial jobs\n3. nnictl top monitor the status of running experiments\n4. nnictl log stderr show stderr log content\n5. nnictl log stdout show stdout log content\n6. nnictl stop stop an experiment\n7. nnictl trial kill kill a trial job by id\n8. nnictl --help get help information about nnictl\n------------------------------------------------------------------------------------\nCommand reference document https://nni.readthedocs.io/en/latest/Tutorial/Nnictl.html\n------------------------------------------------------------------------------------\n\n"
"### Connect nnicli module to started nni experiment\n",
"Call set_endpoint to connect nnicli moduele to the rest server of started nni experiment. Local mode training serviced is used in this notebook, but nnicli module can connect to any started nni experiment. The endpoint can be found in the output of start_nni function."