-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
@@ -0,0 +1,44 @@ | |||
|
|||
# Use NNI on Google Colab | |||
NNI can easily run on Google's colab platform. However, colab doesn't expose its public IP and ports, so by default you can not access NNI's web ui on colab. To solve this, you need a reverse proxy software like `ngrok` or `frp`. This tutorial will show you how to use ngrok to get access to NNI's web ui on colab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ngrok to access NNI's web ui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
||
``` | ||
! nnictl create --config nni_repo/nni/examples/trials/mnist-pytorch/config.yml --port 5000 & # if you want to use gpu, make sure gpuNum >= 1 in config.yml | ||
get_ipython().system_raw('./ngrok http 5000 &') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is get_ipython()? why not use ./ngrok http 5000 &
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If use ! ./ngrok http 5000 &
directly, the cell running this command will stuck. Not sure why this happened. Use get_ipython() will solve this problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what get_ipython
is trying to solve should be stated in tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
||
## Access WebUI with frp | ||
|
||
frp is another reverse proxy software with similar functions. However, frp doesn't provide free public urls, so you may need an server with public IP as an frp server. See [here](https://github.com/fatedier/frp) to know more about how to deploy frp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an -> a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
! ./ngrok authtoken <your-authtoken> | ||
``` | ||
|
||
3. Start an NNI trail example on a port greater than 1024, then start ngrok with the same port. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
greater -> bigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
@@ -0,0 +1,44 @@ | |||
|
|||
# Use NNI on Google Colab | |||
NNI can easily run on Google's colab platform. However, colab doesn't expose its public IP and ports, so by default you can not access NNI's web ui on colab. To solve this, you need a reverse proxy software like `ngrok` or `frp`. This tutorial will show you how to use ngrok to access NNI's web ui on colab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Google "C"olab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"W"eb "UI"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
! ./ngrok authtoken <your-authtoken> | ||
``` | ||
|
||
3. Start an NNI trail example on a port bigger than 1024, then start ngrok with the same port. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an NNI example. What's trail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
||
|
||
``` | ||
! nnictl create --config nni_repo/nni/examples/trials/mnist-pytorch/config.yml --port 5000 & # if you want to use gpu, make sure gpuNum >= 1 in config.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add comments in text instead of in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
||
``` | ||
! nnictl create --config nni_repo/nni/examples/trials/mnist-pytorch/config.yml --port 5000 & # if you want to use gpu, make sure gpuNum >= 1 in config.yml | ||
get_ipython().system_raw('./ngrok http 5000 &') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what get_ipython
is trying to solve should be stated in tutorial.
docs/en_US/nnicli.md
Outdated
|
||
NNI client is a python API of `nnictl`, which implements the most common used commands. User can use this API to control their experiments in python code instead of command line. Here is an example: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might submit this file in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. These files were introduced by mistake.
@@ -0,0 +1,44 @@ | |||
|
|||
# Use NNI on Google Colab | |||
NNI can easily run on Google Colab platform. However, colab doesn't expose its public IP and ports, so by default you can not access NNI's Web UI on colab. To solve this, you need a reverse proxy software like `ngrok` or `frp`. This tutorial will show you how to use ngrok to access NNI's Web UI on colab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still a lot of "colab". Please change them to "Colab".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Fixed.
! curl -s http://localhost:4040/api/tunnels # don't change the port number 4040 | ||
``` | ||
|
||
You will see an url like http://xxxx.ngrok.io after step 4, open this url and you will find NNI's web ui. Have fun :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Web UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
No description provided.