Remote function - Jupyter Notebook
Last updated
Last updated
© Positron Networks, Inc. - Patents Pending
Robbie supports remotely running Python functions on GPUs in the Robbie cloud. Users typically choose this option if they have a specific task, such as a machine learning training loop, that needs the added performance of a GPU not available on their local machine.
See `Using Robbie in Jupyter Notebooks` for a more detailed explanation of when and how to use Robbie in your experimentation.
In this example, you will create a simple Jupyter Notebook on your local machine with one Python function that runs remotely on a GPU. (You can download the example here).
First, open a new notebook:
Then create four new (empty) cells in the notebook.
In the first cell paste:
This will install the Robbie and PyTorch Python packages and their dependencies on your local computer.
In the second cell paste:
This will you and download your API key from Robbie and install it on your local machine.
In the third cell paste:
In the fourth cell paste:
This defines the Python function (your_function()
) that will be run remotely in the Robbie cloud. Note that the chooser_ui=True
argument tells Robbie to display a special UI in the notebook so that the end-user can choose the hardware to run the function.
You should see the Robbie and other packages being installed.
If you have yet to log into Robbie, you will be prompted for your username and password.
Finally, run the third cell. You should see a small GUI directly in the notebook.
From the Hardware Options
dropdown menu, choose NERC Small GPU
. This is a NVIDIA V100 GPU-based virtual instance in the Robbie cloud.
You should then see the command program executing.
So, what is Robbie doing here?
Created a new run (uniquely identified as subtle_unicorn
) and allocated a GPU machine for your run.
Automatically detected your local Python dependencies (packages and versions), wrote them to a requirements.txt
file, and sent them to the remote machine.
Packaged up (serialized) your function and arguments and sent it to the remote machine.
Vended a deep link to view the run progress, logs, and artifacts in the Robbie portal.
On the remote machine, Robbie installed the Python dependencies, unpackaged your function, executed it, and then returned the result to the local machine.
Streamed the standard out from the remote machine to your local machine, including the results of the nvidia-smi
command.
Printed out the duration and cost of the job once it was complete
For more examples, see <Jupyter Notebook Examples>.
To learn how to run your current Juptyer notebooks on Robbe, see <website reference>
For a detailed guide on using the Jupyter Notebook features of “Robbie” see <Jupyter Notebook Reference>
Now Save the notebook ( on a Mac or on Windows)
Start by pressing the button to run the first cell.
Next, run the second cell by pressing the button.
Next, tick the checkbox.
Next, press the button.