Skip to main content

Runtimes

Datalayer introduces Browser and Remote Jupyter Runtimes aka Managed Kernels on top of the well-known Local Jupyter Kernels to seamlessly scale your Machine Learning and AI workflows.

info

Kernels can be hosted in your browser, on your local Jupyter Server, or remotely.

  • Browser Kernels: These Kernels run as web workers directly within your browser, enabling seamless interaction without the need for additional software installations.
  • Local Kernels: In this traditional setup, a Jupyter Server runs locally, and each execution spawns a local process to handle computations.
  • Remote Kernels: These Kernels run on a separate machine from your local device, leveraging potentially more powerful CPU, RAM, and GPU resources.

You can easily access and consume Runtimes from various interfaces, including JupyterLab, the CLI or VS Code.

info

The following actions are available for Runtimes:

  • Launch.
  • Assign.
  • Interrupt.
  • Restart.
  • Pause.
  • Resume.
  • Transfer State.
  • Terminate.

Launch a Runtime

Launching a Runtime is the first step to unlock the power of Datalayer.

When launching a Runtime, you will be prompted to select a few options:

  • An Environment, this can be a Platform or a User Environment.
  • A Time Reservation that defines the maximum execution time for the Runtime. After this time, the Runtime will be automatically terminated to prevent overconsumption of Credits.
  • You can choose whether the Runtime will have access to persistent persistent storage, allowing data to be retained between Runtime Sessions. Note that Runtimes with persistent storage may take longer to start (approximately 15 seconds instead of 3 seconds). Persistent storage is available under the ~/persistent directory on the Runtime.
  • You can also open an example Notebook when the Runtime starts. This feature provides a ready-to-use notebook, helping you quickly familiarize yourself with the environment and start working right away.

Assign a Runtime

Once your Runtime is up and running, you can assign it to a Notebook or a specific cell.

Interrupt a Runtime

You can interrupt a Runtime by clicking the Interrupt icon. This action will stop the Runtime's current execution.

This is useful when you want to stop a long-running computation or if the Runtime is unresponsive.

Restart a Runtime

You can restart a Runtime by clicking the Restart icon. This action will restart the Runtime, clearing all variables and outputs.

This is useful when you want to start fresh without creating a new Runtime.

Pause a Runtime

You can pause a Runtime by clicking the Pause icon. This action will pause the Runtime, allowing you to resume it later. This is useful when you want to temporarily stop the Runtime, keep its state, and resume it later.

With this feature, you can save credits by pausing the Runtime when you are not actively using it and resuming it when needed without having to rerun all the code that was needed to reach the current state.

note

When a Runtime is paused, a Runtime Snapshot is created.

warning

There are a few limitations to be aware of:

  1. Object Size Limitations: Extremely large objects, such as massive datasets or memory-heavy models, may exceed persistence limits. Consider external storage options, like cloud storage or databases, for these cases.
  2. Picklable Objects Only: The Runtime state is serialized using Python's pickle module. While common types (e.g., lists, dictionaries, NumPy arrays) are compatible, some objects (e.g., open file handles, certain class instances) may not be. Review the types of objects in your notebook to ensure compatibility.

Resume a Runtime

To Resume a Runtime, click the Resume icon of the Snapshot.

You can see the pause and resume feature in action below.

For details on Runtime Snapshots features, see Runtime Snapshots.

Transfer a Runtime State

When you switch Runtimes, you have the option to transfer the variables from the current Runtime to the new one.

This feature is useful when you want to keep the state of your variables when switching Runtimes. This allows to save time and resources by avoiding re-running the code to reach the current state.

warning

Variable transfers are currently limited to 7 MB. If you have large variables, consider saving them in the persistent storage. For more information, see Persistent Storage. Additionally, only pickable objects can be transferred.

You can also transfer variables between cells running on different Runtimes. This feature is particularly useful when you want to use variables you defined in previous cells.

Terminate a Runtime

You can terminate a Runtime by clicking the trash icon. This action will terminate the Runtime and remove it from the list of running Runtimes. This is useful when a Runtime is no longer needed.

tip

This will stop the credits consumption for this Runtime.