Patent Description:
This difficulty is partially due to the underlying algorithmic and mathematical complexities of machine learning algorithms, which are typically developed by academic researchers or individuals at the forefront of the field. Additionally, it is also difficult to generate, update, and deploy useful models, which can be extremely time and resource consumptive and filled with complexities. Moreover, machine learning models tend to be extremely focused on particular use cases and operating environments, and thus any change to the underlying environment or use case may require a complete regeneration of a new model. Further, constructing and deploying machine learning technologies is quite different from traditional software engineering, and requires practices and architectures different from what traditional software engineering development teams are familiar with. While machine learning techniques provide many benefits to organizations, use of such machine learning techniques requires significant specialized knowledge that is not easy to use with traditional data processing using relational databases and other data stores.

Reference may be made to any of the following documents.

<CIT>, which relates to a method and a device for implementing a computing service based on SQL statements. In the method, an existing SQL grammar is expanded, so that an expanded SQL statement contains calculation elements required by a calculation service, and an SQL statement processing device is created between a client and a target calculation framework. An SQL statement processing device performs grammatical analysis on the received SQL statement. The method comprises the following steps of analyzing an SQL statement as an extended SQL statement; generating a computing service description statement which can be identified by a target computing framework based on the computing element information contained in the SQL statement; then, the computing service description statement is submitted to the target computing framework, so that the computing service is performed in the target computing framework based on the computing service description statement, and a user does not need to have the programming capability required by the target computing framework.

<CIT>, which relates to automated statistical analysis job chunking. A computer system provides an interface for a user to submit job requests which pair a script with a query. The computer system and a batch module interoperate with one another to process the job requests and return the job results to the user. The computer system can query the batch module to understand computational resource capability and availability. The computer system can also partition the larger parent job into smaller job chunks for the purpose of multi-threading and to facilitate concurrent parallel processing.

The present disclosure relates to methods, apparatus, systems, and non-transitory computer-readable storage media for machine learning inference calls for database query processing According to some embodiments, machine learning inference calls can be integrated into database queries to enable the use of machine learning techniques without requiring specialized machine learning knowledge on the part of users. In some embodiments, machine learning calls can be integrated into database queries, such as structure query language (SQL) queries, or other popular query languages used to process structured data, without requiring significant changes to applications, database services, etc..

<FIG> is a diagram illustrating an environment for machine learning inference calls for database query processing according to some embodiments. As shown in <FIG>, a provider network <NUM> can include a database service <NUM>. A user may have structured data which is stored in one or more database instances <NUM> of database service <NUM>. The data may be added to the database service by the user, from user device <NUM> or may be added from services of provider network <NUM> or other services external to provider network <NUM>. This data may be analyzed to obtain useful information for the user. A part of this analysis may include using machine learning techniques to perform inference on the data. For example, text data may be extracted from images stored in database service <NUM>, text data may be analyzed to identify sentiments associated with snippets of the text data, and/or other specialized models may be used to perform inference on the user's data to obtain information about the data. However, as discussed, use of machine learning techniques often requires specialized knowledge and is not well integrated into data management services, such as database service <NUM>. Embodiments address these issues by providing techniques for making machine learning inference calls for database query processing.

A provider network <NUM> (or, "cloud" provider network) provides users with the ability to utilize one or more of a variety of types of computing-related resources such as compute resources (e.g., executing virtual machine (VM) instances and/or containers, executing batch jobs, executing code without provisioning servers), data/storage resources (e.g., object storage, block-level storage, data archival storage, databases and database tables, etc.), network-related resources (e.g., configuring virtual networks including groups of compute resources, content delivery networks (CDNs), Domain Name Service (DNS)), application resources (e.g., databases, application build/deployment services), access policies or roles, identity policies or roles, machine images, routers and other data processing resources, etc. These and other computing resources may be provided as services, such as a hardware virtualization service that can execute compute instances, a storage service that can store data objects, etc. The users (or "customers") of provider networks <NUM> may utilize one or more user accounts that are associated with a customer account, though these terms may be used somewhat interchangeably depending upon the context of use. Users may interact with a provider network <NUM> across one or more intermediate networks <NUM> (e.g., the internet) via one or more interface(s) <NUM>, such as through use of application programming interface (API) calls, via a console implemented as a website or application, etc. The interface(s) <NUM> may be part of, or serve as a front-end to, a control plane <NUM> of the provider network <NUM> that includes "backend" services supporting and enabling the services that may be more directly offered to customers.

For example, a cloud provider network (or just "cloud") typically refers to a large pool of accessible virtualized computing resources (such as compute, storage, and networking resources, applications, and services). A cloud can provide convenient, on-demand network access to a shared pool of configurable computing resources that can be programmatically provisioned and released in response to customer commands. These resources can be dynamically provisioned and reconfigured to adjust to variable load. Cloud computing can thus be considered as both the applications delivered as services over a publicly accessible network (e.g., the Internet, a cellular communication network) and the hardware and software in cloud provider data centers that provide those services.

Generally, the traffic and operations of a provider network may broadly be subdivided into two categories: control plane operations carried over a logical control plane and data plane operations carried over a logical data plane. While the data plane represents the movement of user data through the distributed computing system, the control plane represents the movement of control signals through the distributed computing system. The control plane generally includes one or more control plane components distributed across and implemented by one or more control servers. Control plane traffic generally includes administrative operations, such as system configuration and management (e.g., resource placement, hardware capacity management, diagnostic monitoring, system state information). The data plane includes customer resources that are implemented on the provider network (e.g., computing instances, containers, block storage volumes, databases, file storage). Data plane traffic generally includes non-administrative operations such as transferring customer data to and from the customer resources. The control plane components are typically implemented on a separate set of servers from the data plane servers, and control plane traffic and data plane traffic may be sent over separate/distinct networks.

To provide these and other computing resource services, provider networks <NUM> often rely upon virtualization techniques. For example, virtualization technologies may be used to provide users the ability to control or utilize compute instances (e.g., a VM using a guest operating system (O/S) that operates using a hypervisor that may or may not further operate on top of an underlying host O/S, a container that may or may not operate in a VM, an instance that can execute on "bare metal" hardware without an underlying hypervisor), where one or multiple compute instances can be implemented using a single electronic device. Thus, a user may directly utilize a compute instance (e.g., provided by a hardware virtualization service) hosted by the provider network to perform a variety of computing tasks. Additionally, or alternatively, a user may indirectly utilize a compute instance by submitting code to be executed by the provider network (e.g., via an on-demand code execution service), which in turn utilizes a compute instance to execute the code - typically without the user having any control of or knowledge of the underlying compute instance(s) involved.

As shown in <FIG>, a request can be sent to a database service <NUM> to perform a query on data stored in one or more database instances <NUM>. In some embodiments, the request can originate from a user device <NUM>, as shown at numeral 1A, or from a service <NUM> (e.g., a serverless function or other service) of provider network <NUM>, as shown at numeral 1B. In various embodiments, a "serverless" function may include code provided by a user or other entity - such as the provider network itself - that can be executed on demand. Serverless functions may be maintained within provider network <NUM> by an on-demand code execution service and may be associated with a particular user or account or be generally accessible to multiple users/accounts. A serverless function may be associated with a Uniform Resource Locator (URL), Uniform Resource Identifier (URI), or other reference, which may be used to invoke the serverless function. A serverless function may be executed by a compute instance, such as a virtual machine, container, etc., when triggered or invoked. In some embodiments, a serverless function can be invoked through an application programming interface (API) call or a specially formatted HyperText Transport Protocol (HTTP) request message. Accordingly, users can define serverless functions that can be executed on demand, without requiring the user to maintain dedicated infrastructure to execute the serverless function. Instead, the serverless functions can be executed on demand using resources maintained by the provider network <NUM>. In some embodiments, these resources may be maintained in a "ready" state (e.g., having a pre-initialized runtime environment configured to execute the serverless functions), allowing the serverless functions to be executed in near real-time.

The request may originate from a client 104A executing on user device <NUM>, or a client 104B of service <NUM>, which may interface with the database service <NUM> through one or more interfaces, such as application programming interfaces (APIs), text interfaces, graphical user interfaces (GUIs), or other interfaces. The request may include a database query, such as a SQL (or other query language) statement. Although embodiments are described generally using SQL statements, this is for ease of illustration and not intended to be limiting. Embodiments may be similarly implemented using alternative query languages. The database instance <NUM> can process the query included in the request. In various embodiments, the database service can be updated to identify inference requests included in a database query. In some embodiments, the database service <NUM> can be updated to be able to identify API calls for APIs published by machine learning-backed service <NUM>. Machine learning-backed service <NUM> may include one or more pretrained models that may be used to perform inference on user data. The models may be trained for various inference tasks that may be used by multiple users, such as sentiment analysis, text identification, object detection, etc..

In some embodiments, a user may train custom models or provide their own models which are then hosted by a machine learning service <NUM> as hosted models <NUM>. These hosted models may be used to perform inference tasks that are specific to the user, based on the user's own training data, or otherwise user-specific tasks. In such embodiments, the user may create a function, or model invocation command, which the database service will recognize during query execution. For example, a user may have a hosted model <NUM> that can be used to perform fraud detection on data stored in database service <NUM>. To perform inference using the model, the user may instruct the database service to recognize when the model is being invoked in a query, such as through a user defined function:
<IMG>.

The user may then use the model to perform inference on data in database service <NUM> in a database query. For example, such a query may include: select My_FraudDetection([inputs]) from [data source], where the hosted model My_FraudDetection is invoked on data from the data source, such as one or more database tables, particular rows of one or more database tables, etc., based on the inputs. During query processing, a database parser can identify the My_FraudDetection call within the select statement and determine data associated with that call to be provided to the machine learning service to perform inference using the model. For example, the [inputs] may include a statement that identifies one or more columns of a particular database table, or particular row(s) and column(s) of a particular database table, data from multiple database tables, etc. Similarly, if an API associated with a machine learning-backed service is identified during query processing, a database parser can identify the API within the query and determine data associated with the API to be provided to the machine learning-backed service to perform inference using a pretrained model.

