Batch deployment details (Watson Machine Learning)

Explore the details for batch deployments including supported input data for each type of deployment.

Steps for submitting a batch deployment job (overview)

  1. Create a deployment of type batch.
  2. Configure a deployment job with software and hardware specifications and optional scheduling information, then submit the job.
  3. Poll for the status of the deployment job by querying the details of the corresponding deployment job via Watson Machine Learning Python client, REST APIs, or via the deployment space user interface.

You can create a batch deployment using any of these interfaces:

Queuing and concurrent job executions

The maximum number of concurrent jobs that can be run for each deployment is handled internally by the deployment service. A maximum of two jobs per batch deployment can be executed concurrently. Any deployment job requests for a specific batch deployment that already has two jobs under running state will be placed into a queue for execution at a later point of time. Once any of the running jobs are completed, the next job in the queue will be picked up for execution. There is no upper limit on the queue size.

Retention of deployment job metadata

The job-related metadata will be persisted and can be accessed as long as the job and its deployment are not deleted.

Data sources

The input data sources for a batch deployment job differ by framework. For details, refer to Input details by framework. For more information on batch job data types, refer to the “Data sources for batch jobs” section in the Managing data for deployments topic.

Specifying the compute requirements for the batch deployment job

The compute configuration for a batch deployment refers to the CPU and memory size allocated for a job. This information must be specified in the hardware_spec API parameter of either of these:

In the case of a batch deployment of an AutoAI model, the compute configuration must be specified in hybrid_pipeline_hardware_specs instead of hardware_spec parameter.

The compute configurations must be a reference to a predefined hardware specification. You can specify a hardware specification by name or id, using the id or name of the hardware specification with hardware_spec or hybrid_pipeline_hardware_specs (for AutoAI). You can access the list and details about the predefined hardware specifications through the Watson Machine Learning Python client or the Watson Machine Learning REST APIs.

Predefined hardware specifications

These are the predefined hardware specifications available by model type.

Watson Machine Learning models

Size Hardware definition
XS 1 CPU and 4 GB RAM
S 2 CPU and 8 GB RAM
M 4 CPU and 16 GB RAM
ML 4 CPU and 32 GB RAM
L 8 CPU and 32 GB RAM
XL 8 CPU and 64 GB RAM

Decision Optimization

Size Hardware definition
S 2 CPU and 8 GB RAM
M 4 CPU and 16 GB RAM
XL 16 CPU and 64 GB RAM

AutoAI with joined data

Note: These hardware definitions only apply if you are deploying an AutoAI model that uses a joined data set. For AutoAI models with a single data set, use the hardware definitions for Watson Machine Learning models.

Size Hardware definition
XS-Spark 1 CPU and 4 GB RAM, 1 master + 2 workers
S-Spark 2 CPU and 8 GB RAM, 1 master + 2 workers
M-Spark 4 CPU and 16 GB RAM, 1 master + 2 workers
L-Spark 4 CPU and 32 GB RAM, 1 master + 2 workers
XL-Spark 8 CPU and 32 GB RAM, 1 master + 2 workers


Input details by framework

Refer to your model type for details on what types of data are supported as input for a batch job.

Decision optimization

Type data references
File formats See Model input and output data file formats.

Type: data references

Data Sources:

Inline data:

Local/managed assets in deployment space:

Connected(remote) assets in deployment space: Cloud Object Storage, DB2 or Storage volume (NFS):

Notes:

For details and examples of data inputs for decision optimization solutions, refer to Model input and output data adaptation.

Spark

Type inline
File formats N/A

SPSS

Type inline and data references
File formats CSV

Data Sources: Data reference type must be data_asset for following assets

Notes:

Supported combinations of input and output sources

You must specify compatible sources for the SPSS Modeler flow input, the batch job input, and the output. If you specify an incompatible combination of types of data sources, you will get an error trying to execute the batch job.

These combinations are supported for batch jobs:

SPSS model stream input/output Batch deployment job input  Batch deployment job output
File Local/managed or referenced data asset (file) Remote data asset (file) or name
Database Remote data asset (database) Remote data asset (database)

For details on how Watson Studio connects to data, see Accessing data.

Specifying multiple inputs

If you are specifying multiple inputs for an SPSS model stream deployment with no schema, specify an ID for each element in input_data_references.

For details, see Using multiple data sources for an SPSS job.

In this example, when you create the job, provide three input entries with ids: “sample_db2_conn”, “sample_teradata_conn” and “sample_googlequery_conn” and select the required connected data for each input.

{
"deployment": {
    "href": "/v4/deployments/<deploymentID>"
  },
  "scoring": {
  	  "input_data_references": [{
               "id": "sample_db2_conn",              
               "name": "DB2 connection",
               "type": "data_asset",      
               "connection": {},
               "location": {
                     "href": "/v2/assets/<asset_id>?space_id=<space_id>"
               },
           },
           {
               "id": "sample_teradata_conn",          
               "name": "Teradata connection",
               "type": "data_asset",      
               "connection": {},
               "location": {
                     "href": "/v2/assets/<asset_id>?space_id=<space_id>"
               },
           },
           {
               "id": "sample_googlequery_conn",        
               "name": "Google bigquery connection",
               "type": "data_asset",      
               "connection": {},
               "location": {
                     "href": "/v2/assets/<asset_id>?space_id=<space_id>"
               },
           }],
  	  "output_data_references": {
  	  	        "id": "sample_db2_conn",
                "type": "data_asset",
                "connection": {},
                "location": {
                    "href": "/v2/assets/<asset_id>?space_id=<space_id>"
                },
          }
}

AutoAI

Type inline and data references
File formats CSV

Data Sources: Data reference type must be “data_asset: for the following assets

Notes:

Scikit-Learn & XGBoost

Type inline and data references
File formats CSV, ZIP archive containing CSV files

Data Sources: Data reference type must be “data_asset” for the following assets:

Notes: The environment_variables parameter of deployment jobs is not applicable.

Tensorflow

Type inline and data references
File formats ZIP archive containing JSON files

Data Sources: Data reference type must be “data_asset” for the following assets:

Notes: The environment_variables parameter of deployment jobs is not applicable.

Keras

Type inline and data references
File formats ZIP archive containing JSON files

Data Sources: Data reference type must be “data_asset” for the following assets:

Notes: The environment_variables parameter of deployment jobs is not applicable

Pytorch

Type inline and data references
File formats ZIP archive containing JSON files

Data Sources: Data reference type must be “data_asset” for the following assets:

Notes: The environment_variables parameter of deployment jobs is not applicable.

Python function

Type inline
File formats N/A

You can deploy Python functions in Watson Machine Learning the same way that you can deploy models. Your tools and apps can use the Watson Machine Learning Python client or REST API to send data to your deployed functions the same way that they send data to deployed models. Deploying functions gives you the ability to hide details (such as credentials), preprocess data before passing it to models, perform error handling, and include calls to multiple models, all within the deployed function instead of in your application.

Notes:

Python Scripts

Type data references
File formats any

Data Sources: Data reference type must be “data_asset” for the following assets:

Notes:

R Scripts

Type data references
File formats any

Data Sources: Data reference type must be “data_asset” for the following assets:

Notes: