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. Running your experiments on Robbie

Robbie Python Remote Functions

PreviousJupyter NotebooksNextRobbie Magics

Last updated 3 months ago

Was this helpful?

Robbie uses a particular Python decorator (@remote) to designate a Python function to run remotely in the Robbie cloud. Users typically choose this option if they have a specific Python function, such as a machine learning training loop, that needs the added performance of a GPU. (Remote function examples).

In many ways, Remote functions behave like regular Python functions in that you can pass arguments, return results, and receive Exceptions. However, there are some differences that you should consider:

  • Remote functions cannot access Python global variables. If you need to access a global variable, pass it as an argument to the function.

  • Only data structures supported by can be passed as arguments to and returned by remote functions.

  • Avoid passing large data structures to the remote function, as they will be serialized and copied to the remote machine. Large data structure will delay your function from running.

To use remote functions, add the following code to the function you want to run remotely.

from robbie import remote

@remote()

def your_function():

# code

You can specify arguments to the decorator as follows:

  • chooser_ui: bool - If True, a small UI will be displayed in the user’s Jupyter Notebook allowing them to choose the parameters for their run. (Works with Jupyter Notebooks only).

  • funding_group_id: str - String that contains the UUID of the funding group that the job will be billed against.

  • environment_id: str - String that contains the UUID of the environment that the job will use.

  • image: str – Name of the container image to use for the run or ‘auto-select’.

If you run Python file containing a remote function from the command line, such as:

% python main.py

you can pass the following arguments:

--f <string> - This specifies the job configuration file to use (e.g. python_job_config.yaml)

--tail - Streams the stdout/stderr from Robbie back to your shell

--v - Verbose logging

https://github.com/cloudpipe/cloudpickle