LogoLogo
Sign InProject RobbieDemos
  • Getting Started
    • Welcome
    • Running your first Job
    • Remote function - Jupyter Notebook
    • Notebook Runner
    • Command Runner
  • Robbie Concepts
    • Introduction
    • User
    • Run
    • Token
    • Group (aka Team)
    • Environments
    • Workspace
    • Dependencies
    • Job Configuration File
    • Robbie Persistent Disk
  • Robbie Portal
    • Overview
    • Main Menu and Navigation
    • My Profile
    • My Resources
    • Runs
  • Running your experiments on Robbie
    • Overview
    • Command Runner
    • Jupyter Notebooks
    • Robbie Python Remote Functions
    • Robbie Magics
    • Robbie Notebook Runner
    • Matplotlib Support
    • Funding Group, Environment, and Images
  • Robbie Command Line Reference
    • robbie login
    • robbie config
    • robbie run
  • How it works
    • Architecture
Powered by GitBook
LogoLogo

© Positron Networks, Inc. - Patents Pending

On this page

Was this helpful?

Export as PDF
  1. Getting Started

Remote function - Jupyter Notebook

PreviousRunning your first JobNextNotebook Runner

Last updated 2 months ago

Was this helpful?

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:

jupyter lab

Then create four new (empty) cells in the notebook.

In the first cell paste:

!pip install robbie torch

This will install the Robbie and PyTorch Python packages and their dependencies on your local computer.

In the second cell paste:

import robbie
robbie.login()

This will you and download your API key from Robbie and install it on your local machine.

In the third cell paste:

from robbie import remote

@remote(chooser_ui=True)
def your_function():
     # code (Add Matplotlib here)

In the fourth cell paste:

a = your_functions()
print(“a is:”, a)

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?

  1. Created a new run (uniquely identified as subtle_unicorn) and allocated a GPU machine for your run.

  2. Automatically detected your local Python dependencies (packages and versions), wrote them to a requirements.txt file, and sent them to the remote machine.

  3. Packaged up (serialized) your function and arguments and sent it to the remote machine.

  4. Vended a deep link to view the run progress, logs, and artifacts in the Robbie portal.

  5. On the remote machine, Robbie installed the Python dependencies, unpackaged your function, executed it, and then returned the result to the local machine.

  6. Streamed the standard out from the remote machine to your local machine, including the results of the nvidia-smi command.

  7. Printed out the duration and cost of the job once it was complete

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.

For more examples, see .

Jupyter Notebook Examples
A computer screen with white text Description automatically generated
Robbie Remote Function Notebook GUI
A screenshot of a computer program Description automatically generated
A screenshot of a computer Description automatically generated