At numeral <NUM>, the data to be provided to the machine learning service or the machine learning-backed service can be provided to asynchronous request handler <NUM>. If each record identified as being associated with a machine learning call is passed to the machine learning service or machine learning-backed service individually, the resulting delay (e.g., introduced by the various network calls added by invoking another service and the actual inference time) would lead to a poor user experience. Instead, the query processing of the database instance <NUM> and the inference performed by the machine learning service <NUM> or machine learning-backed service <NUM> can be decoupled using an asynchronous request handler <NUM>.

The asynchronous request handler can receive the data on which inference is to be performed in an input buffer. This enables the database service to send machine learning requests in a batch, where the batch may include a number of records up to the input buffer size. When the asynchronous request handler determined data has been added to the input buffer, the asynchronous request handler <NUM> can create a mini-batch of data from the input buffer to be sent to the machine learning service or the machine learning backed service, as shown as numerals 3A and 3B, depending on which service was invoked in the query. The mini-batch size may be service-specific, as each service may be configured to receive a different maximum number of records at once. For example, the APIs provided by a given service may place a limit on the number of requests which may be included in a batch. The mini-batch size and the input buffer batch size may be different, and the asynchronous request handler can generate a mini-batch from the requests in its input buffer. In some embodiments, the mini-batch size may be smaller than the input buffer batch size, in which case the asynchronous request handler may generate multiple mini-batches until all of the machine learning requests from the input buffer have been sent to the invoked external service (e.g., machine learning service or machine learning-backed service). In some embodiments, the mini-batch size may be larger than or equal to the input buffer batch size, in which case the mini-batch may include all of the requests included in the input buffer.

In some embodiments, a single query may not generate enough machine learning requests to fill the input buffer of the asynchronous request handler <NUM>. In such cases, the asynchronous request handler may obtain machine learning requests generated by multiple queries, including queries from different users and/or as part of different transactions being performed by the database service.

In response to receiving a mini-batch of machine learning requests, the machine learning service <NUM> or machine-learning backed service <NUM> (depending on which service was invoked in the query) can perform inference on the records included in the mini-batch and generate a response for each record. The response can be added to an output buffer of the asynchronous request handler <NUM> at numerals 4A or 4B. The asynchronous request handler can monitor the output buffer and add a flag or other data indicating that a complete set of responses has been received for the mini-batch of requests that was sent. The database service can monitor the output buffer and, when a flag is identified, can pull the responses from the output buffer, as shown at numeral <NUM>. In some embodiments, where the asynchronous request handler is processing requests from multiple users and/or transactions each database instance may monitor the output buffer for its particular responses and pull only those responses which correspond to the requests sent by that instance. In some embodiments, each response may identify the request, database instance, user, and/or transaction with which the response is associated. Query processing may be completed by the database instance using the response from the machine learning service and/or the machine learning-backed service and, at numeral 6A or 6B, the result of the query can be returned.

<FIG> is a diagram illustrating an asynchronous request handler according to some embodiments. When a database instance <NUM> processes a query it can identify a query execution plan to perform the query. A given query can be executed in many different ways, and each way may offer different performance characteristics. A query optimizer may best query execution plan for a given query, based on one or more performance requirements for the query. In some embodiments, during query execution, the database processor <NUM> can create a virtual operator <NUM> which enables execution of the query execution plan to add a thread in which machine learning request(s) can be sent and response can be received without blocking a main query processing thread. In some embodiments, the query optimizer can change an evaluation order of the predicates in the query to reduce the number of records that require machine learning calls to be made by the virtual operator <NUM>.

Virtual operator <NUM> can identify records that need to be sent to a machine learning service or machine learning-backed service in batches equal to the input buffer <NUM> size of the asynchronous request handler <NUM>. In some embodiments, virtual operator <NUM> may be implemented as a temporary data structure (e.g., temporary file, scratch pad, or other data structure) which may be used to perform at least a portion of the query to identify the records that are to be sent to the machine learning service or the machine learning-backed service. For example, a query may specify that data from multiple tables in the database service are to be joined and then a portion of the records in the joined data may be identified to be sent to the machine learning service or the machine learning backed service. By using the virtual operator, machine learning requests can be identified and sent to the asynchronous request handler in parallel to processing other portions of the query. At numeral <NUM>, a batch of machine learning requests (e.g., including a record, a model endpoint/API, etc.) can be sent to the input buffer <NUM>. In some embodiments, a different input buffer may be maintained for each machine learning service and machine learning-backed service to which the machine learning requests may be sent. Each input buffer may be implemented as a queue or other data structure to which the requests may be added by the virtual operator. A batch handler <NUM> can generate mini-batches of an appropriate size for the service being invoked. For example, at numeral <NUM>, batch handler <NUM> can divide the input batch from input buffer <NUM> into multiple mini-batches to be sent to the invoked service. At numeral <NUM>, each mini-batch can be sent, in turn, to the invoked external service (e.g., machine learning service <NUM> or machine learning-backed service <NUM>). As discussed, in some embodiments, the input batch size may be smaller than the batch size associated with the invoked external service. In such instances, the mini-batch may include all of the machine learning requests from the input batch.

As the machine learning responses are generated, the external service can add the results to an output buffer <NUM> of the asynchronous request handler <NUM>, as shown at numeral <NUM>. When each mini-batch has been completely processed, the external service can add a flag or other indicator to the output buffer indicating that processing of the mini-batch is complete. In some embodiments, the external service may additionally, or alternatively, add a flag or other indicator to the output buffer once all machine learning requests associated with a given transaction have been completed. Database processor <NUM> can be simultaneously executing the query execution plan while the machine learning requests and response are obtained in a separate thread. When query execution reaches the machine learning service invocation (e.g., the API call, user defined function, etc.), the database processor <NUM> can access the output buffer <NUM> for the machine learning responses, at numeral <NUM>. If the responses have not yet been populated in the output buffering, processing can wait until a flag (or flags) has been set in the output buffer indicating that processing is complete.

<FIG> is a diagram illustrating an environment for machine learning inference calls for database query processing using a local machine learning model according to some embodiments. As discussed, when used with a machine learning service <NUM> and a hosted model <NUM>, the user can define a function associated with the hosted model <NUM> such that the database instance can identify that the machine learning service is being invoked. At numeral <NUM>, the user defined function statement can be received by the database parser <NUM> (e.g., a SQL parser or other parser). In some embodiments, to reduce the number of network calls required by the database service, at numeral <NUM>, a request can be sent to the machine learning service for the model identified in the user defined function statement. This request can include performance, hardware, or other characteristics of the database instance. The machine learning service can compile a copy of the model for the database instance and, at numeral <NUM>, return the model to the database instance. In some embodiments, the compiled model <NUM> may be implemented in a shared library <NUM>.

At numeral <NUM>, a model schema <NUM> can be generated which maps the invoked machine learning model to a compiled model <NUM>. Subsequently, at numeral <NUM>, a query can be received by the database instance <NUM> which invokes the model. The database processor can use the model schema <NUM> to identify the corresponding compiled model <NUM> in the model library <NUM> and direct the machine learning requests to the compiled model via the asynchronous request handler <NUM>, as shown at numeral <NUM>. Processing of the machine learning requests and responses may proceed generally as described above with respect to <FIG>, except instead of sending a mini-batch of requests via a network call to an external service, the mini-batch of request is sent locally to the compiled model <NUM> in the model library <NUM>. This reduces the number of network calls required to the number of models being used in a given transaction.

<FIG> is a diagram illustrating an alternative environment for machine learning inference calls for database query processing using a local machine learning model according to some embodiments. In the embodiment of <FIG>, the database service may be implemented as a plurality of nodes, including the database instance <NUM> (e.g., a head node) and a plurality of nodes 400A-400N. The data stored in the database instance may be spread across the plurality of storage nodes. Numerals <NUM>-<NUM> may proceed as discussed above with respect to <FIG>, however at numeral <NUM> the compiled model is received by a model deployer <NUM>. Model deployer <NUM> can obtain the compiled model and, at numeral <NUM>, deploy a copy of the model to each storage node 400A-400N.

At numeral <NUM>, a model schema <NUM> can be generated which maps the invoked machine learning model to a compiled model <NUM>. Subsequently, at numeral <NUM>, a query can be received by the database instance <NUM> which invokes the model. At numeral <NUM>, the query can be executed in parallel on one or more of the storage nodes based on where the data is stored. As the query is processed in parallel, inference may also be performed in parallel on each storage node using the compiled model <NUM> identified using the model schema <NUM>. In some embodiments, each node may also include an asynchronous request handler which can pass batches of requests to each compiled model on its corresponding storage node. Processing of the machine learning requests and responses may proceed generally as described above with respect to <FIG>, except instead of sending a mini-batch of requests via a network call to an external service, the mini-batch of request is sent locally to the compiled model <NUM> in the model library <NUM>. This reduces the number of network calls required to the number of models being used in a given transaction.

