About Interpreters and Notebook Service Levels

An interpreter is a plug-in that allows you to use a specific data processing language backend.

For the Zeppelin Notebooks in Oracle Machine Learning UI, you use the SQL, PL/SQL, Python and R interpreters within an Oracle AI Database interpreter group, and the Markdown interpreter for plain text formatting syntax so that it can be converted to HTML. You use the Conda interpreter to connect to the Conda environment and work with Python third-party library packages.

To use the interpreters, you must use these directives at the beginning of the paragraph in a notebook

Notebooks contain an internal list of service levels that define the order of the interpreters in an interpreter group. The default order of interpreter bindings in the Oracle AI Database interpreter group is:

With respect to interpreter bindings, you can perform the following tasks:

Not supported interpreter <name of interpreter>

You must note the interpreter binding order in the following scenarios:

Change Notebook Service Level

Notebook type corresponds to the ADB service levels - low, medium, high and gpu. These service levels affect parallelism in the database. The notebook type that is set for a notebook applies to all the paragraphs in that notebook. Note: In Notebooks Classic, the notebook type is referred to as the interpreter bindings. The notebook type gpu is not available in Notebooks Classic.

To use the interpreters, you must use these directives at the beginning of a paragraph in a notebook

You can change notebook service levels in both the new Notebook and Notebooks Classic.

Change Notebook Service Levels in the new Notebook

  1. Open your notebook in the notebook editor.

  2. Click on the Update Notebook Type icon on the top right corner. The available notebook types are displayed. The current notebook type is indicated by a tick mark, and is also displayed next to the Update Notebook Type icon. Figure 82: ADB service levels as displayed in a notebook

    Description of the illustration notebook-type-low.png

    The Notebook Types (ADB service levels) are:

    • low —Provides the least level of resources for in-database operations, typically serial (non-parallel) execution. It supports the maximum number of concurrent in-database operations by multiple users. The interpreter with low priority is listed at the top of the interpreter list, and hence, is the default.

    • medium—Provides a fixed number of CPUs to run in-database operations in parallel, where possible. It supports a limited number of concurrent users, typically 1.25 times the number of CPUs allocated to the pluggable database.

    • high—Provides the highest level of CPUs to run in-database operations in parallel, up to the number of CPUs allocated to the pluggable database. It offers the highest performance, but supports the minimum number of concurrent in-database operations, typically 3.

    • gpu—Provides GPU compute capabilities in a notebook through the Python interpreter with the database service level set to high. The notebook memory setting is 32 GB (DDR4), by default. It is extensible up to 200 GB.

  3. To change the notebook type, click on the type that you want to select. In this example, let’s click high. A confirmation message is displayed stating: Notebook Type is updated to "high".

Note: The updated notebook type is applicable to all the paragraphs in the notebook. You cannot change the notebook type at the paragraph level.

Figure 83: ADB service level - high

Description of the illustration notebook-type-high.png

Verify Notebook Service Level

After changing the Notebook service level, you can use a SQL statement to view and verify the information. Notebook type, referred to as interpreter bindings in Notebooks Classic, corresponds to the ADB service levels - low, medium, high and gpu. These service levels affect parallelism in the database.

For Python notebooks, the interpreter binding is used for all python paragraphs.

Note: For Python notebooks, do not override the interpreter binding at the paragraph level.

Verify Notebook Service Level in a Notebook

  1. Open the notebook for which you want to verify the updated notebook type.

  2. Run the following SQL statement:

    %sql
    SELECT SYS_CONTEXT ('USERENV', 'SERVICE_NAME') FROM DUAL;
  3. Click Run. The SQL statement returns the following information about the updated notebook type, as shown in the screenshot below: Figure 84: ADB service level information as displayed in a notebook

    Description of the illustration int-binding-info1.png

You can see that the service level is now displayed as high. In this example: