Robbie Python Remote Functions

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 https://github.com/cloudpipe/cloudpickle 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’.

  • tail: bool – True – Will print the standard out of the remote machine on the user’s local machine.

Things to consider/watch out for:

Last updated

Logo

© Positron Networks, Inc. - Patents Pending