<FIG> is a diagram illustrating example user interfaces for machine learning inference calls according to some embodiments. As shown in <FIG>, multiple user interfaces (UIs) <NUM> can be implemented to enable inference calls to be made within a given database query. For example, UI <NUM> can invoke a machine learning service using ML_service function (or other user defined function) on text input (e.g., through the select statement identifying, e.g., a column named "review" from a database table named "review_table. " Additionally, or alternatively, UI <NUM> can be used to perform inference on arbitrary data types, such as files of "file_name" stored at a "storage_location" (e.g., a data store name, URI, URL, or other location identifier) from a dataset, such as a database table. Additionally, or alternatively, UI <NUM> can invoke a user defined function "ML_function", which as previously discussed, may be defined by a user to invoke a particular model (e.g., model_name) to perform inference on records from a dataset based on one or more input values. In some embodiments, the model may be invoked directly, as shown at UI <NUM>, rather than using the user defined function shown in UI <NUM>. In some embodiments, a view style UI <NUM> can be used to invoke a model to perform inference on particular records (such as those included in table T1, as shown in <FIG>, or on other records as defined in a predicate statement) from a predefined view V1.

<FIG> is a flow diagram illustrating operations <NUM> of a method for making machine learning inference calls for database query processing according to some embodiments. Some or all of the operations <NUM> (or other processes described herein, or variations, and/or combinations thereof) are performed under the control of one or more computer systems configured with executable instructions and are implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors, by hardware or combinations thereof. The code is stored on a computer-readable storage medium, for example, in the form of a computer program comprising instructions executable by one or more processors. The computer-readable storage medium is non-transitory. In some embodiments, one or more (or all) of the operations <NUM> are performed by database instance <NUM>, asynchronous request handler <NUM>, etc. of the other figures.

The operations <NUM> include, at block <NUM>, executing at least a portion of a query on data stored in a database service using a temporary data structure to generate a first batch of machine learning requests, wherein the query identifies a machine learning service. In some embodiments, the temporary data structure may be a virtual operator which is created by the database processor to perform all or parts of the query. In some embodiments, the query plan identified to execute all or part of the query may be optimized to reduce the number of machine learning calls that need to be made to process the query. In some embodiments, the query is a structured query language (SQL) query. In some embodiments, the SQL query identifies the machine learning using an application programming interface (API) call to the machine learning service. In some embodiments, the machine learning service publishes the API to perform inference using the machine learning model in response to requests received from a plurality of users. In some embodiments, the query identifies the machine learning service using an endpoint associated with the machine learning model hosted by the machine learning service.

The operations <NUM> further include, at block <NUM>, generating a second batch of machine learning requests based on the first batch of machine learning requests and based on the machine learning service. In some embodiments, the first batch of machine learning requests can be added to an input buffer of an asynchronous request handler. As discussed, the asynchronous request handler can manage machine learning requests to be sent to a machine learning service or a machine learning-backed service. In some embodiments, the second batch of machine learning requests is sent to the machine learning service over at least one network. In some embodiments, the second batch size is different from the first batch size, and wherein the second batch size is associated with the machine learning service. For example, the machine learning service may have a maximum batch size, which limits the number of requests which may be sent in a batch to the machine learning service. In some embodiments, the first batch of machine learning requests includes machine learning requests generated in response to multiple queries received from a plurality of different users.

In some embodiments, the operations <NUM> may further include sending a request to the machine learning service for the machine learning model, receiving the machine learning model from the machine learning service, the machine learning model compiled for the database service by the machine learning service, and wherein the second batch of machine learning requests is sent to the machine learning model hosted by the database service. In some embodiments, the operations <NUM> may further include storing a copy of the machine learning model in a plurality of nodes of the database service, wherein machine learning requests generated during the query processing by a particular node of the database service are sent to the copy of the machine learning model stored on the particular node.

The operations <NUM> further include, at block <NUM>, obtaining a plurality of machine learning responses, the machine learning responses generated by the machine learning service using a machine learning model in response to receiving the second batch of machine learning requests. In some embodiments, as discussed, the plurality of machine learning responses may be added to an output buffer of the asynchronous request handler. The database processor may obtain the machine learning responses from the output buffer and use the responses to complete processing of the query.

In some embodiments, the operations <NUM> may include receiving a request at a database service, wherein the request includes a structured query language (SQL) query to be performed on at least a portion of a dataset in the database service and wherein the request identifies a machine learning service to be used in processing the SQL query, creating a virtual operator to perform at least a portion of the SQL query, generating a first batch of machine learning requests based at least on the portion of the SQL query performed by the virtual operator, sending the first batch of machine learning requests to an input buffer of an asynchronous request handler, the asynchronous request handler to generate a second batch of machine learning requests based on the first batch of machine learning requests, obtaining a plurality of machine learning responses from an output buffer of the asynchronous request handler, the machine learning responses generated by the machine learning service using a machine learning model in response to receiving the second batch of machine learning requests, and generating a query response based on the machine learning responses.

In some embodiments, generating a first batch of machine learning requests based at least on the SQL query, further comprises determining a query execution plan that minimizes a number of records associated with machine learning request. In some embodiments, the machine learning service adds a flag to the output buffer when the second batch of machine learning requests has been processed.

<FIG> is a block diagram of an illustrative operating environment in which machine learning models are trained and hosted according to some embodiments. The operating environment includes end user devices <NUM>, a model training system <NUM>, a model hosting system <NUM>, a training data store <NUM>, a training metrics data store <NUM>, a container data store <NUM>, a training model data store <NUM>, and a model prediction data store <NUM>.

A machine learning service <NUM> described herein may include one or more of these entities, such as the model hosting system <NUM>, model training system <NUM>, and so forth.

In some embodiments, users, by way of user devices <NUM>, interact with the model training system <NUM> to provide data that causes the model training system <NUM> to train one or more machine learning models, for example, as described elsewhere herein. A machine learning model, generally, may be thought of as one or more equations that are "trained" using a set of data. In some embodiments, the model training system <NUM> provides ML functionalities as a web service, and thus messaging between user devices <NUM> and the model training system <NUM> (or provider network <NUM>), and/or between components of the model training system <NUM> (or provider network <NUM>), can use HTTP messages to transfer data in a machine-readable file format, such as eXtensible Markup Language (XML) or JavaScript Object Notation (JSON). In some embodiments, providing access to various functionality as a web service is not limited to communications exchanged via the World Wide Web and more generally refers to a service that can communicate with other electronic devices via a computer network.

The user devices <NUM> can interact with the model training system <NUM> via frontend <NUM> of the model training system <NUM>. For example, a user devices <NUM> can provide a training request to the frontend <NUM> that includes a container image (or multiple container images, or an identifier of one or multiple locations where container images are stored), an indicator of input data (for example, an address or location of input data), one or more hyperparameter values (for example, values indicating how the algorithm will operate, how many algorithms to run in parallel, how many clusters into which to separate data, and so forth), and/or information describing the computing machine on which to train a machine learning model (for example, a graphical processing unit (GPU) instance type, a central processing unit (CPU) instance type, an amount of memory to allocate, a type of virtual machine instance to use for training, and so forth).

In some embodiments, the container image can include one or more layers, where each layer represents an executable instruction. Some or all of the executable instructions together represent an algorithm that defines a machine learning model. The executable instructions (for example, the algorithm) can be written in any programming language (for example, Python, Ruby, C++, Java, etc.). In some embodiments, the algorithm is pre-generated and obtained by a user, via the user devices <NUM>, from an algorithm repository (for example, a network-accessible marketplace, a data store provided by a machine learning training service, etc.). In some embodiments, the algorithm is completely user-generated or partially user-generated (for example, user-provided code modifies or configures existing algorithmic code).

In some embodiments, instead of providing a container image (or identifier thereof) in the training request, the user devices <NUM> may provide, in the training request, an algorithm written in any programming language. The model training system <NUM> then packages the algorithm into a container (optionally with other code, such as a "base" ML algorithm supplemented with user-provided code) that is eventually loaded into a virtual machine instance <NUM> for training a machine learning model, as described in greater detail below. For example, a user, via a user devices <NUM>, may develop an algorithm/code using an application (for example, an interactive web-based programming environment) and cause the algorithm/code to be provided - perhaps as part of a training request (or referenced in a training request) - to the model training system <NUM>, where this algorithm/code may be containerized on its own or used together with an existing container having a machine learning framework, for example.

In some embodiments, instead of providing a container image in the training request, the user devices <NUM> provides, in the training request, an indicator of a container image (for example, an indication of an address or a location at which a container image is stored). For example, the container image can be stored in a container data store <NUM>, and this container image may have been previously created/uploaded by the user. The model training system <NUM> can retrieve the container image from the indicated location and create a container using the retrieved container image. The container is then loaded into a virtual machine instance <NUM> for training a machine learning model, as described in greater detail below.

The model training system <NUM> can use the information provided by the user devices <NUM> to train a machine learning model in one or more pre-established virtual machine instances <NUM> in some embodiments. In particular, the model training system <NUM> includes a single physical computing device or multiple physical computing devices that are interconnected using one or more computing networks (not shown), where the physical computing device(s) host one or more virtual machine instances <NUM>. The model training system <NUM> can handle the acquisition and configuration of compute capacity (for example, containers, instances, etc., which are described in greater detail below) based on the information describing the computing machine on which to train a machine learning model provided by the user devices <NUM>. The model training system <NUM> can then train machine learning models using the compute capacity, as is described in greater detail below. The model training system <NUM> can automatically scale up and down based on the volume of training requests received from user devices <NUM> via frontend <NUM>, thereby relieving the user from the burden of having to worry about over-utilization (for example, acquiring too little computing resources and suffering performance issues) or under-utilization (for example, acquiring more computing resources than necessary to train the machine learning models, and thus overpaying).

In some embodiments, the virtual machine instances <NUM> are utilized to execute tasks. For example, such tasks can include training a machine learning model. As shown in <FIG>, each virtual machine instance <NUM> includes an operating system (OS) <NUM>, a language runtime <NUM>, and one or more ML training containers <NUM>. Generally, the ML training containers <NUM> are logical units created within a virtual machine instance using the resources available on that instance and can be utilized to isolate execution of a task from other processes (for example, task executions) occurring in the instance. In some embodiments, the ML training containers <NUM> are formed from one or more container images and a top container layer. Each container image may further include one or more image layers, where each image layer represents an executable instruction. As described above, some or all of the executable instructions together represent an algorithm that defines a machine learning model. Changes made to the ML training containers <NUM> (for example, creation of new files, modification of existing files, deletion of files, etc.) are stored in the top container layer. If a ML training container <NUM> is deleted, the top container layer is also deleted. However, the container image(s) that form a portion of the deleted ML training container <NUM> can remain unchanged. The ML training containers <NUM> can be implemented, for example, as Linux containers (LXC), Docker containers, and the like.

The ML training containers <NUM> may include individual a runtime <NUM>, code <NUM>, and dependencies <NUM> needed by the code <NUM> in some embodiments. The runtime <NUM> can be defined by one or more executable instructions that form at least a portion of a container image that is used to form the ML training container <NUM> (for example, the executable instruction(s) in the container image that define the operating system and/or runtime to run in the container formed from the container image). The code <NUM> includes one or more executable instructions that form at least a portion of a container image that is used to form the ML training container <NUM>. For example, the code <NUM> includes the executable instructions in the container image that represent an algorithm that defines a machine learning model, which may reference (or utilize) code or libraries from dependencies <NUM>. The runtime <NUM> is configured to execute the code <NUM> in response to an instruction to begin machine learning model training. Execution of the code <NUM> results in the generation of model data, as described in greater detail below.

In some embodiments, the code <NUM> includes executable instructions that represent algorithms that define different machine learning models. For example, the code <NUM> includes one set of executable instructions that represent a first algorithm that defines a first machine learning model and a second set of executable instructions that represent a second algorithm that defines a second machine learning model. In some embodiments, the virtual machine instance <NUM> executes the code <NUM> and trains all of the machine learning models. In some embodiments, the virtual machine instance <NUM> executes the code <NUM>, selecting one of the machine learning models to train. For example, the virtual machine instance <NUM> can identify a type of training data indicated by the training request and select a machine learning model to train (for example, execute the executable instructions that represent an algorithm that defines the selected machine learning model) that corresponds with the identified type of training data.

In some embodiments, the runtime <NUM> is the same as the runtime <NUM> utilized by the virtual machine instance <NUM>. In some embodiments, the runtime <NUM> is different than the runtime <NUM> utilized by the virtual machine instance <NUM>.

In some embodiments, the model training system <NUM> uses one or more container images included in a training request (or a container image retrieved from the container data store <NUM> in response to a received training request) to create and initialize a ML training container <NUM> in a virtual machine instance <NUM>. For example, the model training system <NUM> creates a ML training container <NUM> that includes the container image(s) and/or a top container layer.

Prior to beginning the training process, in some embodiments, the model training system <NUM> retrieves training data from the location indicated in the training request. For example, the location indicated in the training request can be a location in the training data store <NUM>. Thus, the model training system <NUM> retrieves the training data from the indicated location in the training data store <NUM>. In some embodiments, the model training system <NUM> does not retrieve the training data prior to beginning the training process. Rather, the model training system <NUM> streams the training data from the indicated location during the training process. For example, the model training system <NUM> can initially retrieve a portion of the training data and provide the retrieved portion to the virtual machine instance <NUM> training the machine learning model. Once the virtual machine instance <NUM> has applied and used the retrieved portion or once the virtual machine instance <NUM> is about to use all of the retrieved portion (for example, a buffer storing the retrieved portion is nearly empty), then the model training system <NUM> can retrieve a second portion of the training data and provide the second retrieved portion to the virtual machine instance <NUM>, and so on.

To perform the machine learning model training, the virtual machine instance <NUM> executes code <NUM> stored in the ML training container <NUM> in some embodiments. For example, the code <NUM> includes some or all of the executable instructions that form the container image of the ML training container <NUM> initialized therein. Thus, the virtual machine instance <NUM> executes some or all of the executable instructions that form the container image of the ML training container <NUM> initialized therein to train a machine learning model. The virtual machine instance <NUM> executes some or all of the executable instructions according to the hyperparameter values included in the training request. As an illustrative example, the virtual machine instance <NUM> trains a machine learning model by identifying values for certain parameters (for example, coefficients, weights, centroids, etc.). The identified values depend on hyperparameters that define how the training is performed. Thus, the virtual machine instance <NUM> can execute the executable instructions to initiate a machine learning model training process, where the training process is run using the hyperparameter values included in the training request. Execution of the executable instructions can include the virtual machine instance <NUM> applying the training data retrieved by the model training system <NUM> as input parameters to some or all of the instructions being executed.

In some embodiments, executing the executable instructions causes the virtual machine instance <NUM> (for example, the ML training container <NUM>) to generate model data. For example, the ML training container <NUM> generates model data and stores the model data in a file system of the ML training container <NUM>. The model data includes characteristics of the machine learning model being trained, such as a number of layers in the machine learning model, hyperparameters of the machine learning model, coefficients of the machine learning model, weights of the machine learning model, and/or the like. In particular, the generated model data includes values for the characteristics that define a machine learning model being trained. In some embodiments, executing the executable instructions causes a modification to the ML training container <NUM> such that the model data is written to the top container layer of the ML training container <NUM> and/or the container image(s) that forms a portion of the ML training container <NUM> is modified to include the model data.

The virtual machine instance <NUM> (or the model training system <NUM> itself) pulls the generated model data from the ML training container <NUM> and stores the generated model data in the training model data store <NUM> in an entry associated with the virtual machine instance <NUM> and/or the machine learning model being trained. In some embodiments, the virtual machine instance <NUM> generates a single file that includes model data and stores the single file in the training model data store <NUM>. In some embodiments, the virtual machine instance <NUM> generates multiple files during the course of training a machine learning model, where each file includes model data. In some embodiments, each model data file includes the same or different model data information (for example, one file identifies the structure of an algorithm, another file includes a list of coefficients, etc.). The virtual machine instance <NUM> can package the multiple files into a single file once training is complete and store the single file in the training model data store <NUM>. Alternatively, the virtual machine instance <NUM> stores the multiple files in the training model data store <NUM>. The virtual machine instance <NUM> stores the file(s) in the training model data store <NUM> while the training process is ongoing and/or after the training process is complete.

In some embodiments, the virtual machine instance <NUM> regularly stores model data file(s) in the training model data store <NUM> as the training process is ongoing. Thus, model data file(s) can be stored in the training model data store <NUM> at different times during the training process. Each set of model data files corresponding to a particular time or each set of model data files present in the training model data store <NUM> as of a particular time could be checkpoints that represent different versions of a partially-trained machine learning model during different stages of the training process. Accordingly, before training is complete, a user, via the user devices <NUM> can submit a deployment and/or execution request in a manner as described below to deploy and/or execute a version of a partially trained machine learning model (for example, a machine learning model trained as of a certain stage in the training process). A version of a partially-trained machine learning model can be based on some or all of the model data files stored in the training model data store <NUM>.

In some embodiments, a virtual machine instance <NUM> executes code <NUM> stored in a plurality of ML training containers <NUM>. For example, the algorithm included in the container image can be in a format that allows for the parallelization of the training process. Thus, the model training system <NUM> can create multiple copies of the container image provided in a training request and cause the virtual machine instance <NUM> to load each container image copy in a separate ML training container <NUM>. The virtual machine instance <NUM> can then execute, in parallel, the code <NUM> stored in the ML training containers <NUM>. The virtual machine instance <NUM> can further provide configuration information to each ML training container <NUM> (for example, information indicating that N ML training containers <NUM> are collectively training a machine learning model and that a particular ML training container <NUM> receiving the configuration information is ML training container <NUM> number X of N), which can be included in the resulting model data. By parallelizing the training process, the model training system <NUM> can significantly reduce the training time in some embodiments.

In some embodiments, a plurality of virtual machine instances <NUM> execute code <NUM> stored in a plurality of ML training containers <NUM>. For example, the resources used to train a particular machine learning model can exceed the limitations of a single virtual machine instance <NUM>. However, the algorithm included in the container image can be in a format that allows for the parallelization of the training process. Thus, the model training system <NUM> can create multiple copies of the container image provided in a training request, initialize multiple virtual machine instances <NUM>, and cause each virtual machine instance <NUM> to load a container image copy in one or more separate ML training containers <NUM>. The virtual machine instances <NUM> can then each execute the code <NUM> stored in the ML training containers <NUM> in parallel. The model training system <NUM> can further provide configuration information to each ML training container <NUM> via the virtual machine instances <NUM> (for example, information indicating that N ML training containers <NUM> are collectively training a machine learning model and that a particular ML training container <NUM> receiving the configuration information is ML training container <NUM> number X of N, information indicating that M virtual machine instances <NUM> are collectively training a machine learning model and that a particular ML training container <NUM> receiving the configuration information is initialized in virtual machine instance <NUM> number Y of M, etc.), which can be included in the resulting model data. As described above, by parallelizing the training process, the model training system <NUM> can significantly reduce the training time in some embodiments.

In some embodiments, the model training system <NUM> includes a plurality of physical computing devices and two or more of the physical computing devices hosts one or more virtual machine instances <NUM> that execute the code <NUM>. Thus, the parallelization can occur over different physical computing devices in addition to over different virtual machine instances <NUM> and/or ML training containers <NUM>.

In some embodiments, the model training system <NUM> includes a ML model evaluator <NUM>. The ML model evaluator <NUM> can monitor virtual machine instances <NUM> as machine learning models are being trained, obtaining the generated model data and processing the obtained model data to generate model metrics. For example, the model metrics can include quality metrics, such as an error rate of the machine learning model being trained, a statistical distribution of the machine learning model being trained, a latency of the machine learning model being trained, a confidence level of the machine learning model being trained (for example, a level of confidence that the accuracy of the machine learning model being trained is known, etc. The ML model evaluator <NUM> can obtain the model data for a machine learning model being trained and evaluation data from the training data store <NUM>. The evaluation data is separate from the data used to train a machine learning model and includes both input data and expected outputs (for example, known results), and thus the ML model evaluator <NUM> can define a machine learning model using the model data and execute the machine learning model by providing the input data as inputs to the machine learning model. The ML model evaluator <NUM> can then compare the outputs of the machine learning model to the expected outputs and determine one or more quality metrics of the machine learning model being trained based on the comparison (for example, the error rate can be a difference or distance between the machine learning model outputs and the expected outputs).

The ML model evaluator <NUM> periodically generates model metrics during the training process and stores the model metrics in the training metrics data store <NUM> in some embodiments. While the machine learning model is being trained, a user, via the user devices <NUM>, can access and retrieve the model metrics from the training metrics data store <NUM>. The user can then use the model metrics to determine whether to adjust the training process and/or to stop the training process. For example, the model metrics can indicate that the machine learning model is performing poorly (for example, has an error rate above a threshold value, has a statistical distribution that is not an expected or desired distribution (for example, not a binomial distribution, a Poisson distribution, a geometric distribution, a normal distribution, Gaussian distribution, etc.), has an execution latency above a threshold value, has a confidence level below a threshold value)) and/or is performing progressively worse (for example, the quality metric continues to worsen over time). In response, in some embodiments, the user, via the user devices <NUM>, can transmit a request to the model training system <NUM> to modify the machine learning model being trained (for example, transmit a modification request). The request can include a new or modified container image, a new or modified algorithm, new or modified hyperparameter(s), and/or new or modified information describing the computing machine on which to train a machine learning model. The model training system <NUM> can modify the machine learning model accordingly. For example, the model training system <NUM> can cause the virtual machine instance <NUM> to optionally delete an existing ML training container <NUM>, create and initialize a new ML training container <NUM> using some or all of the information included in the request, and execute the code <NUM> stored in the new ML training container <NUM> to restart the machine learning model training process. As another example, the model training system <NUM> can cause the virtual machine instance <NUM> to modify the execution of code stored in an existing ML training container <NUM> according to the data provided in the modification request. In some embodiments, the user, via the user devices <NUM>, can transmit a request to the model training system <NUM> to stop the machine learning model training process. The model training system <NUM> can then instruct the virtual machine instance <NUM> to delete the ML training container <NUM> and/or to delete any model data stored in the training model data store <NUM>.

As described below, in some embodiments, the model data stored in the training model data store <NUM> is used by the model hosting system <NUM> to deploy machine learning models. Alternatively or additionally, a user device <NUM> or another computing device (not shown) can retrieve the model data from the training model data store <NUM> to implement a learning algorithm in an external device. As an illustrative example, a robotic device can include sensors to capture input data. A user device <NUM> can retrieve the model data from the training model data store <NUM> and store the model data in the robotic device. The model data defines a machine learning model. Thus, the robotic device can provide the captured input data as an input to the machine learning model, resulting in an output. The robotic device can then perform an action (for example, move forward, raise an arm, generate a sound, etc.) based on the resulting output.

While the virtual machine instances <NUM> are shown in <FIG> as a single grouping of virtual machine instances <NUM>, some embodiments of the present application separate virtual machine instances <NUM> that are actively assigned to execute tasks from those virtual machine instances <NUM> that are not actively assigned to execute tasks. For example, those virtual machine instances <NUM> actively assigned to execute tasks are grouped into an "active pool," while those virtual machine instances <NUM> not actively assigned to execute tasks are placed within a "warming pool. " In some embodiments, those virtual machine instances <NUM> within the warming pool can be pre-initialized with an operating system, language runtimes, and/or other software required to enable rapid execution of tasks (for example, rapid initialization of machine learning model training in ML training container(s) <NUM>) in response to training requests.

In some embodiments, the model training system <NUM> includes a processing unit, a network interface, a computer-readable medium drive, and an input/output device interface, all of which can communicate with one another by way of a communication bus. The network interface can provide connectivity to one or more networks or computing systems. The processing unit can thus receive information and instructions from other computing systems or services (for example, user devices <NUM>, the model hosting system <NUM>, etc.). The processing unit can also communicate to and from a memory of a virtual machine instance <NUM> and further provide output information for an optional display via the input/output device interface. The input/output device interface can also accept input from an optional input device. The memory can contain computer program instructions (grouped as modules in some embodiments) that the processing unit executes in order to implement one or more aspects of the present disclosure.

In some embodiments, the model hosting system <NUM> includes a single physical computing device or multiple physical computing devices that are interconnected using one or more computing networks (not shown), where the physical computing device(s) host one or more virtual machine instances <NUM>. The model hosting system <NUM> can handle the acquisition and configuration of compute capacity (for example, containers, instances, etc.) based on demand for the execution of trained machine learning models. The model hosting system <NUM> can then execute machine learning models using the compute capacity, as is described in greater detail below. The model hosting system <NUM> can automatically scale up and down based on the volume of execution requests received from user devices <NUM> via frontend of the model hosting system <NUM>, thereby relieving the user from the burden of having to worry about over-utilization (for example, acquiring too little computing resources and suffering performance issues) or under-utilization (for example, acquiring more computing resources than necessary to run the machine learning models, and thus overpaying).

In some embodiments, the virtual machine instances <NUM> are utilized to execute tasks. For example, such tasks can include executing a machine learning model. As shown in <FIG>, each virtual machine instance <NUM> includes an operating system (OS) <NUM>, a language runtime <NUM>, and one or more ML scoring containers <NUM>. The ML scoring containers <NUM> are similar to the ML training containers <NUM> in that the ML scoring containers <NUM> are logical units created within a virtual machine instance using the resources available on that instance and can be utilized to isolate execution of a task from other processes (for example, task executions) occurring in the instance. In some embodiments, the ML scoring containers <NUM> are formed from one or more container images and a top container layer. Each container image further includes one or more image layers, where each image layer represents an executable instruction. As described above, some or all of the executable instructions together represent an algorithm that defines a machine learning model. Changes made to the ML scoring containers <NUM> (for example, creation of new files, modification of existing files, deletion of files, etc.) are stored in the top container layer. If a ML scoring container <NUM> is deleted, the top container layer is also deleted. However, the container image(s) that form a portion of the deleted ML scoring container <NUM> can remain unchanged. The ML scoring containers <NUM> can be implemented, for example, as Linux containers.

The ML scoring containers <NUM> each include a runtime <NUM>, code <NUM>, and dependencies <NUM> (for example, supporting software such as libraries) needed by the code <NUM> in some embodiments. The runtime <NUM> can be defined by one or more executable instructions that form at least a portion of a container image that is used to form the ML scoring container <NUM> (for example, the executable instruction(s) in the container image that define the operating system and/or runtime to run in the container formed from the container image). The code <NUM> includes one or more executable instructions that form at least a portion of a container image that is used to form the ML scoring container <NUM>. For example, the code <NUM> includes the executable instructions in the container image that represent an algorithm that defines a machine learning model, which may reference dependencies <NUM>. The code <NUM> can also include model data that represent characteristics of the defined machine learning model, as described in greater detail below. The runtime <NUM> is configured to execute the code <NUM> in response to an instruction to begin execution of a machine learning model. Execution of the code <NUM> results in the generation of outputs (for example, predicted results), as described in greater detail below.

In some embodiments, the runtime <NUM> is the same as the runtime <NUM> utilized by the virtual machine instance <NUM>. In some embodiments, runtime <NUM> is different than the runtime <NUM> utilized by the virtual machine instance <NUM>.

In some embodiments, the model hosting system <NUM> uses one or more container images included in a deployment request (or a container image retrieved from the container data store <NUM> in response to a received deployment request) to create and initialize a ML scoring container <NUM> in a virtual machine instance <NUM>. For example, the model hosting system <NUM> creates a ML scoring container <NUM> that includes the container image(s) and/or a top container layer.

As described above, a user device <NUM> can submit a deployment request and/or an execution request to the model hosting system <NUM> via the frontend in some embodiments. A deployment request causes the model hosting system <NUM> to deploy a trained machine learning model into a virtual machine instance <NUM>. For example, the deployment request can include an identification of an endpoint (for example, an endpoint name, such as an HTTP endpoint name) and an identification of one or more trained machine learning models (for example, a location of one or more model data files stored in the training model data store <NUM>). Optionally, the deployment request also includes an identification of one or more container images stored in the container data store <NUM>.

Upon receiving the deployment request, the model hosting system <NUM> initializes ones or more ML scoring containers <NUM> in one or more hosted virtual machine instance <NUM>. In embodiments in which the deployment request includes an identification of one or more container images, the model hosting system <NUM> forms the ML scoring container(s) <NUM> from the identified container image(s). For example, a container image identified in a deployment request can be the same container image used to form an ML training container <NUM> used to train the machine learning model corresponding to the deployment request. Thus, the code <NUM> of the ML scoring container(s) <NUM> includes one or more executable instructions in the container image(s) that represent an algorithm that defines a machine learning model. In embodiments in which the deployment request does not include an identification of a container image, the model hosting system <NUM> forms the ML scoring container(s) <NUM> from one or more container images stored in the container data store <NUM> that are appropriate for executing the identified trained machine learning model(s). For example, an appropriate container image can be a container image that includes executable instructions that represent an algorithm that defines the identified trained machine learning model(s).

The model hosting system <NUM> further forms the ML scoring container(s) <NUM> by retrieving model data corresponding to the identified trained machine learning model(s) in some embodiments. For example, the deployment request can identify a location of model data file(s) stored in the training model data store <NUM>. In embodiments in which a single model data file is identified in the deployment request, the model hosting system <NUM> retrieves the identified model data file from the training model data store <NUM> and inserts the model data file into a single ML scoring container <NUM>, which forms a portion of code <NUM>. In some embodiments, the model data file is archived or compressed (for example, formed from a package of individual files). Thus, the model hosting system <NUM> unarchives or decompresses the model data file to obtain multiple individual files and inserts the individual files into the ML scoring container <NUM>. In some embodiments, the model hosting system <NUM> stores the model data file in the same location as the location in which the model data file was stored in the ML training container <NUM> that generated the model data file. For example, the model data file initially was stored in the top container layer of the ML training container <NUM> at a certain offset, and the model hosting system <NUM> then stores the model data file in the top container layer of the ML scoring container <NUM> at the same offset.

In embodiments in which multiple model data files are identified in the deployment request, the model hosting system <NUM> retrieves the identified model data files from the training model data store <NUM>. The model hosting system <NUM> can insert the model data files into the same ML scoring container <NUM>, into different ML scoring containers <NUM> initialized in the same virtual machine instance <NUM>, or into different ML scoring containers <NUM> initialized in different virtual machine instances <NUM>. As an illustrative example, the deployment request can identify multiple model data files corresponding to different trained machine learning models because the trained machine learning models are related (for example, the output of one trained machine learning model is used as an input to another trained machine learning model). Thus, the user may desire to deploy multiple machine learning models to eventually receive a single output that relies on the outputs of multiple machine learning models.

In some embodiments, the model hosting system <NUM> associates the initialized ML scoring container(s) <NUM> with the endpoint identified in the deployment request. For example, each of the initialized ML scoring container(s) <NUM> can be associated with a network address. The model hosting system <NUM> can map the network address(es) to the identified endpoint, and the model hosting system <NUM> or another system (for example, a routing system, not shown) can store the mapping. Thus, a user device <NUM> can refer to trained machine learning model(s) stored in the ML scoring container(s) <NUM> using the endpoint. This allows for the network address of an ML scoring container <NUM> to change without causing the user operating the user device <NUM> to change the way in which the user refers to a trained machine learning model.

Once the ML scoring container(s) <NUM> are initialized, the ML scoring container(s) <NUM> are ready to execute trained machine learning model(s). In some embodiments, the user device <NUM> transmits an execution request to the model hosting system <NUM> via the frontend, where the execution request identifies an endpoint and includes an input to a machine learning model (for example, a set of input data). The model hosting system <NUM> or another system (for example, a routing system, not shown) can obtain the execution request, identify the ML scoring container(s) <NUM> corresponding to the identified endpoint, and route the input to the identified ML scoring container(s) <NUM>.

In some embodiments, a virtual machine instance <NUM> executes the code <NUM> stored in an identified ML scoring container <NUM> in response to the model hosting system <NUM> receiving the execution request. In particular, execution of the code <NUM> causes the executable instructions in the code <NUM> corresponding to the algorithm to read the model data file stored in the ML scoring container <NUM>, use the input included in the execution request as an input parameter, and generate a corresponding output. As an illustrative example, the algorithm can include coefficients, weights, layers, cluster centroids, and/or the like. The executable instructions in the code <NUM> corresponding to the algorithm can read the model data file to determine values for the coefficients, weights, layers, cluster centroids, and/or the like. The executable instructions can include input parameters, and the input included in the execution request can be supplied by the virtual machine instance <NUM> as the input parameters. With the machine learning model characteristics and the input parameters provided, execution of the executable instructions by the virtual machine instance <NUM> can be completed, resulting in an output.

In some embodiments, the virtual machine instance <NUM> stores the output in the model prediction data store <NUM>. Alternatively or in addition, the virtual machine instance <NUM> transmits the output to the user device <NUM> that submitted the execution result via the frontend.

In some embodiments, the execution request corresponds to a group of related trained machine learning models. Thus, the ML scoring container <NUM> can transmit the output to a second ML scoring container <NUM> initialized in the same virtual machine instance <NUM> or in a different virtual machine instance <NUM>. The virtual machine instance <NUM> that initialized the second ML scoring container <NUM> can then execute second code <NUM> stored in the second ML scoring container <NUM>, providing the received output as an input parameter to the executable instructions in the second code <NUM>. The second ML scoring container <NUM> further includes a model data file stored therein, which is read by the executable instructions in the second code <NUM> to determine values for the characteristics defining the machine learning model. Execution of the second code <NUM> results in a second output. The virtual machine instance <NUM> that initialized the second ML scoring container <NUM> can then transmit the second output to the model prediction data store <NUM> and/or the user device <NUM> via the frontend (for example, if no more trained machine learning models are needed to generate an output) or transmit the second output to a third ML scoring container <NUM> initialized in the same or different virtual machine instance <NUM> (for example, if outputs from one or more additional trained machine learning models are needed), and the above-referenced process can be repeated with respect to the third ML scoring container <NUM>.

While the virtual machine instances <NUM> are shown in <FIG> as a single grouping of virtual machine instances <NUM>, some embodiments of the present application separate virtual machine instances <NUM> that are actively assigned to execute tasks from those virtual machine instances <NUM> that are not actively assigned to execute tasks. For example, those virtual machine instances <NUM> actively assigned to execute tasks are grouped into an "active pool," while those virtual machine instances <NUM> not actively assigned to execute tasks are placed within a "warming pool. " In some embodiments, those virtual machine instances <NUM> within the warming pool can be pre-initialized with an operating system, language runtimes, and/or other software required to enable rapid execution of tasks (for example, rapid initialization of ML scoring container(s) <NUM>, rapid execution of code <NUM> in ML scoring container(s), etc.) in response to deployment and/or execution requests.

In some embodiments, the model hosting system <NUM> includes a processing unit, a network interface, a computer-readable medium drive, and an input/output device interface, all of which can communicate with one another by way of a communication bus. The network interface can provide connectivity to one or more networks or computing systems. The processing unit can thus receive information and instructions from other computing systems or services (for example, user devices <NUM>, the model training system <NUM>, etc.). The processing unit can also communicate to and from a memory of a virtual machine instance <NUM> and further provide output information for an optional display via the input/output device interface. The input/output device interface can also accept input from an optional input device. The memory can contain computer program instructions (grouped as modules in some embodiments) that the processing unit executes in order to implement one or more aspects of the present disclosure.

In some embodiments, the operating environment supports many different types of machine learning models, such as multi arm bandit models, reinforcement learning models, ensemble machine learning models, deep learning models, and/or the like.

The model training system <NUM> and the model hosting system <NUM> depicted in <FIG> are not meant to be limiting. For example, the model training system <NUM> and/or the model hosting system <NUM> could also operate within a computing environment having a fewer or greater number of devices than are illustrated in <FIG>. Thus, the depiction of the model training system <NUM> and/or the model hosting system <NUM> in <FIG> may be taken as illustrative and not limiting to the present disclosure. For example, the model training system <NUM> and/or the model hosting system <NUM> or various constituents thereof could implement various web services components, hosted or "cloud" computing environments, and/or peer-to-peer network configurations to implement at least a portion of the processes described herein. In some embodiments, the model training system <NUM> and/or the model hosting system <NUM> are implemented directly in hardware or software executed by hardware devices and may, for instance, include one or more physical or virtual servers implemented on physical computer hardware configured to execute computer-executable instructions for performing the various features that are described herein. The one or more servers can be geographically dispersed or geographically co-located, for instance, in one or more points of presence (POPs) or regional data centers.

The frontend <NUM> processes all training requests received from user devices <NUM> and provisions virtual machine instances <NUM>. In some embodiments, the frontend <NUM> serves as a front door to all the other services provided by the model training system <NUM>. The frontend <NUM> processes the requests and makes sure that the requests are properly authorized. For example, the frontend <NUM> may determine whether the user associated with the training request is authorized to initiate the training process.

Similarly, frontend processes all deployment and execution requests received from user devices <NUM> and provisions virtual machine instances <NUM>. In some embodiments, the frontend serves as a front door to all the other services provided by the model hosting system <NUM>. The frontend processes the requests and makes sure that the requests are properly authorized. For example, the frontend may determine whether the user associated with a deployment request or an execution request is authorized to access the indicated model data and/or to execute the indicated machine learning model.

The training data store <NUM> stores training data and/or evaluation data. The training data can be data used to train machine learning models and evaluation data can be data used to evaluate the performance of machine learning models. In some embodiments, the training data and the evaluation data have common data. In some embodiments, the training data and the evaluation data do not have common data. In some embodiments, the training data includes input data and expected outputs. While the training data store <NUM> is depicted as being located external to the model training system <NUM> and the model hosting system <NUM>, this is not meant to be limiting. For example, in some embodiments not shown, the training data store <NUM> is located internal to at least one of the model training system <NUM> or the model hosting system <NUM>.

In some embodiments, the training metrics data store <NUM> stores model metrics. While the training metrics data store <NUM> is depicted as being located external to the model training system <NUM> and the model hosting system <NUM>, this is not meant to be limiting. For example, in some embodiments not shown, the training metrics data store <NUM> is located internal to at least one of the model training system <NUM> or the model hosting system <NUM>.

The container data store <NUM> stores container images, such as container images used to form ML training containers <NUM> and/or ML scoring containers <NUM>, that can be retrieved by various virtual machine instances <NUM> and/or <NUM>. While the container data store <NUM> is depicted as being located external to the model training system <NUM> and the model hosting system <NUM>, this is not meant to be limiting. For example, in some embodiments not shown, the container data store <NUM> is located internal to at least one of the model training system <NUM> and the model hosting system <NUM>.

The training model data store <NUM> stores model data files. In some embodiments, some of the model data files are comprised of a single file, while other model data files are packages of multiple individual files. While the training model data store <NUM> is depicted as being located external to the model training system <NUM> and the model hosting system <NUM>, this is not meant to be limiting. For example, in some embodiments not shown, the training model data store <NUM> is located internal to at least one of the model training system <NUM> or the model hosting system <NUM>.

The model prediction data store <NUM> stores outputs (for example, execution results) generated by the ML scoring containers <NUM> in some embodiments. While the model prediction data store <NUM> is depicted as being located external to the model training system <NUM> and the model hosting system <NUM>, this is not meant to be limiting. For example, in some embodiments not shown, the model prediction data store <NUM> is located internal to at least one of the model training system <NUM> and the model hosting system <NUM>.

While the model training system <NUM>, the model hosting system <NUM>, the training data store <NUM>, the training metrics data store <NUM>, the container data store <NUM>, the training model data store <NUM>, and the model prediction data store <NUM> are illustrated as separate components, this is not meant to be limiting. In some embodiments, any one or all of these components can be combined to perform the functionality described herein. For example, any one or all of these components can be implemented by a single computing device, or by multiple distinct computing devices, such as computer servers, logically or physically grouped together to collectively operate as a server system. Any one or all of these components can communicate via a shared internal network, and the collective system (for example, also referred to herein as a machine learning service) can communicate with one or more of the user devices <NUM> via the one or more network(s) <NUM>.

Various example user devices <NUM> are shown in <FIG>, including a desktop computer, laptop, and a mobile phone, each provided by way of illustration. In general, the user devices <NUM> can be any computing device such as a desktop, laptop or tablet computer, personal computer, wearable computer, server, personal digital assistant (PDA), hybrid PDA/mobile phone, mobile phone, electronic book reader, set-top box, voice command device, camera, digital media player, and the like. In some embodiments, the model training system <NUM> and/or the model hosting system <NUM> provides the user devices <NUM> with one or more user interfaces, command-line interfaces (CLI), application programing interfaces (API), and/or other programmatic interfaces for submitting training requests, deployment requests, and/or execution requests. In some embodiments, the user devices <NUM> can execute a stand-alone application that interacts with the model training system <NUM> and/or the model hosting system <NUM> for submitting training requests, deployment requests, and/or execution requests.

In some embodiments, the network <NUM> includes any wired network, wireless network, or combination thereof. For example, the network <NUM> may be a personal area network, local area network, wide area network, over-the-air broadcast network (for example, for radio or television), cable network, satellite network, cellular telephone network, or combination thereof. As a further example, the network <NUM> may be a publicly accessible network of linked networks, possibly operated by various distinct parties, such as the Internet. In some embodiments, the network <NUM> may be a private or semi-private network, such as a corporate or university intranet. The network <NUM> may include one or more wireless networks, such as a Global System for Mobile Communications (GSM) network, a Code Division Multiple Access (CDMA) network, a Long Term Evolution (LTE) network, or any other type of wireless network. The network <NUM> can use protocols and components for communicating via the Internet or any of the other aforementioned types of networks. For example, the protocols used by the network <NUM> may include HTTP, HTTP Secure (HTTPS), Message Queue Telemetry Transport (MQTT), Constrained Application Protocol (CoAP), and the like. Protocols and components for communicating via the Internet or any of the other aforementioned types of communication networks are well known to those skilled in the art and, thus, are not described in more detail herein.

<FIG> illustrates an example provider network (or "service provider system") environment according to some embodiments. A provider network <NUM> may provide resource virtualization to customers via one or more virtualization services <NUM> that allow customers to purchase, rent, or otherwise obtain instances <NUM> of virtualized resources, including but not limited to computation and storage resources, implemented on devices within the provider network or networks in one or more data centers. Local Internet Protocol (IP) addresses <NUM> may be associated with the resource instances <NUM>; the local IP addresses are the internal network addresses of the resource instances <NUM> on the provider network <NUM>. In some embodiments, the provider network <NUM> may also provide public IP addresses <NUM> and/or public IP address ranges (e.g., Internet Protocol version <NUM> (IPv4) or Internet Protocol version <NUM> (IPv6) addresses) that customers may obtain from the provider <NUM>.

Conventionally, the provider network <NUM>, via the virtualization services <NUM>, may allow a customer of the service provider (e.g., a customer that operates one or more client networks 850A-850C including one or more customer device(s) <NUM>) to dynamically associate at least some public IP addresses <NUM> assigned or allocated to the customer with particular resource instances <NUM> assigned to the customer. The provider network <NUM> may also allow the customer to remap a public IP address <NUM>, previously mapped to one virtualized computing resource instance <NUM> allocated to the customer, to another virtualized computing resource instance <NUM> that is also allocated to the customer. Using the virtualized computing resource instances <NUM> and public IP addresses <NUM> provided by the service provider, a customer of the service provider such as the operator of customer network(s) 850A-850C may, for example, implement customer-specific applications and present the customer's applications on an intermediate network <NUM>, such as the Internet. Other network entities <NUM> on the intermediate network <NUM> may then generate traffic to a destination public IP address <NUM> published by the customer network(s) 850A-850C; the traffic is routed to the service provider data center, and at the data center is routed, via a network substrate, to the local IP address <NUM> of the virtualized computing resource instance <NUM> currently mapped to the destination public IP address <NUM>. Similarly, response traffic from the virtualized computing resource instance <NUM> may be routed via the network substrate back onto the intermediate network <NUM> to the source entity <NUM>.

Local IP addresses, as used herein, refer to the internal or "private" network addresses, for example, of resource instances in a provider network. Local IP addresses can be within address blocks reserved by Internet Engineering Task Force (IETF) Request for Comments (RFC) <NUM> and/or of an address format specified by IETF RFC <NUM> and may be mutable within the provider network. Network traffic originating outside the provider network is not directly routed to local IP addresses; instead, the traffic uses public IP addresses that are mapped to the local IP addresses of the resource instances. The provider network may include networking devices or appliances that provide network address translation (NAT) or similar functionality to perform the mapping from public IP addresses to local IP addresses and vice versa.

Public IP addresses are Internet mutable network addresses that are assigned to resource instances, either by the service provider or by the customer. Traffic routed to a public IP address is translated, for example via <NUM>:<NUM> NAT, and forwarded to the respective local IP address of a resource instance.

Some public IP addresses may be assigned by the provider network infrastructure to particular resource instances; these public IP addresses may be referred to as standard public IP addresses, or simply standard IP addresses. In some embodiments, the mapping of a standard IP address to a local IP address of a resource instance is the default launch configuration for all resource instance types.

At least some public IP addresses may be allocated to or obtained by customers of the provider network <NUM>; a customer may then assign their allocated public IP addresses to particular resource instances allocated to the customer. These public IP addresses may be referred to as customer public IP addresses, or simply customer IP addresses. Instead of being assigned by the provider network <NUM> to resource instances as in the case of standard IP addresses, customer IP addresses may be assigned to resource instances by the customers, for example via an API provided by the service provider. Unlike standard IP addresses, customer IP addresses are allocated to customer accounts and can be remapped to other resource instances by the respective customers as necessary or desired. A customer IP address is associated with a customer's account, not a particular resource instance, and the customer controls that IP address until the customer chooses to release it. Unlike conventional static IP addresses, customer IP addresses allow the customer to mask resource instance or availability zone failures by remapping the customer's public IP addresses to any resource instance associated with the customer's account. The customer IP addresses, for example, enable a customer to engineer around problems with the customer's resource instances or software by remapping customer IP addresses to replacement resource instances.

<FIG> is a block diagram of an example provider network that provides a storage service and a hardware virtualization service to customers, according to some embodiments. Hardware virtualization service <NUM> provides multiple computation resources <NUM> (e.g., VMs) to customers. The computation resources <NUM> may, for example, be rented or leased to customers of the provider network <NUM> (e.g., to a customer that implements customer network <NUM>). Each computation resource <NUM> may be provided with one or more local IP addresses. Provider network <NUM> may be configured to route packets from the local IP addresses of the computation resources <NUM> to public Internet destinations, and from public Internet sources to the local IP addresses of computation resources <NUM>.

Provider network <NUM> may provide a customer network <NUM>, for example coupled to intermediate network <NUM> via local network <NUM>, the ability to implement virtual computing systems <NUM> via hardware virtualization service <NUM> coupled to intermediate network <NUM> and to provider network <NUM>. In some embodiments, hardware virtualization service <NUM> may provide one or more APIs <NUM>, for example a web services interface, via which a customer network <NUM> may access functionality provided by the hardware virtualization service <NUM>, for example via a console <NUM> (e.g., a web-based application, standalone application, mobile application, etc.). In some embodiments, at the provider network <NUM>, each virtual computing system <NUM> at customer network <NUM> may correspond to a computation resource <NUM> that is leased, rented, or otherwise provided to customer network <NUM>.

From an instance of a virtual computing system <NUM> and/or another customer device <NUM> (e.g., via console <NUM>), the customer may access the functionality of storage service <NUM>, for example via one or more APIs <NUM>, to access data from and store data to storage resources 918A-918N of a virtual data store <NUM> (e.g., a folder or "bucket", a virtualized volume, a database, etc.) provided by the provider network <NUM>. In some embodiments, a virtualized data store gateway (not shown) may be provided at the customer network <NUM> that may locally cache at least some data, for example frequently-accessed or critical data, and that may communicate with storage service <NUM> via one or more communications channels to upload new or modified data from a local cache so that the primary store of data (virtualized data store <NUM>) is maintained. In some embodiments, a user, via a virtual computing system <NUM> and/or on another customer device <NUM>, may mount and access virtual data store <NUM> volumes via storage service <NUM> acting as a storage virtualization service, and these volumes may appear to the user as local (virtualized) storage <NUM>.

While not shown in <FIG>, the virtualization service(s) may also be accessed from resource instances within the provider network <NUM> via API(s) <NUM>. For example, a customer, appliance service provider, or other entity may access a virtualization service from within a respective virtual network on the provider network <NUM> via an API <NUM> to request allocation of one or more resource instances within the virtual network or within another virtual network.

In some embodiments, a system that implements a portion or all of the techniques described herein may include a general-purpose computer system that includes or is configured to access one or more computer-accessible media, such as computer system <NUM> illustrated in <FIG>. In the illustrated embodiment, computer system <NUM> includes one or more processors <NUM> coupled to a system memory <NUM> via an input/output (I/O) interface <NUM>. Computer system <NUM> further includes a network interface <NUM> coupled to I/O interface <NUM>. While <FIG> shows computer system <NUM> as a single computing device, in various embodiments a computer system <NUM> may include one computing device or any number of computing devices configured to work together as a single computer system <NUM>.

In various embodiments, computer system <NUM> may be a uniprocessor system including one processor <NUM>, or a multiprocessor system including several processors <NUM> (e.g., two, four, eight, or another suitable number). Processors <NUM> may be any suitable processors capable of executing instructions. For example, in various embodiments, processors <NUM> may be general-purpose or embedded processors implementing any of a variety of instruction set architectures (ISAs), such as the x86, ARM, PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, each of processors <NUM> may commonly, but not necessarily, implement the same ISA.

System memory <NUM> may store instructions and data accessible by processor(s) <NUM>. In various embodiments, system memory <NUM> may be implemented using any suitable memory technology, such as random-access memory (RAM), static RAM (SRAM), synchronous dynamic RAM (SDRAM), nonvolatile/Flash-type memory, or any other type of memory. In the illustrated embodiment, program instructions and data implementing one or more desired functions, such as those methods, techniques, and data described above are shown stored within system memory <NUM> as database service code <NUM> and data <NUM>.

In one embodiment, I/O interface <NUM> may be configured to coordinate I/O traffic between processor <NUM>, system memory <NUM>, and any peripheral devices in the device, including network interface <NUM> or other peripheral interfaces. In some embodiments, I/O interface <NUM> may perform any necessary protocol, timing or other data transformations to convert data signals from one component (e.g., system memory <NUM>) into a format suitable for use by another component (e.g., processor <NUM>). In some embodiments, I/O interface <NUM> may include support for devices attached through various types of peripheral buses, such as a variant of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard, for example. In some embodiments, the function of I/O interface <NUM> may be split into two or more separate components, such as a north bridge and a south bridge, for example. Also, in some embodiments some or all of the functionality of I/O interface <NUM>, such as an interface to system memory <NUM>, may be incorporated directly into processor <NUM>.

Network interface <NUM> may be configured to allow data to be exchanged between computer system <NUM> and other devices <NUM> attached to a network or networks <NUM>, such as other computer systems or devices as illustrated in <FIG>, for example. In various embodiments, network interface <NUM> may support communication via any suitable wired or wireless general data networks, such as types of Ethernet network, for example. Additionally, network interface <NUM> may support communication via telecommunications/telephony networks such as analog voice networks or digital fiber communications networks, via storage area networks (SANs) such as Fibre Channel SANs, or via I/O any other suitable type of network and/or protocol.

In some embodiments, a computer system <NUM> includes one or more offload cards <NUM> (including one or more processors <NUM>, and possibly including the one or more network interfaces <NUM>) that are connected using an I/O interface <NUM> (e.g., a bus implementing a version of the Peripheral Component Interconnect - Express (PCI-E) standard, or another interconnect such as a QuickPath interconnect (QPI) or UltraPath interconnect (UPI)). For example, in some embodiments the computer system <NUM> may act as a host electronic device (e.g., operating as part of a hardware virtualization service) that hosts compute instances, and the one or more offload cards <NUM> execute a virtualization manager that can manage compute instances that execute on the host electronic device. As an example, in some embodiments the offload card(s) <NUM> can perform compute instance management operations such as pausing and/or un-pausing compute instances, launching and/or terminating compute instances, performing memory transfer/copying operations, etc. These management operations may, in some embodiments, be performed by the offload card(s) <NUM> in coordination with a hypervisor (e.g., upon a request from a hypervisor) that is executed by the other processors 1010A-1010N of the computer system <NUM>. However, in some embodiments the virtualization manager implemented by the offload card(s) <NUM> can accommodate requests from other entities (e.g., from compute instances themselves), and may not coordinate with (or service) any separate hypervisor.

In some embodiments, system memory <NUM> may be one embodiment of a computer-accessible medium configured to store program instructions and data as described above. However, in other embodiments, program instructions and/or data may be received, sent or stored upon different types of computer-accessible media. Generally speaking, a computer-accessible medium may include non-transitory storage media or memory media such as magnetic or optical media, e.g., disk or DVD/CD coupled to computer system <NUM> via I/O interface <NUM>. A non-transitory computer-accessible storage medium may also include any volatile or non-volatile media such as RAM (e.g., SDRAM, double data rate (DDR) SDRAM, SRAM, etc.), read only memory (ROM), etc., that may be included in some embodiments of computer system <NUM> as system memory <NUM> or another type of memory. Further, a computer-accessible medium may include transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as a network and/or a wireless link, such as may be implemented via network interface <NUM>.

Various embodiments discussed or suggested herein can be implemented in a wide variety of operating environments, which in some cases can include one or more user computers, computing devices, or processing devices which can be used to operate any of a number of applications. User or client devices can include any of a number of general-purpose personal computers, such as desktop or laptop computers running a standard operating system, as well as cellular, wireless, and handheld devices running mobile software and capable of supporting a number of networking and messaging protocols. Such a system also can include a number of workstations running any of a variety of commercially available operating systems and other known applications for purposes such as development and database management. These devices also can include other electronic devices, such as dummy terminals, thin-clients, gaming systems, and/or other devices capable of communicating via a network.

Most embodiments utilize at least one network that would be familiar to those skilled in the art for supporting communications using any of a variety of widely-available protocols, such as Transmission Control Protocol / Internet Protocol (TCP/IP), File Transfer Protocol (FTP), Universal Plug and Play (UPnP), Network File System (NFS), Common Internet File System (CIFS), Extensible Messaging and Presence Protocol (XMPP), AppleTalk, etc. The network(s) can include, for example, a local area network (LAN), a wide-area network (WAN), a virtual private network (VPN), the Internet, an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network, and any combination thereof.

In embodiments utilizing a web server, the web server can run any of a variety of server or mid-tier applications, including HTTP servers, File Transfer Protocol (FTP) servers, Common Gateway Interface (CGI) servers, data servers, Java servers, business application servers, etc. The server(s) also may be capable of executing programs or scripts in response requests from user devices, such as by executing one or more Web applications that may be implemented as one or more scripts or programs written in any programming language, such as Java®, C, C# or C++, or any scripting language, such as Perl, Python, PHP, or TCL, as well as combinations thereof. The server(s) may also include database servers, including without limitation those commercially available from Oracle(R), Microsoft(R), Sybase(R), IBM(R), etc. The database servers may be relational or non-relational (e.g., "NoSQL"), distributed or non-distributed, etc..

Environments disclosed herein can include a variety of data stores and other memory and storage media as discussed above. These can reside in a variety of locations, such as on a storage medium local to (and/or resident in) one or more of the computers or remote from any or all of the computers across the network. In a particular set of embodiments, the information may reside in a storage-area network (SAN) familiar to those skilled in the art. Similarly, any necessary files for performing the functions attributed to the computers, servers, or other network devices may be stored locally and/or remotely, as appropriate. Where a system includes computerized devices, each such device can include hardware elements that may be electrically coupled via a bus, the elements including, for example, at least one central processing unit (CPU), at least one input device (e.g., a mouse, keyboard, controller, touch screen, or keypad), and/or at least one output device (e.g., a display device, printer, or speaker). Such a system may also include one or more storage devices, such as disk drives, optical storage devices, and solid-state storage devices such as random-access memory (RAM) or read-only memory (ROM), as well as removable media devices, memory cards, flash cards, etc..

Such devices also can include a computer-readable storage media reader, a communications device (e.g., a modem, a network card (wireless or wired), an infrared communication device, etc.), and working memory as described above. The computer-readable storage media reader can be connected with, or configured to receive, a computer-readable storage medium, representing remote, local, fixed, and/or removable storage devices as well as storage media for temporarily and/or more permanently containing, storing, transmitting, and retrieving computer-readable information. The system and various devices also typically will include a number of software applications, modules, services, or other elements located within at least one working memory device, including an operating system and application programs, such as a client application or web browser. It should be appreciated that alternate embodiments may have numerous variations from that described above. For example, customized hardware might also be used and/or particular elements might be implemented in hardware, software (including portable software, such as applets), or both.

Storage media and computer readable media for containing code, or portions of code, can include any appropriate media known or used in the art, including storage media and communication media, such as but not limited to volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage and/or transmission of information such as computer readable instructions, data structures, program modules, or other data, including RAM, ROM, Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technology, Compact Disc-Read Only Memory (CD-ROM), Digital Versatile Disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a system device. Based on the disclosure and teachings provided herein, a person of ordinary skill in the art will appreciate other ways and/or methods to implement the various embodiments.

In the preceding description, various embodiments are described.

Bracketed text and blocks with dashed borders (e.g., large dashes, small dashes, dot-dash, and dots) are used herein to illustrate optional operations that add additional features to some embodiments. However, such notation should not be taken to mean that these are the only options or optional operations, and/or that blocks with solid borders are not optional in certain embodiments.

Reference numerals with suffix letters (e.g., 918A-918N) may be used to indicate that there can be one or multiple instances of the referenced entity in various embodiments, and when there are multiple instances, each does not need to be identical but may instead share some general traits or act in common ways. Further, the particular suffixes used are not meant to imply that a particular amount of the entity exists unless specifically indicated to the contrary. Thus, two entities using the same or different suffix letters may or may not have the same number of instances in various embodiments.

References to "one embodiment," "an embodiment," "an example embodiment," etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic.

Moreover, in the various embodiments described above, unless specifically noted otherwise, disjunctive language such as the phrase "at least one of A, B, or C" is intended to be understood to mean either A, B, or C, or any combination thereof (e.g., A, B, and/or C). As such, disjunctive language is not intended to, nor should it be understood to, imply that a given embodiment requires at least one of A, at least one of B, or at least one of C to each be present.

Claim 1:
A computer-implemented method comprising:
executing (<NUM>), by a database instance (<NUM>) of a database service (<NUM>), at least a portion of a query on data stored in the database service (<NUM>) using a temporary data structure to generate a first batch of machine learning requests, wherein the query identifies a machine learning service, wherein executing at least the portion of the query comprises determining data to be provided to the machine learning service, and wherein each machine learning request includes determined data to be provided to the machine learning service;
sending, by the database instance (<NUM>), the first batch of requests to an asynchronous request handler (<NUM>) of the database service (<NUM>), wherein a size of the first batch of machine learning requests is equal to an input buffer size of the asynchronous request handler (<NUM>);
generating (<NUM>), by the asynchronous request handler (<NUM>), a second batch of machine learning requests based on the first batch of machine learning requests and based on the machine learning service, wherein a size of the second batch of machine learning requests is associated with the machine learning service;
receiving, by the asynchronous request handler (<NUM>), a plurality of machine learning responses, the machine learning responses generated by the machine learning service using a machine learning model in response to receiving the second batch of machine learning requests; and
obtaining (<NUM>), by the database instance (<NUM>), the plurality of machine learning responses from an output buffer of the asynchronous request handler (<NUM>),
wherein the query is a structured query language, SQL, query,
wherein the SQL query identifies the machine learning model using an application programming interface, API, call to the machine learning service, and
wherein the machine learning service publishes the API to perform inference using the machine learning model in response to requests received from a plurality of users.