Performing split inference operations for machine learning models

By prioritizing and partitioning machine learning models into submodels, the system addresses time and resource constraints, enhancing computational efficiency and user experience in processing input streams.

JP2024534316AActive Publication Date: 2024-09-20GOOGLE LLC

Patent Information

Application Number
JP2024512139
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2024-09-20
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

Large-scale machine learning models face challenges in processing input streams within time constraints due to memory limitations, bandwidth limitations, and time window constraints, leading to jitter, idle time, and degraded performance.

Method used

A system that determines priority levels for machine learning models, splits low-priority models into submodels, and schedules these submodels across multiple cycles of an iteration time window to ensure timely processing of high-priority tasks.

Benefits of technology

Reduces jitter and improves computational efficiency by ensuring high-priority tasks are executed within each cycle, optimizing data traffic and user experience by minimizing idle time and overall computation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024534316000001
    Figure 2024534316000001
Patent Text Reader

Abstract

A method, system, and apparatus, including a computer program encoded on a computer storage medium, for performing an inference operation of a machine learning model are described herein. In one aspect, the method includes receiving data representing a first machine learning model including an inference operation. An estimated duration for the system to perform the inference operation is obtained. A preferred period reserved for performing a preferred inference operation of a preferred machine learning model during each occurrence of a recurring time window is obtained. A remaining period remaining after reserving the preferred period for each occurrence of the recurring time window is determined. A determination is made whether the estimated duration is greater than the remaining period. In response, the first machine learning model is divided into sub-model groups. A hardware processing unit performs the inference operation of the sub-model during the remaining period.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] Technical Field This specification relates to data processing, machine learning, and performing split inference operations for machine learning models. [Background technology]

[0002] background A machine learning model is a model that is trained based on experience (e.g., past data) to learn patterns in data sets, events, and systems and make predictions. A neural network is a machine learning model that employs one or more layers of nonlinear units to predict an output for a received input. Some neural networks contain one or more hidden layers in addition to an output layer. The output of each hidden layer is used as the input for the next layer of the network, i.e., the next hidden layer or the output layer. Each layer of the network generates an output from the received input according to the current values ​​of a set of respective network parameters.

[0003] In general, neural networks with deeper layers and larger layer sizes usually perform better after training than shallower and smaller neural networks, for example when applied to image detection or natural language processing related tasks. Larger and deeper neural networks inherently have a larger number of parameters, and some can be classified as giant neural networks. A giant neural network is one that has many network parameters, for example, 1 million parameters, 10 million parameters, 500 million parameters, or more than 2 billion parameters.

[0004] Network parameters of a neural network are values ​​that affect the operations that the neural network performs and that are adjusted as part of training. For example, network parameters can include values ​​of the weight matrices and possibly bias vectors of the network layers of the neural network.

[0005] Hyperparameters of a neural network are values ​​that are not changed by the training process. Hyperparameters can include values ​​that affect how the values ​​of the network parameters are updated by the training process, such as the learning rate or other update rules that define how the gradients calculated during backpropagation are used to update the values ​​of the network parameters, values ​​of the objective function, such as the entropy cost, weights assigned to various terms in the objective function, etc. Summary of the Invention

[0006] overview According to one aspect, a method is provided that is performed by a system including a host and one or more hardware processing units configured to perform inference operations of a plurality of machine learning models, the method including: receiving, at the host, data representing a first machine learning model including an inference operation that processes an input to generate a first inference output; performing the inference operation of the first machine learning model for which the system processes the input to obtain a first estimated duration for generating the first inference output; identifying a preferred period reserved for performing a preferred inference operation of a preferred machine learning model during each occurrence of a recurring time window during which the one or more hardware processing units perform at least a portion of the inference operations of the plurality of machine learning models; determining a first remaining period remaining after reserving the preferred period for performing the preferred inference operation of each occurrence of the recurring time window; determining whether the first estimated duration is greater than the first remaining period; and in response to determining that the first estimated duration is greater than the first remaining period, dividing the first machine learning model into a first sub-model group having respective estimated durations less than or equal to the first remaining period, each sub-model of the first sub-model group including a respective portion of the inference operation of the first machine learning model. The method further includes one or more hardware processing units performing an inference operation on the sub-models of the first sub-model group during a first remaining period of the occurrence of the recurring time window. Effect of the Invention

[0007] The subject matter described herein may be implemented in certain embodiments to achieve one or more of the following advantages: The techniques described herein may reduce jitter in data communications. The term "jitter" throughout this specification may broadly refer to the time delay between the transfer of data packets over a network connection. The time delay may vary, for example, a first packet may arrive at a device or host with a delay of 30 milliseconds (ms) and a second packet may arrive with a delay of 40 ms or less. Jitter in data communications may be caused by transferring data packets of different sizes. Jitter may also be caused by wait times across different calculations as a system processes input data that is periodically received by the system.

[0008] More specifically, a system implementing the described technology can determine priority levels of multiple machine learning models and rank the multiple machine learning models based on the priority levels. For example, a high priority machine learning model can correspond to a task such as face detection for a camera application in an edge device. The system can prioritize inference requests to the high priority level machine learning models and ensure that each frame of received input for these prioritized machine learning models is processed during each occurrence of the recurring time window. The recurring time window includes a period during which the system (e.g., a circuit or multiple hardware processing units) performs operations within each cycle. In view of this, the system can generate inference outputs of these prioritized machine learning models in time to reduce jitter in data communication.

[0009] Furthermore, the techniques described herein can improve the efficiency of execution of inference operations of one or more machine learning models. A system performing the described techniques can ensure that inference operations associated with high priority tasks are executed within each cycle by reserving time in each cycle for the high priority tasks. The system can determine the respective remaining duration for each iteration time window by subtracting the time reserved for the high priority tasks. The system can divide low priority models that may be determined to occupy the entire remaining duration or even exceed the remaining duration into multiple sub-models and distribute the sub-models to respective groups of hardware processing units, distribute them to be processed over multiple cycles, or both.

[0010] In particular, the system may obtain an estimated duration (e.g., an estimated period) for performing an inference operation specified by the machine learning model at a low priority level, and for each cycle, determine whether to split the machine learning model into multiple sub-models such that each of the multiple sub-models has a respective estimated duration that is less than or equal to the remaining period of an iterative time window in the cycle. The system may place and distribute the multiple sub-models into one or more time windows and process them using respective hardware processing units. The remaining period of each iterative time window may be substantially utilized for performing an inference operation of the sub-model, reducing the idle time of each iterative time window and improving computational efficiency.

[0011] Throughout this specification, the term "inference operation" may broadly refer to an operation specified in a corresponding machine learning model whose parameters have been trained to process an input. An inference operation may include linear operations, non-linear operations, or both. In the case of a machine learning model that is a trained neural network, an inference operation may include a node operation specified at each node of each network layer of the neural network trained to process a particular input.

[0012] Furthermore, the techniques described herein can provide optimized quality of service (QoS) and improve user experience. As described above, a system implementing the techniques can determine a priority level for each machine learning model and ensure that inference operations for prioritized machine learning models are performed first or within each iteration time window. The system can divide a large-scale machine learning model with a low priority level into multiple sub-models and perform inference operations for the multiple sub-models over multiple occurrences (e.g., cycles) of the iteration time window. A runtime controller of the system can determine how to distribute the multiple sub-models of the high priority machine learning model and the different low priority machine learning models to different cycles of the iteration time window. The runtime controller is further configured to manage multi-pass inference through the sub-models distributed in one or more cycles of the iteration time window. Thus, data traffic is optimized, idle time waiting for input or intermediate output is reduced, and overall computation time for performing inference operations for multiple machine learning models is reduced. Thus, when using one or more applications supported by the system, a recipient (e.g., a person or device) of the system obtains output faster with less time delay compared to other systems using conventional technology.

[0013] Furthermore, a system implementing the described technique is robust to different types of inputs and different sequences of inputs received at different rates. The system can determine the size of the repetition time window of each cycle based on the input rate of the input data (e.g., the number of input frames per second). Furthermore, the system can determine the remaining duration of each time window after allocating a preferred period for performing inference operations of one or more preferred machine learning models for processing the received input frames.

[0014] The details of one or more embodiments of the subject matter herein are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, drawings, and claims. [Brief description of the drawings]

[0015] [Figure 1] FIG. 1 illustrates an example inference system for performing inference operations on a machine learning model. [Diagram 2] FIG. 1 illustrates an example process for performing inference operations for multiple machine learning models within different time windows in different scenarios. [Figure 3A] FIG. 1 illustrates an exemplary process for performing inference operations on multiple sub-models split from a machine learning model. [Figure 3B] FIG. 1 illustrates an example process for performing multi-pass inference through multiple sub-models split from a machine learning model. [Figure 4] FIG. 1 illustrates an example process for generating multiple sub-models from a machine learning model. [Diagram 5] FIG. 1 illustrates an example process for determining a machine learning model that is split into multiple sub-models. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] Detailed Description For better performance, machine learning models tend to have larger sizes with more advanced structures, e.g., neural networks can have deeper layers and larger layer sizes, especially for neural networks used for image processing tasks, e.g., object detection / recognition or natural language processing. Although larger machine learning models, such as large neural networks, have brought notable quality improvements in some fields, scaling up machine learning models can introduce significant practical challenges, such as limited time windows for processing input sequences received at a certain frequency, limited memory for training, storing, and performing inference operations on the machine learning model, and limited memory bandwidth for transferring data and instructions between the host and the accelerator.

[0017] For example, a bottleneck for performing neural network training or inference operations may be memory limitations of each individual computing device, i.e., devices having a central processing unit ("CPU"), a graphics processing unit ("GPU"), and a tensor processing unit ("TPU"). As another example, the bottleneck may be limited communication bandwidth between computing devices, e.g., the data transfer rate between a GPU or TPU and a CPU may not be fast enough compared to the computation speed of each individual computing device. As such, the wait time for data transfer between devices may be comparable to, and sometimes even much longer than, the runtime at each computing device, leading to sluggish training performance. As another example, the bottleneck may be bubble overhead of a computing device. Bubble overhead refers to the time that a subsequent computing device that is assigned a second part of a sequence of operations spends waiting for an output from a previous computing device that is assigned a first part of a sequence of operations. That is, the input for the subsequent computing device to perform the second part of the operations is the output from the previous computing device that performs the first part of the operations. Considering this, the subsequent computing device must remain idle and wait until the previous computing device completes the necessary computations. Therefore, during time steps where the bubble overhead time is significant, utilization of each computing device may be low, especially if only one device is operating during the time step.

[0018] Returning to the time window limitation, the bottleneck of performing inference operations specified in multiple machine learning models to process a stream of input (e.g., multiple frames of input received at a particular time interval or frequency) is to process each frame of input through the multiple machine learning models in a timely manner, e.g., preferably after receiving the frame of input and before receiving a subsequent frame of input. In particular, when there are many models used to process the input and the time window is short, e.g., in milliseconds, it may be difficult or even impossible to perform all the inference operations of all the machine learning models within a single time window. For example, one or more machine learning models may be large, and the estimated duration to execute all of these models may exceed the iterative time window allocated for the process. In some implementations, the system may determine the size of the iterative time window based on the rate or frequency at which each frame of input is received (e.g., frames per second (FPS)). Each occurrence of the iterative time window may be considered a processing cycle in which a frame (or other discrete instance of the input) is processed using the machine learning models. For example, each iterative time window may be 50 ms, such that there are 20 processing cycles per second and 20 input frames are processed per second. Of course, other sizes of the recurring time window are possible, e.g., 30 ms, 100 ms, 1 second, etc. For simplicity, in the following specification, the term "recurring time window" is also referred to as "time window".

[0019] Assume that the time window limitations are not addressed. In that case, a system performing inference operations that process multiple input frames may have problems such as jitter during data transfer, significant idle time of hardware accelerators, slower generation of inference output than the input is received, lack of robustness to different types and streams of input data, etc. These problems impair computational efficiency and result in poor quality of service and user experience. In addition, a low-priority large-scale machine learning model may dominate the time window such that other higher-priority machine learning tasks are not performed using a higher-priority machine learning model, resulting in overall performance degradation and errors due to important operations not being performed in a timely manner. For example, using a specific machine learning model to process input frames within each processing cycle may be important for performance / error prevention. If a larger, lower-priority machine learning model requires multiple processing cycles to complete, the specific machine learning model may not be used to process each input during each processing cycle, resulting in performance degradation and / or errors.

[0020] Several techniques that split large-scale machine learning models into different parts and distribute the different parts to different processors aim to solve the problems caused by memory limitations, bandwidth limitations, or both. These techniques can further apply pipelining methods to reduce the processor bubble time. However, these techniques do not address the problems that surface when processing each frame of the input stream under time constraints (e.g., time window size constraints).

[0021] The technology described herein aims to solve the above problems. In particular, given a time window constraint on the processing of a frame of an inference input, the technology described herein can determine priority levels of multiple machine learning models and execute inference operations of the machine learning models that process the frame of the input according to the priority levels. In another example, in each recurring time window, there may be one or more identified high priority machine learning models that are used to process the input. The technology described herein can execute inference operations to ensure that one or more priority machine learning models are processed during each time window. Furthermore, the described technology can split a lower priority (e.g., a priority indicating that the model does not need to be used in each time window) machine learning model (e.g., a large-scale machine learning model) into multiple sub-models such that the estimated duration for executing the operation of each sub-model meets the remaining period of the recurring time window. The system can further include a runtime controller configured to arrange and schedule the execution of inference operations specified in the multiple machine learning models and sub-models on different processing units (e.g., in parallel) and / or across multiple time windows.

[0022] 1 illustrates an exemplary inference system 100 for performing inference operations on a machine learning model. Inference system 100 is an example of a system implemented on one or more computers at one or more locations that may implement the systems, components, and techniques described below. Some of the components of inference system 100 may be implemented as computer programs configured to run on one or more computers.

[0023] Exemplary reasoning system 100 can be implemented in various types of computing devices. For example, reasoning system 100 can be part of a client device, such as a portable device, e.g., a smartphone or tablet computer, a video streaming device, a gaming console, or an artificial intelligence assistant, e.g., a smart speaker. In some implementations, reasoning system 100 is implemented in a client device equipped with a camera, and reasoning system 100 is configured to process images captured by the camera using machine learning models. In such examples, reasoning system 100 can also be configured to process other types of input of the client device, such as sound (e.g., voice), video, or text input.

[0024] The inference system 100 may include a host 102 and multiple processing units 110. Throughout this specification, the term "host" may broadly refer to a computer or server configured to provide at least one of information resources, services, or applications to users or other devices connected to the host in a network. Throughout this specification, the term "processing unit" may broadly refer to a hardware component suitable for performing a particular operation, for example, a processing unit may include a hardware machine learning accelerator or other type of processor, compute tile, or core.

[0025] The host 102 is communicatively connected, i.e., by wired or wireless communication, to multiple hardware processing units 110. The host 102 and multiple processing units 110 may be located in one or more physical locations. In some embodiments, the host 102 and multiple processing units 110 may be integrated into a circuit or packaged into a single processor. For example, a single integrated circuit may include each of the processing units 110 and optionally the host 102. In another example, the processing unit 110 may span multiple integrated circuits.

[0026] The inference system 100 may receive data representing the multiple machine learning models 135 and input data 137a at the host 102. The input data 137a may include multiple discrete units (e.g., frames) of input data to be processed by the multiple machine learning models 135. The discrete units of input may be in various forms, but for brevity and ease of subsequent description, the input is referred to as a frame. The inference system 100 may compile and deploy the multiple machine learning models 135 to one or more of the multiple processing units 110 to perform an inference operation to process each frame of the input data 137b received from the host 102. The input data 137b corresponds to the input data 137a. That is, the host 102 may provide each frame of the input data to the processing unit 110. After processing the input data 137a through the machine learning models 135, the inference system 100 may generate and output an inference output 167a. The inference output 167a may include one or more inferences for each frame of input data, e.g., each inference output by each machine learning model based on the frame of input data.

[0027] In some cases, the machine learning model may be configured to output inferences based on multiple frames, in which case the inference output 167a may include inferences generated based on multiple frames.

[0028] The host 102 may include a selection engine 140 configured to select one or more machine learning models from the plurality of machine learning models 135 as non-preferred machine learning models. The selection engine 140 may provide the selected machine learning models 145 to a performance estimation engine 150 of the host 102. In some implementations, the selection engine 140 may be configured to estimate, for all machine learning models 135, a recurring time window for processing a frame of input data 137a received at the host 102. In addition, the selection engine 140 may also determine a preference level for each of the machine learning models for processing a frame of input data within the time window. For example, the selection engine 140 may determine the one or more selected machine learning models 145 based on the preference level of each machine learning model.

[0029] The selected machine learning models 145 are sometimes referred to herein as non-preferred machine learning models, each having a respective priority level lower than the preferred machine learning model. The preferred machine learning models may be machine learning models having at least a threshold priority level, machine learning models having a specified number of highest priority levels, and / or machine learning models that are required to be used to process each frame of the input data 137b. In some implementations, there may be a single designated preferred machine learning model that is executed for each frame, e.g., each occurrence of a recurring time window, while in other implementations there may be multiple preferred machine learning models.

[0030] The performance estimation engine 150 is configured to determine an estimated duration for performing an inference operation for each of the selected machine learning models 145. The performance estimation engine 150 is further configured to determine, for each machine learning model 145, whether the estimated duration meets a criterion, e.g., whether the estimated duration is less than or equal to the remaining duration of the recurring time window. The host 102 can determine the remaining duration of a particular recurring time window based on the estimated duration for performing an inference operation of one or more preferred machine learning models within the time window. The remaining duration, recurring time window, and estimated duration are described in more detail below.

[0031] The performance estimation engine 150 can determine whether the estimated duration for performing the inference operation of the machine learning model exceeds the remaining duration of the time window for processing the frame of the input. In response to determining that the estimated duration is longer than the remaining duration, the partitioning engine 155 can partition or segment the machine learning model into multiple sub-models. Each of the sub-models includes at least a non-overlapping portion of the inference operation of the machine learning model. The partitioning engine 155 can further determine how to partition the machine learning model based on the recurring time window in which each frame of the input data 137b is processed. Details of partitioning the machine learning model are described in connection with FIG. 2.

[0032] In some implementations, compiler 180 of host 102 may include both performance estimation engine 150 and partitioning engine 155. In some implementations, performance estimation engine 150 and / or partitioning engine 155 are separate from compiler 180. Compiler 180 is configured to compile multiple sub-models partitioned by partitioning engine 155, as well as other machine learning models that are not partitioned.

[0033] The host 102 can transmit data and instructions 125 to the host interface 130 of each of the multiple hardware processing units 110. Each processing unit 110 can include a host interface 130. The data and instructions 125 include each frame of input data 137b, data representing the compiled sub-models 160 and other compiled machine learning models, data for allocating and deploying different compiled models / sub-models to different processing units 110, and data for arranging and scheduling the inference operations of the deployed models to run on the assigned processing units 110. For example, the host 102 can distribute the compiled sub-models 160 and other unpartitioned machine learning models to one or more of the hardware processing units 110.

[0034] The host interface 130 is used to coordinate and manage communications between the multiple processing units 110 and the host 102. In general, the host interface 130 includes logic that is encoded in software and / or hardware in an appropriate combination and is operable to communicate with the host 102 and other components. More specifically, the host interface 130 can include software that supports one or more communication protocols related to communication such that the network 120 and / or interface hardware are operable to communicate physical signals in and out of the processing units 110. Furthermore, the interface 130 can enable the hardware processing units 110 to communicate with the host 102 and / or the network 120 to perform different operations (e.g., the inference operations described herein).

[0035] Each hardware processing unit 110 is configured to perform machine learning computations including inference computations of an assigned sub-model or model to process each frame of the input data 137b, and generate output data 167b after processing the frame of the input data 137b using the model / sub-model. The hardware processing unit 110 can provide the output data 167 to the host 102, which can output the received output data 167 as an inference output 167a in a streaming or sequence manner. In some implementations, the host 102 can aggregate the output data 167b for one or more frames of the input data 137a and generate the inference output 167a for multiple frames of the input data 137a.

[0036] In some implementations, a computing device (or another device) including inference system 100 may include applications or application programming interfaces (APIs) that send requests to inference system 100. For example, there may be multiple applications that each request that inference system 100 process input data 137a using one or more corresponding machine learning models and provide one or more machine learning outputs, such as inference output 167, based on the processing.

[0037] In a particular example, a client device with a camera may include multiple applications or APIs, each having one or more respective machine learning models for processing images captured by the camera. Each application or API may request an inference output for each frame (e.g., a still image) captured by the camera. In another example, reasoning system 100 may be configured to provide inference output 167 to each application or API, e.g., without requesting a required output.

[0038] The host 102 may include a runtime controller 175 configured to manage normal inference of the non-partitioned model and multi-pass inference of the partitioned model during runtime. To manage multi-pass inference, the runtime controller 175 may manage the storage and fetching of intermediate inputs and intermediate outputs from different memories (e.g., memories 106 or 170) on the host 102 or multiple hardware processing units 110. The runtime controller 175 may schedule multiple inference computations based on at least one of the input data 137a (e.g., frames of input data 137b), respective iteration time windows of the input data 137a, partitioned sub-models, or computational capabilities of the hardware processing units 110.

[0039] Additionally, the host 102 may include one or more central processing units (CPUs) 104. The CPUs 104 may provide processing to the host to perform certain control or logistics operations. In some embodiments, the CPUs 104 may perform several processes during inference. In general, the CPUs 104 execute instructions and manipulate data to perform operations of the host 102. Each CPU 104 may have a single core or multiple cores, each core being available to the host 102 and executing an individual processing thread. Additionally, the number, type, and particular CPUs 104 used to perform the operations described herein may be dynamically determined based on certain requests, interactions, and operations associated with the host 102.

[0040] Additionally, the host 102 may include memory 106. The memory 106 of the host 102 may represent a single memory or multiple memories. The memory 106 may include any memory or database module and may take the form of volatile or non-volatile memory, including, but not limited to, magnetic media, optical media, random access memory (RAM), read-only memory (ROM), removable media, or any other suitable local or remote memory component. The memory 106 may store various objects or data, including execution graphs, machine learning models, management settings, caches, applications, backup data, and any other suitable information related to the host 102, including any parameters, variables, algorithms, instructions, rules, constraints, or references thereto. Although illustrated within the host 102, the memory 106 or any portion thereof, including some or all of the specific illustrated components, may be located remotely from the host 102, including, in some examples, as a cloud application or repository, or as a separate cloud application or repository if the host 102 itself is a cloud-based system. In some examples, data stored in memory 106 may be accessible, for example, over network 120 and may be retrieved by a particular application or function of hardware processing unit 110 .

[0041] Each processing unit 110 may include hardware resources for performing operations independent of other devices. For example, each processing unit may include one or more processors, compute tiles, cores, etc. Processing units 110 may include GPUs and CPUs, as well as dedicated hardware resources for efficiently performing certain operations used in training neural networks, such as matrix multiplication. Examples of dedicated hardware resources include tensor processing units ("TPUs"), field programmable gate arrays ("FGPAs"), and application specific integrated circuits ("ASICs").

[0042] Each hardware processing unit 110 can be heterogeneous, e.g., having multiple processing units of different types per device, or each of the hardware processing units 110 can include the same number and types of processing units.

[0043] Additionally, the hardware processing units 110 may have different computational capabilities; that is, each hardware processing unit may have a different amount of memory 170, processing speed, or other architectural characteristics. Thus, some hardware processing units may be able to perform operations that other hardware processing units cannot. For example, some operations may require a certain amount of memory that only a particular hardware processing unit has, or some processing units are only configured to perform certain types of operations, such as inference operations.

[0044] Additionally, each of the hardware processing units 110 can access the memory 106 of the host 102 and has a memory unit 170. Each of the memory units 170 can include any memory or database module and can take the form of volatile or non-volatile memory, including but not limited to magnetic media, optical media, random access memory (RAM), read-only memory (ROM), removable media, or any other suitable local or remote memory component. The memory units 170 can store various objects or data, administrative settings, caches, applications, backup data, repositories for storing dynamic information, and any other suitable information related to the hardware processing units 110, including any parameters, variables, algorithms, instructions, rules, constraints, or references for inference. The memory units 170 can include a shared memory accessible by each tile of the hardware processing unit or across multiple hardware processing units. The shared memory can include a shared address space used by each of the multiple tiles of the hardware processing unit 110.

[0045] 2 illustrates an exemplary process 200 for performing inference operations of multiple machine learning models in different scenarios and within different time windows. For convenience, process 200 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed inference system, such as system 100 of FIG. 1, can perform process 200.

[0046] The inference system 100 of FIG. 1 can determine a time window for the system, as described above. More specifically, the time window can include a period during which the system 100 performs inference operations within each computation cycle. The time window can be determined by the system 100 based on the rate at which each frame of input data is received, e.g., frames of input per second. For example, the time window can include a period of 1 ms, 10 ms, 20 ms, 50 ms, 100 ms, or another suitable period. As described above, the time window can be a recurring time window. For example, another time window corresponding to another computation cycle can be immediately after the previous time window corresponding to the previous computation cycle has ended.

[0047] As shown in Figure 2, there are multiple time windows 205a, 205b, and 205c along a time axis 210. Each time window 205a-c may include a period during which the system performs inference operations to process a frame of input data. Different time windows may have different duration lengths. Alternatively, one or more different time windows may share the same length of time period.

[0048] The system 100 may include multiple machine learning models, each designated to perform a specific inference task. For example, when the system 100 is used by a camera system configured to take images or videos (a time sequence of images) of a scene including one or more objects. The system 100 may include multiple machine learning models for different tasks, and may execute the inference operations of each of the machine learning models to process each frame of images received at a particular frequency (e.g., one image every 50 milliseconds) to complete the task. For example, the tasks may include automatically determining a focus position of a frame of images, detecting an object in the frame of images, detecting and recognizing a human face captured in the frame of images, and determining a depth image of the frame of images.

[0049] Preferably, the system 100 can execute inference operations of all machine learning models for processing a frame of input within a single time window or before receiving another input frame. However, if the system 100 has many tasks, this is estimated to require more time than a single time window. The system 100 is configured to arrange and schedule the execution order of the inference operations so that each input frame is processed in a timely manner.

[0050] To perform such an arrangement, the system 100 can determine a priority level for each of the machine learning models. In general, the system 100 can determine the priority level based on different aspects such as whether the output of the machine learning model is provided as an input to another machine learning model (i.e., output dependency), the model size of the machine learning model, the approximate time and computational resources required to perform an inference operation of the machine learning model, and the sensitivity level to latency, to name a few.

[0051] As a more specific example, a machine learning model may be determined by system 100 to have a high priority level if one or more other machine learning models use output from the machine learning model to process the image. As another example, a machine learning model that is sensitive to data latency (e.g., a model for a camera viewfinder) may be determined by system 100 to have a high priority level. As another example, a machine learning model configured to predict a depth image of an image frame may have a low priority level if the model for generating the depth image is large and may require a longer processing period and other machine learning models do not use the predicted output.

[0052] As another example, the system 100 may select a machine learning model as a preferred machine learning model or may determine a priority level of the machine learning model based on the task performed by the machine learning model. In a particular example in the context of text or speech processing, the system may determine that a machine learning model related to a text-to-speech conversion task (e.g., converting text to speech, such as operations specified in a text-to-speech (TTS) model) has a high priority level. The system 100 may prioritize operations specified in a TTS model based on the TTS model being a preferred machine learning model. In this way, the system 100 may ensure that there is no (or minimal) "idle time" waiting for output (e.g., audio frames) from the TTS model when performing operations of other models. By preventing this idle time, the system 100 avoids audio "chopping" (i.e., running out of audio buffers) when processing each frame of text input to generate audio for the audience.

[0053] After determining the priority levels of the machine learning models, the system 100 may select one machine learning model that has a large but low priority level (e.g., a lower priority level than the priority levels of one or more other machine learning models). For example, the machine learning models 245a and 245b shown in FIG. 2, or the selected model 145 in FIG. 1, may be considered a low-priority machine learning model.

[0054] The system 100 may determine an estimated duration for performing an inference operation of a machine learning model to process an input. For example, the system 100 may determine an estimated duration for performing an inference operation of a selected machine learning model with a lower priority level. As shown in FIG. 2, the system 100 may determine an estimated duration 230a for performing an inference operation of a machine learning model 245a that processes a frame of an input and another estimated duration 230b for performing an inference operation of a machine learning model 245b that processes another frame of an input.

[0055] In general, the system 100 may reserve a portion of each time window for performing inference operations for a preferred machine learning model (e.g., a machine learning model classified as having a high priority level). The portion reserved for the preferred machine learning model of each time window is also referred to as the "preferred period" of each time window, as described above. As shown in FIG. 2, preferred periods 215a, 215b, and 215c may represent the portion reserved for the preferred machine learning model of each recurring time window 205a, 205b, and 205c. Meanwhile, the system 100 may determine the remaining period of each time window based on the preferred period. For example, as shown in FIG. 2, the system 100 may determine the remaining periods 220a, 220b, and 220c for each recurring time window 205a, 205b, and 205c, respectively.

[0056] The system 100 can then determine whether the estimated duration is less than or equal to the remaining duration by comparing the estimated duration for performing an inference operation of a non-prioritized machine learning model (e.g., a machine learning model classified as having a low priority level) with the remaining duration of the time window.

[0057] In response to determining that the estimated duration for performing an inference operation of a non-preferred machine learning model is equal to or less than the remaining period, the system 100 can schedule the non-preferred machine learning model to perform an operation without splitting the model into multiple sub-models. For example, as illustrated by Scenario A in FIG. 2, the system 100 determines that the estimated duration 230a is less than the remaining period 220a. In response, the partitioning engine 255, which corresponds to the partitioning engine 155 in FIG. 1, does not partition the machine learning model 245a. Instead, the system 100 can directly compile the machine learning model (e.g., compiled model 270a) and perform an inference operation of the compiled model 270a after the preferred period 215a in the recurring time window 205a. In this example, each preferred period 215a-215c is illustrated as occurring at the beginning of each recurring time window 205a-205c, but in other implementations, the preferred period 205a-215c may be located at the end or anywhere between the beginning and the end.

[0058] In some implementations, the system may decide to split a non-preferred machine learning model even if the estimated duration is determined to be less than or equal to the remaining period.

[0059] Alternatively, in response to determining that the estimated duration for performing the inference operation of the non-prioritized machine learning model is longer than the remaining period, the system 100 can divide the machine learning model into multiple sub-models and schedule the execution of partial inference operations of the multiple sub-models according to a sequence. The sequence is determined based on the original machine learning model and the division method of the machine learning model. Details of generating multiple sub-models by dividing the machine learning model are described in relation to FIG. 3A. For example, as illustrated by scenario B in FIG. 2, the system 100 determines that the estimated duration 230b is longer than the remaining period 220b. In response, the division engine 255, which may be the same as or similar to the division engine 155 in FIG. 1, divides the machine learning model 345a into four sub-models. The system 100 further compiles the four sub-models and deploys the four compiled sub-models 280a, 280b, 280c, and 280d to the processing units 110, e.g., each assigned to a respective processing unit 110 or all assigned to the same processing unit 110.

[0060] Preferably, the sum of the time required to perform the inference operations of the four compiled sub-models should be substantially equal to the estimated duration 230b. However, due to the time spent on data storage, transfer, and inter-accelerator latency, the sum of the time required for the four sub-models may be longer than the estimated duration 230b. Thus, the system can arrange and schedule the inference operations of sub-models 280a, 280b, and 280c to be performed in the recurring time window 205b after the priority period 215a, and the inference operation of sub-model 280d to be performed in the recurring time window 205c after the priority period 215c.

[0061] In a situation where the system 100 is scheduling the execution of inference operations for multiple sub-models over multiple time windows, the system 100, or in particular the runtime controller 175, is configured to store and fetch intermediate outputs and intermediate inputs from the memory units 170 of each of the hardware processing units 110.

[0062] Although there are only four sub-models 280a-d segmented from the machine learning model 245b as shown in FIG. 2 for ease of illustration, it should be understood that the system 100 can divide the machine learning model into a different number of sub-models, e.g., 2, 5, 10, and 20 sub-models. Although the four sub-models 280a-d are scheduled over two time windows as shown in FIG. 2 for ease of illustration, the system 100 can generally be arranged and scheduled to perform inference operations of multiple sub-models over multiple, e.g., 3, 5, and 10 time windows. Other suitable amounts of sub-models and time windows can also be used.

[0063] In some implementations, the system 100 may determine additional remaining periods for other machine learning models after analyzing the first non-preferred machine learning model. For example, the system 100 may obtain a second estimated duration (not shown) to execute an inference operation of the second machine learning model that processes the input to generate a second inference output. The system 100 may also determine a second remaining period (not shown) for one or more non-preferred machine learning models after reserving (i) a preferred period for executing a preferred inference operation of the preferred machine learning model and (ii) at least respective estimated durations for executing inference operations of sub-models (e.g., machine learning models 245a and 245b that have been split, scheduled, or both by the system 100) in the first machine learning model. The system may follow similar steps described above to split the second non-preferred machine learning model into a group of sub-models and determine whether to schedule the inference operation of the sub-model to be executed within the second remaining period of the current iteration time window or over multiple iteration time windows.

[0064] 3A illustrates an exemplary process 300 for performing inference operations on multiple sub-models split from a machine learning model. For convenience, process 300 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed inference system, such as system 100 of FIG. 1, can perform process 300.

[0065] As shown in Figure 3A, the deployed sub-model 325 may correspond to the compiled sub-model 160 of Figure 1 or the compiled sub-models 280a-280d of Figure 2. The deployed sub-model 325 is partitioned from a selected machine learning model (e.g., a large machine learning model having a low priority level) by a partitioning engine corresponding to the partitioning engine 155 of Figure 1. The system 100 may deploy the compiled sub-model to one or more hardware processing units, e.g., machine learning accelerators, to perform inference operations that process input data 343 and generate output data 347.

[0066] In some implementations, the machine learning model can include a neural network. Each neural network can include multiple network layers arranged in a sequence, and each network layer can include multiple parameters trained with a particular training sample. The system can perform inference operations specified at each network layer according to the sequence to generate an output for an input. Various types and operations of neural networks are described in more detail below.

[0067] If the low-priority large-scale machine learning model is a neural network including multiple network layers, the system 100 (or the performance estimation engine 150 of FIG. 1 ) may obtain a respective estimated duration for performing an inference operation for each network layer of the neural network. The system 100 may arrange and group one or more network layers from the multiple network layers to form a sub-model (or sub-network) of the neural network based on the estimated duration of each layer. The system 100 may sum the estimated duration of all layers grouped in the sub-model to obtain the estimated duration of the sub-model. In some implementations, the system 100 may divide the neural network into multiple sub-models, each having a respective estimated duration. Alternatively, the system 100 may divide the neural network into multiple sub-models having substantially the same estimated duration.

[0068] To estimate the respective durations of each layer of the neural network, the system 100 can, for example, apply an analytical model to determine the respective durations of each operation of a plurality of node operations in the layer and aggregate the respective durations to estimate the respective layer durations. As another example, the system 100 can include a database derived from a database based on a large-scale simulation to estimate the layer durations. As another example, the system 100 can apply one or more machine learning models to predict the data latency of each layer up to the entire neural network model and estimate the respective layer durations based on the predicted data latency.

[0069] In general, system 100 may divide the neural network into multiple sub-models, each with a respective number of network layers, such that the system can perform inference operations on the sub-models within the remainder of a time window or across multiple time windows, as described in FIG. 2.

[0070] To divide the neural network into multiple sub-models, the system 100 can determine, for each sub-model except the last one according to the sequence specified in the original neural network, the last layer of the sub-model as the output layer of the sub-model. The output from the output layer of the sub-model is an intermediate output of the neural network and can serve as an intermediate input to the sub-models following the sub-model according to the sequence.

[0071] Similarly, for each submodel except the first submodel according to the sequence specified in the original neural network, the system 100 can determine the first layer of the submodel as the input layer or filler layer of the submodel. The filler layer of the submodel can receive as an intermediate input an intermediate output from the output layer of the submodel preceding it in the sequence.

[0072] 3A, the system 100 may divide and compile a machine learning model (e.g., a neural network) into multiple sub-models, e.g., 302, 304, 306, and 308. The system 100 may determine a first layer of the sub-model 304 as a filler layer 334 configured to receive intermediate output data 312 from the preceding sub-model 302. Similarly, the system 100 may determine a first layer of the sub-model 306 as a filler layer 336 configured to receive intermediate output data 314 from the preceding sub-model 304, and a first layer of the sub-model 308 as a filler layer 338 configured to receive intermediate output data 316 from the preceding sub-model 306.

[0073] Further, the system 100 can determine the last layer of the submodel 302 as an output layer configured to generate intermediate output data 312. The system 100 can provide the intermediate output data 312 as an intermediate input to the filler layer 334 of the submodel 304 that follows the submodel 302 according to a sequence specified in the neural network. Similarly, the system 100 can determine the last layer of the submodel 304 as an output layer configured to generate intermediate output data 314 and the last layer of the submodel 306 as an output layer configured to generate intermediate output data 316. The system 100 can provide the intermediate output data 314 as an intermediate input to the filler layer 336 of the submodel 306 and provide the intermediate output data 316 as an intermediate input to the filler layer 338 of the submodel 308.

[0074] During runtime, as shown in FIG. 3A, when the system 100 is receiving frames of input data and processing each received frame of input, a runtime controller 345, which corresponds to the runtime controller 175 of FIG. 1, can manage the data flow of intermediate output data 312, 314, and 316. More specifically, the runtime controller 345 can determine whether to provide the intermediate output data to a subsequent sub-model or to store the intermediate output data in a memory unit. For example, assume that the system 100 schedules to execute inference operations of sub-models 302, 304, and 306 during the remaining period of a first time window, and to execute inference operations of sub-model 308 during the remaining period of a second time window. Thus, during the remaining period of the first time window, the runtime controller 345 can determine to directly provide the intermediate output data 312 to the filler layer 334 of the sub-model 304, and to directly provide the intermediate output data 314 to the filler layer 336 of the sub-model 306. However, the runtime controller 345 can first store the intermediate output data 316 in the memory 320. At or before the start of the remaining period of the second time window, the runtime controller 345 can fetch or pre-fetch the intermediate output data 316 from the memory 320 and provide it to the filler layer 338 for performing the inference operation within the remaining period of the second time window. In general, the memory 320 can include any suitable memory accessible to a hardware processing unit assigned to perform the inference operation of the deployed submodel 325. For example, the memory 320 can be the memory units 170 of the hardware processing unit 110 of FIG. 1. As another example, the memory 320 can be the memory 106 of the host 102 of FIG. 1 accessible to the hardware processing unit 110.

[0075] As another example, with reference to FIG. 2, runtime controller 345 may determine to store intermediate outputs from sub-model 280c during time window 205b, and to fetch and provide the intermediate outputs as inputs to sub-model 280d during the remaining period 220c of time window 205c.

[0076] 3B illustrates an exemplary process 350 for performing multi-pass inference through multiple sub-models split from a machine learning model. For convenience, process 350 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed inference system, such as system 100 of FIG. 1, can perform process 350.

[0077] The system is configured to receive multiple frames of input data or a stream of multiple frames of input data per time interval, as described in Figure 2. For example, the input data can be a stream of video having multiple frames of images, or a set of multiple frames of images captured by a camera system at a particular time interval. The system 100 can assign multiple machine learning models or partitioned sub-models to multiple hardware processing units 110 to perform multi-pass inference operations of the models and process one or more frames of the input within the time window.

[0078] More specifically, to perform the multi-pass inference operation, the system 100 can perform the inference operation by switching between a preferred machine learning model and a non-preferred machine learning model to process a frame of input. For example, with reference to FIG. 2, for a first frame of input received according to a sequence with a particular frequency, the system 100 can perform an inference operation of one or more preferred machine learning models to process the first frame of input within a preferred period 215b of the recurring time window 205b. The system can then perform an inference operation of a sub-model 280a-280c ​​split from the non-preferred machine learning model 245b to process the first frame of input in a remaining period 220b.

[0079] Assuming that the system 100 receives a second frame of input at the beginning of the time window 205c, the system 100 may perform inference operations of one or more preferred machine learning models to process the second frame of input within the preferred period 215c of the time window 205c. The system 100 may then resume performing inference operations of sub-models 280d from the non-preferred machine learning models 245b to process the first frame of input during the remaining period 220c. The system 100 may then begin performing inference operations of sub-models 280a-280d on the second frame of input over one or more time windows.

[0080] Referring again to FIG. 3B, the runtime controller 175 can determine when to store intermediate outputs generated from sub-models for a frame of input and when to resume processing of the frame of input in the same or one or more different time windows because the system 100 needs to process a new frame of input data for a preferred machine learning model or task.

[0081] For example, as shown in Figure 3B, system 100 may receive three frames of input data 365 in a single time window 375. Note that the example shown in Figure 3B is for ease of explanation. However, system 100 may receive different frames of input for different time windows, but this does not change the methodology performed by runtime controller 175.

[0082] During the remainder of the time window 375, the system 100 may receive a first input data 360 (e.g., a first frame of streaming data) and generate an intermediate output 370a by performing an inference operation of the sub-model 302 to process the first input data 360.

[0083] Next, the system 100 can receive the second input data 363 and generate intermediate output 373a by performing an inference operation of the sub-model 302 to process the second input data 363. Meanwhile, the system 100 can provide the intermediate output 370a to the sub-model 304 and generate intermediate output 370b by performing an inference operation of the sub-model 304 to process the first input data 360.

[0084] Next, the system 100 may receive the third input data 365 and generate the intermediate output 375a by performing an inference operation of the sub-model 302 to process the third input data 365. Meanwhile, the system 100 may provide the intermediate output 373a to the sub-model 304 and the intermediate output 373b to the sub-model 306. The system may generate the intermediate output 373b by performing an inference operation of the sub-model 304 to process the second input data 363, and generate the intermediate output 370c (or the inference output 370c if the sub-model 306 is the last sub-model of the machine learning model according to the sequence) by performing an inference operation of the sub-model 306 to process the first input data 360.

[0085] The runtime controller 175 may determine, for various reasons as discussed above, whether any of the above-mentioned calculations need to be performed in one or more time windows after the time window 375. In response, the runtime controller 175 may store one or more intermediate outputs for the corresponding frame of input in a memory unit, fetch the stored intermediate outputs, and provide them to the corresponding sub-model when the system 100 resumes processing the corresponding input frame.

[0086] For example, the system may pause processing of the intermediate output 373b within the time window 375. The runtime controller 175 may store the intermediate output 373b in a memory unit accessible to the hardware processing unit assigned to the sub-model 306. The runtime controller 175 may fetch the intermediate output 373b to execute the inference operation of the sub-model 306 to generate the inference output 370c for the first input data 360. Alternatively, the runtime controller 175 may store the memory address where the intermediate output 373b is stored. The hardware processing unit assigned to the sub-model 306 may be instructed to fetch the stored output 373b from the memory address using one or more data buses.

[0087] Although not shown in FIG. 3B, it should be understood that the multi-pass inference method described above can be extended to perform inference operations for a preferred machine learning model within a preferred period, subject to computational requirements or limitations.

[0088] 4 illustrates an exemplary process 400 for generating multiple sub-models from a machine learning model. For convenience, process 400 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed reasoning system, such as system 100 of FIG. 1, can perform process 400.

[0089] The system can include a host and one or more hardware processing units configured to perform inference operations for a plurality of machine learning models. The system is configured to receive a plurality of frames of input data in an order at a particular rate (e.g., frames per second).

[0090] The system may receive data representing a machine learning model (402). More specifically, the system may receive data representing a first machine learning model at a host. The first machine learning model may include an inference operation that processes an input to generate a first inference output. In some implementations, the machine learning model may include a neural network having multiple network layers having layer parameters.

[0091] The system may obtain an estimated duration for performing an inference operation of a first machine learning model processing the input and generating a first inference output 404. The system may further estimate a respective duration for performing the inference operation of each machine learning model of the plurality of machine learning models received and stored in the system.

[0092] The system can identify a preferred period reserved for performing a preferred inference operation of the preferred machine learning model (406). The system can determine a respective preferred period for each occurrence of the recurring time window. The one or more hardware processing units can perform at least a portion of the inference operations of the multiple machine learning models during each occurrence of the recurring time window.

[0093] The system can determine 408 a remaining period of each occurrence of the iterative time period that remains after reserving the preferred period for performing the preferred inference operation. Each iterative time window can include a respective period that includes the respective remaining period. Each remaining period can include at least a portion of the time window that is available for the system to perform inference operations for one or more non-preferred machine learning models.

[0094] The system may determine (410) whether the estimated duration is greater than the remaining period.

[0095] In response to determining that the estimated duration is greater than the remaining period, the system may divide the first machine learning model into group sub-models (412). Each sub-model of the sub-model group may include a respective portion of the inference operation represented in the first machine learning model. The system 100 may perform an inference operation on one or more of the sub-model groups within the remaining period over one or more iterative time windows.

[0096] The system may perform, by one or more processing units in the system, inference operations on the sub-models of the first sub-model group during the remaining period of occurrence of the recurrence time window (414).

[0097] In some implementations, the system can generate instructions at the host to assign each of the sub-model groups to a respective hardware processing unit of the one or more hardware processing units, and can schedule the one or more hardware processing units to execute a respective portion of an inference operation of the sub-model group each assigned to a corresponding hardware processing unit to generate a first inference output.

[0098] In some implementations, the system can schedule an inference operation associated with a first submodel of the plurality of submodels to be performed during a remaining period of a time window, and an inference operation associated with a second submodel of the plurality of submodels to be performed during another remaining period of another time window. The first submodel and the second submodel are ordered according to a sequence of submodels split from the machine learning model. The second submodel follows the first submodel in sequence. Each of the submodels can include a respective portion of the inference operation specified in the machine learning model.

[0099] The system can perform inference operations for each of the first sub-model groups processing inputs with the assigned hardware processing units according to the assignment instructions and the sequence of the sub-model groups arranged in the first machine learning model.

[0100] In some implementations, the system is configured to process input data including multiple frames of input received in an order or sequence or stream of input data frames. The system may process each frame of the input received according to the order at a particular frequency. With this in mind, the time window may be automatically determined based on the rate or frequency of receiving each frame of the input.

[0101] Additionally, the system can include a compiler configured to compile the multiple sub-models at the host and deploy each of the compiled sub-models to a hardware processing unit assigned to the compiled sub-model.

[0102] Furthermore, the non-preferred machine learning model selected and determined to be divided into a plurality of sub-models by the system may include a neural network. The neural network may include a plurality of network layers arranged in a sequence according to the neural network. The system may determine a respective estimated layer duration for each layer of the network layer required for the system to perform a respective layer operation specified in the network layer to process a frame of input. The system may aggregate the respective estimated layer durations of all the network layers to generate an estimated duration required for the system to perform all inference operations specified in the neural network.

[0103] The system can divide the neural network into multiple sub-models, each of the multiple sub-models including a respective number of network layers arranged according to a sequence and therefore a respective estimated duration for performing the inference operation.

[0104] The system can determine a respective filling layer for each submodel except for the first submodel according to the sequence. Each filling layer is configured as an input layer of the associated submodel such that an intermediate output generated from a preceding submodel is provided to the submodel as an input via the filling layer. Each filling layer is the first layer of a respective number of network layers included in the corresponding submodel.

[0105] The system is configured to perform multi-pass inference operations of one or more machine learning models. As described above, the input data can include a sequence of frames of inputs. The sequence of inputs can include a first input and a second input received at the host according to an order with a particular frequency.

[0106] To generate an inference output for processing a frame of input, the system may perform an inference operation associated with a first sub-model of the partitioned non-prioritized model for processing the first input, and generate a first intermediate output. The system may provide the first intermediate output as a first intermediate input to a second sub-model that follows the first sub-model through a filling layer of the second sub-model according to a sequence specified in the machine learning model.

[0107] The system can then perform an inference operation associated with the first sub-model to process the second input to generate a second intermediate output. Concurrently, the system can perform an inference operation associated with the second sub-model to process the first intermediate input.

[0108] The system may further include a runtime controller. The runtime controller may be configured to control data flow when the system executes the multi-pass inference operation. More specifically, the runtime controller may schedule the execution of the inference operation of the multiple sub-models within one or more time windows. The runtime controller may store intermediate outputs generated by a sub-model of the multiple sub-models for processing a frame of input in a memory unit of the system. The runtime controller may further retrieve the intermediate outputs from the memory unit of the system as intermediate inputs of another sub-model that follows the sub-model in sequence. The memory unit of the system may be accessible to a hardware processing unit allocated for the sub-model.

[0109] 5 illustrates an exemplary process 500 for determining a machine learning model that is divided into multiple sub-models. For convenience, process 500 is described as being performed by one or more computer systems located at one or more locations. For example, a suitably programmed reasoning system, such as system 100 of FIG. 1, can perform process 500.

[0110] To select the machine learning models to be classified as non-preferred machine learning models, the system may receive data representing a plurality of machine learning models (502). Each of the plurality of machine learning models is configured to perform a respective task and includes a respective inference operation performed by the system to process a respective input. The tasks may include, for example, at least one of background detection, focus detection, object detection, or face recognition for an image captured by a camera system. The task of background detection may further include generating a depth image for the captured image.

[0111] The system can measure a priority level for each of the multiple machine learning models based on characteristics of the respective task (504). The characteristics of each task can include the size of the machine learning model that performs the task, whether outputs from the machine learning model for the task are used as inputs by other models, or whether the machine learning model for the task is latency sensitive.

[0112] The system may select one machine learning model from the plurality of machine learning models as a non-preferred machine learning model based on the respective priority levels 506. For example, the system may select a machine learning model with a lower priority level as the selected non-preferred machine learning model.

[0113] The subject matter described herein may be implemented in digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed herein and their structural equivalents, or a combination of one or more of them. The subject matter described herein may be implemented as one or more computer programs, e.g., one or more modules of computer program instructions, encoded on a computer program carrier for execution by or to control the operation of a data processing apparatus. The carrier may be a tangible non-transitory computer storage medium. Alternatively or additionally, the carrier may be an artificially generated propagated signal, e.g., a mechanically generated electrical, optical, or electromagnetic signal generated to encode information for transmission to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be, or be part of, a machine-readable storage device, a machine-readable storage substrate, a random access memory device, or a serial access memory device, or a combination of one or more of them. The computer storage medium is not a propagating signal.

[0114] The term "neural network" encompasses any kind of neural network configured to perform any kind of task.

[0115] In some cases, the neural network is configured to perform an image processing task, i.e., receive an input image and process the input image to generate a network output for the input image. For example, the task may be image classification, and the output generated by the neural network for a given image may be a score for each of a set of object categories, each score representing an estimated likelihood that the image contains an image of an object belonging to the category. As another example, the task may be image embedding generation, and the output generated by the neural network may be a numerical embedding of the input image. As yet another example, the task may be object detection, and the output generated by the neural network may identify locations in the input image where a particular type of object is depicted. As yet another example, the task may be image segmentation, and the output generated by the neural network may assign each pixel of the input image to one of a set of categories.

[0116] As another example, if the input to a neural network is an Internet resource (e.g., a web page), a document, or a portion of a document, or features extracted from an Internet resource, document, or portion of a document, the task can be to classify the resource or document, i.e., the output generated by the neural network for a given Internet resource, document, or portion of a document can be a score for each of a set of topics, each score representing the estimated likelihood that the Internet resource, document, or portion of a document is related to that topic.

[0117] As another example, if the input to a neural network is features of the impression context of a particular ad, the output generated by the neural network may be a score representing the estimated likelihood that the particular ad will be clicked.

[0118] As another example, if the inputs to the neural network are features of personalized suggestions for the user, e.g., features characterizing the context for the suggestions, e.g., features characterizing previous actions taken by the user, the output generated by the neural network may be a score for each of a set of content items, each score representing an estimated likelihood that the user will respond favorably to being suggested the content item.

[0119] As another example, if the input to a neural network is a sequence of text in one language, the output generated by the neural network may be a score for each of the sequence of text fragments in another language, each score representing the estimated likelihood that the text fragment in the other language is an appropriate translation of the input text into the other language.

[0120] As another example, the task may be a speech processing task. For example, if the input to the neural network is a sequence representing spoken words, the output generated by the neural network may be a score for each of a series of text fragments, each score representing an estimated likelihood that the text fragment is a correct transcript of the utterance. As another example, the task may be a keyword spotting task, where if the input to the neural network is a sequence representing spoken words, the output generated by the neural network may indicate whether a particular word or phrase (a "hot word") was spoken in the utterance. As another example, if the input to the neural network is a sequence representing spoken words, the output generated by the neural network may identify the natural language in which the utterance was spoken.

[0121] As another example, the task can be a natural language processing or understanding task performed on a sequence of text in some natural language, such as an entailment task, a paraphrase task, a text similarity task, a sentiment task, a sentence completion task, a grammaticality task, etc.

[0122] As another example, the task can be a text-to-speech synthesis task where the input is natural language text or features of natural language text and the network output is a spectrogram or other data defining the speech of the text spoken in the natural language.

[0123] As another example, the task can be a health prediction task where the input is a patient's electronic medical record data and the output is a prediction related to the patient's future health, e.g., a prediction of a treatment to be prescribed for the patient, the likelihood that the patient will experience an adverse health event, or a diagnosis prediction for the patient.

[0124] As another example, a task can be an agent control task where the inputs are observations that characterize the state of the environment and the outputs define actions to be performed by an agent in response to the observations. The agents can be, for example, real-world or simulated robots, control systems for industrial facilities, or control systems that control different kinds of agents.

[0125] A neural network can have a set of parameters ("network parameters") configured to process network inputs according to trainee parameters and generate outputs for a particular task. A neural network can have any suitable architecture that enables the neural network to receive network inputs of a type required by a particular task and generate network outputs in a form required by the particular task. Examples of neural networks can include fully connected neural networks, convolutional neural networks, recurrent neural networks, attention-based neural networks, e.g., transformers, etc.

[0126] The term "data processing apparatus" encompasses any type of apparatus, device, and machine that processes data, including, by way of example, a programmable processor, a computer, or multiple processors or computers. Data processing apparatus may include, for example, special purpose logic circuits such as a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a graphics processing unit (GPU). In addition to hardware, an apparatus may also include code that creates an execution environment for a computer program, such as code that constitutes a processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of these.

[0127] Computer programs, which may also be called or described as programs, software, software applications, apps, modules, software modules, engines, scripts, or code, can be written in any type of programming language, including compiled or interpreted languages, or declarative or procedural languages, and can be deployed in any form, including as a stand-alone program or as a module, component, engine, subroutine, or other unit suitable for execution in a computing environment, which may include one or more computers interconnected by a data communications network at one or more locations.

[0128] A computer program may, but need not, correspond to a file in a file system. A computer program can be stored as part of a file that holds other programs or data, such as one or more scripts stored in a markup language document, a single file dedicated to the program in question, or several associated files, such as a file that stores one or more modules, subprograms, or portions of code.

[0129] The processes and logic flows described herein may be performed by one or more computers that execute one or more computer programs and perform functions by manipulating input data to generate output. The processes and logic flows may also be performed by special purpose logic circuitry, such as an FPGA, ASIC, or GPU, or by a combination of special purpose logic circuitry and one or more programmed computers.

[0130] A computer suitable for executing a computer program can be based on a general-purpose or special-purpose microprocessor, or both, or on other types of central processing units. In general, the central processing unit receives instructions and data from a read-only memory or a random access memory, or both. The essential elements of a computer are a central processing unit for executing instructions, and one or more memory devices for storing instructions and data. The central processing unit and memory may be supplemented by, or incorporated in, special-purpose logic circuitry.

[0131] Generally, a computer further comprises one or more mass storage devices or is operatively connected to receive data from or transfer data to them. The mass storage devices can be, for example, magnetic, magneto-optical, or optical disks, or solid-state drives. However, a computer need not have such devices. Furthermore, a computer can be incorporated into another device, for example, a mobile phone, a personal digital assistant (PDA), a portable audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device, for example, a universal serial bus (USB) flash drive, to name a few.

[0132] To provide for user interaction, embodiments of the subject matter described herein can be implemented in or configured to communicate with a computer having a display device, e.g., an LCD (liquid crystal display) monitor, for displaying information to the user, and an input device, e.g., a keyboard and a pointing device, e.g., a mouse, trackball, or touchpad, by which the user can provide input to the computer. Other types of devices can be used to provide user interaction as well, e.g., feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback, and input from the user can be received in any form, including acoustic input, speech input, or tactile input. In addition, the computer can interact with the user by sending documents to and receiving documents from a device used by the user, e.g., by sending a web page to a web browser on the user's device in response to a request received from the web browser, or by interacting with an app running on the user device, e.g., a smartphone or electronic tablet. The computer can also interact with the user by sending text messages or other forms of messages to a personal device, e.g., a smartphone running a messaging application, and receiving a response message from the user.

[0133] The term "configured to" is used herein in connection with systems, devices, and computer program components. A system of one or more computers configured to perform a particular operation or action means that the system has installed thereon software, firmware, hardware, or a combination thereof that, when operated, causes the system to perform the operation or action. A computer program or programs configured to perform a particular operation or action means that the program or programs contain instructions that, when executed by a data processing apparatus, cause the apparatus to perform the operation or action. A special purpose logic circuitry configured to perform a particular operation or action means that the circuitry has electronic logic that performs the operation or action.

[0134] An embodiment of the subject matter described herein can be implemented in a computing system that includes a back-end component, e.g., as a data server, or includes a middleware component, e.g., an application server, or includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an embodiment of the subject matter described herein, or any combination of one or more such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include local area networks (LANs) and wide area networks (WANs), e.g., the Internet.

[0135] A computing system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some implementations, a server sends data, such as HTML pages, to a user device for the purpose of displaying the data to and receiving user input from a user interacting with the device acting as a client. Data generated at the user device, e.g., a result of a user interaction, can be received at the server from the device.

[0136] In addition to the above embodiments, the following embodiments are also innovative. Embodiment 1 is a method performed by a system including a host and one or more hardware processing units configured to perform inference operations of a plurality of machine learning models, the method including: receiving, at the host, data representing a first machine learning model including an inference operation that processes an input to generate a first inference output; performing the inference operation of the first machine learning model for which the system processes the input to obtain a first estimated duration for generating the first inference output; and identifying, during each occurrence of a recurring time window during which the one or more hardware processing units perform at least a portion of the inference operations of the plurality of machine learning models, a preferred period reserved for performing a preferred inference operation of the preferred machine learning model. determining a first remaining period remaining after reserving a priority period for performing a priority inference operation of each occurrence of the recurring time window; determining whether the first estimated duration is longer than the first remaining period; and in response to determining that the first estimated duration is longer than the first remaining period, dividing the first machine learning model into a first sub-model group having respective estimated durations that are less than or equal to the first remaining period, each sub-model of the first sub-model group comprising a respective portion of an inference operation of the first machine learning model, the method further including: one or more hardware processing units performing the inference operation of the sub-models of the first sub-model group during the first remaining period of the occurrence of the recurring time window.

[0137] Example 2 is the method of example 1, wherein generating the first inference output further includes generating instructions at the host to assign each of the first sub-model groups to a respective hardware processing unit of the one or more hardware processing units, and performing an inference operation of each of the first sub-model groups to process an input on the assigned hardware processing unit according to the instructions and the sequence of the first sub-model groups arranged in the first machine learning model.

[0138] Example 3 is the method of example 2, wherein performing the inference operation of each of the first sub-model groups further includes the host scheduling one or more hardware processing units to perform the inference operation of each of the first sub-model groups each assigned to a corresponding hardware processing unit and generate a first inference output.

[0139] Embodiment 4 is a method according to any one of embodiments 1 to 3, further comprising a compiler in the host compiling the first sub-model group and deploying each of the compiled sub-models to one or more hardware processing units.

[0140] Embodiment 5 is a method according to any one of embodiments 1 to 4, wherein receiving data representing the first machine learning model further includes receiving data representing a plurality of machine learning models, each of the plurality of machine learning models configured to perform a respective task and including a respective inference operation performed by the system for processing the input, and receiving the data representing the first machine learning model further includes measuring a respective preference level of each of the plurality of machine learning models based on characteristics of the respective task, and selecting one machine learning model from the plurality of machine learning models as the first machine learning model based on the respective preference level.

[0141] A sixth embodiment is a method according to any one of the first to fifth embodiments, further comprising: receiving data representing a second machine learning model; obtaining a second estimated duration for performing an inference operation of the second machine learning model in which the system processes the input and generates a second inference output; determining (i) a preferred period for performing the preferred inference operation and (ii) a second remaining period remaining after reserving at least a respective estimated duration for performing an inference operation of a sub-model of the first machine learning model for each occurrence of the recurring time window; determining whether the second estimated duration is longer than the second remaining period; and in response to determining that the second estimated duration is longer than the second remaining period, dividing the second machine learning model into second sub-model groups having respective estimated durations that are less than or equal to the second remaining period, each sub-model of the second sub-model group including a respective portion of the inference operation of the second machine learning model; the method further comprising: one or more processing units performing the inference operation of the sub-model of the second sub-model group during the second remaining period of the occurrence of the recurring time window.

[0142] Embodiment 7 is a method according to embodiment 5 or 6, wherein the input includes an image frame of a plurality of image frames captured by a sensor, each occurrence of the recurring time window corresponding to an image frame of the plurality of image frames, and each task includes at least one of background detection, focus detection, object detection, or human face recognition, and the characteristics of each task include at least dependencies of each task and respective estimated durations for executing each task by one or more processing units in the system.

[0143] Embodiment 8 is a method according to any one of embodiments 1 to 7, wherein the system is configured to execute inference operations of one or more machine learning models to process a sequence of inputs, each of the sequence of inputs being received at the host according to an order with a particular frequency, and the duration of the recurring time window is determined based on the particular frequency.

[0144] Embodiment 9 is a method according to any one of embodiments 1 to 7, wherein the first machine learning model includes a neural network including a plurality of network layers arranged in a sequence, and obtaining the first estimated duration includes: for each layer of the network layers, determining a respective estimated layer duration for the system to perform a respective layer operation specified in the layer to process the input; and aggregating the respective estimated layer durations of all the network layers to obtain the first estimated duration.

[0145] A method according to any one of the preceding claims, further comprising: performing, during a first remaining period of a first repetitive time window of the plurality of repetitive time windows, an inference operation related to a first sub-model of a first sub-model group in a sequence; and performing, during a first remaining period of a second repetitive time window of the plurality of repetitive time windows, an inference operation related to a second sub-model of the first sub-model group subsequent to the first sub-model in a sequence.

[0146] Embodiment 11 is a method according to any one of embodiments 1 to 7 and 9, wherein dividing the first machine learning model including the neural network further includes dividing the neural network into first sub-model groups, each including a respective number of network layers arranged according to a sequence, and determining a respective filler layer of each sub-model, except for the first sub-model, of the first sub-model group, such that an intermediate output generated from another sub-model preceding the sub-model is provided as an input to the sub-model by each filler layer, each filler layer being the first layer of a network layer included in a corresponding sub-model of the first sub-model group.

[0147] Embodiment 12 is a method according to any one of embodiments 1 to 11, wherein the input constitutes a sequence of inputs including a first input and a second input received at the host according to a certain order, and generating the inference output further includes: performing an inference operation related to a first submodel according to the sequence to process the first input and generate a first intermediate output; providing the first intermediate output as a first intermediate input to a second submodel subsequent to the first submodel through a filling layer of the second submodel according to the sequence; and performing an inference operation related to the first submodel according to the sequence to process the second input and generate a second intermediate output while performing an inference operation related to the second submodel to process the first intermediate input.

[0148] Embodiment 13 is a method according to any one of embodiments 2, 3 and 10, wherein generating a first inference output further includes storing an intermediate output generated by a submodel of a first submodel group that processes an input in a memory unit of the system, and retrieving the intermediate output from the memory unit of the system as an intermediate input for another submodel that follows the submodel in the sequence.

[0149] Embodiment 14 is a system including one or more computers and one or more storage devices storing instructions operable, when executed by the one or more computers, to cause the one or more computers to perform a method described in any one of embodiments 1 to 13.

[0150] Embodiment 15 is a computer storage medium encoded with a computer program comprising instructions operable, when executed by a data processing device, to cause the data processing device to perform a method according to any one of embodiments 1 to 13.

[0151] Although the present specification contains many specific embodiment details, these should not be construed as limitations on the scope of what is or may be claimed, but rather as descriptions of features that may be specific to certain embodiments of a particular invention. Certain features described herein in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented separately in multiple embodiments or in any suitable subcombination. Furthermore, although features may be described above as functioning in a particular combination, and may even initially be claimed as such, one or more features from the claimed combination may in some cases be excluded from those combinations, and the claims may be directed to subcombinations or variations of the subcombinations.

[0152] Similarly, although operations are depicted in the figures and claimed in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown, or in sequential order, or that all of the operations shown be performed, to achieve desirable results. In certain situations, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the program components and systems described may generally be integrated together in a single software product or packaged into multiple software products.

[0153] Specific implementations of the subject matter have been described. Other implementations are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. By way of example, the processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.

Claims

1. 1. A method performed by a system including a host and one or more hardware processing units configured to perform inference operations for a plurality of machine learning models, the method comprising: receiving, at the host, data representative of a first machine learning model including an inference operation that processes an input to generate a first inference output; the system performing the inference operation of the first machine learning model to process the input and obtain a first estimated duration for generating the first inference output; identifying a preferred period reserved for performing a preferred inference operation of a preferred machine learning model during each occurrence of a recurring time window during which the one or more hardware processing units perform at least a portion of the inference operations of the plurality of machine learning models; determining a first remaining period remaining after reserving the priority period for performing the priority inference operation for each occurrence of the recurring time window; and determining whether the first estimated duration is greater than the first remaining period; and in response to determining that the first estimated duration is greater than the first remaining period, dividing the first machine learning model into a first sub-model group having respective estimated durations that are less than or equal to the first remaining period, each sub-model of the first sub-model group comprising a respective portion of the inference operation of the first machine learning model, the method further comprising: The method includes the one or more hardware processing units performing inference operations on sub-models of the first sub-model group during the first remaining period of occurrence of the recurring time window.

2. Generating the first inference output includes: generating instructions at the host to assign each of the first sub-model groups to a respective hardware processing unit of the one or more hardware processing units; executing an inference operation of each of the first sub-model groups for processing the input on the assigned hardware processing unit according to the instructions and the sequence of the first sub-model groups arranged in the first machine learning model; The method of claim 1 further comprising:

3. Performing the inference operation on each of the first sub-model groups includes:

3. The method of claim 2, further comprising: the host scheduling the one or more hardware processing units to perform the inference operations of each of the first sub-model groups, each assigned to a corresponding hardware processing unit, and generate the first inference output.

4. 2. The method of claim 1, further comprising: a compiler on the host compiling the first group of sub-models and deploying each of the compiled sub-models to the one or more hardware processing units.

5. Receiving data representing the first machine learning model includes: and further comprising receiving data representing a plurality of machine learning models, each of the plurality of machine learning models configured to perform a respective task and including a respective inference operation performed by the system to process the input, wherein receiving the data representing the first machine learning model comprises: determining a respective priority level for each of the plurality of machine learning models based on characteristics of the respective task; selecting a machine learning model from the plurality of machine learning models as the first machine learning model based on the respective priority levels; The method of claim 1 further comprising:

6. receiving data representing a second machine learning model; the system performing the inference operation of the second machine learning model to process the input and obtain a second estimated duration for generating a second inference output; (i) determining the preferred period during which the preferred inference operation is performed, and (ii) a second remaining period remaining after reserving at least a respective estimated duration for performing an inference operation of a sub-model of the first machine learning model for each occurrence of the recurring time window; determining whether the second estimated duration is greater than the second remaining period; and in response to determining that the second estimated duration is greater than the second remaining duration, dividing the second machine learning model into a second sub-model group having respective estimated durations less than or equal to the second remaining duration, each sub-model of the second sub-model group comprising a respective portion of the inference operation of the second machine learning model, the method further comprising: the one or more processing units performing an inference operation for sub-models of the second sub-model group during the second remaining period of occurrence of the recurring time window; The method of claim 1 further comprising:

7. the input includes image frames of a plurality of image frames captured by a sensor; each occurrence of the repeating time window corresponds to an image frame of the plurality of image frames; each of the tasks includes at least one of background detection, focus detection, object detection, or human face recognition; The method of claim 5 , wherein the characteristics of each of the tasks include at least dependencies of each of the tasks and respective estimated durations for execution of each of the tasks by the one or more processing units in the system.

8. 2. The method of claim 1 , wherein the system is configured to perform inference operations of one or more machine learning models to process a sequence of inputs, each of the sequence of inputs being received at the host according to an order with a particular frequency, and a duration of the recurring time window is determined based on the particular frequency.

9. The first machine learning model includes a neural network including a plurality of network layers arranged in a sequence, and obtaining the first estimated duration includes: determining, for each layer of the network layers, a respective estimated layer duration for the system to execute a respective layer operation specified at that layer to process the input; aggregating the estimated layer durations for each of all network layers to obtain the first estimated duration; The method of claim 1 , comprising:

10. performing an inference operation associated with a first sub-model of the first sub-model group according to the sequence during the first remaining period of a first repetition time window of the plurality of repetition time windows; performing an inference operation associated with a second sub-model of the first sub-model group that follows the first sub-model according to the sequence during the first remaining period of a second repetition time window of the plurality of repetition time windows; The method of claim 2 , further comprising:

11. Partitioning the first machine learning model including the neural network includes: Dividing the neural network into the first sub-model groups, each of which includes a respective number of network layers arranged according to the sequence; determining the filler layer of each of the submodels of the first group of submodels, except for the first submodel, such that intermediate outputs generated from another submodel preceding the submodel are provided as inputs to the submodel by each filler layer; Further comprising: The method of claim 9 , wherein each of the filling layers is a first layer of a network layer included in a corresponding sub-model of the first sub-model group.

12. The inputs constitute a sequence of inputs including a first input and a second input received at the host according to an order, and generating the inference output comprises: performing an inference operation associated with a first sub-model according to the sequence to process the first input and generate a first intermediate output; providing the first intermediate output as a first intermediate input to the second sub-model subsequent to the first sub-model through a filling layer of the second sub-model according to the sequence; performing an inference operation associated with the first sub-model in accordance with the sequence to process the second input and generate a second intermediate output, while performing an inference operation associated with the second sub-model to process the first intermediate input; The method of claim 1 further comprising:

13. Generating the first inference output includes: storing intermediate outputs generated by a sub-model of the first group of sub-models for processing the input in a memory unit of the system; retrieving said intermediate output from said memory unit of said system as an intermediate input of another sub-model following said sub-model in said sequence; The method of claim 2 , further comprising:

14. 1. A system including one or more computers and one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to perform respective operations, the system further comprising a host and one or more hardware processing units configured to perform inference operations for a plurality of machine learning models, the operations comprising: receiving, at the host, data representative of a first machine learning model including an inference operation that processes an input to generate a first inference output; the system performing the inference operation of the first machine learning model to process the input and obtain a first estimated duration for generating the first inference output; identifying a preferred period reserved for performing a preferred inference operation of a preferred machine learning model during each occurrence of a recurring time window during which the one or more hardware processing units perform at least a portion of the inference operations of the plurality of machine learning models; determining a first remaining period remaining after reserving the priority period for performing the priority inference operation for each occurrence of the recurring time window; and determining whether the first estimated duration is greater than the first remaining period; and in response to determining that the first estimated duration is greater than the first remaining period, dividing the first machine learning model into a first sub-model group having a respective estimated duration that is less than or equal to the first remaining period, each sub-model of the first sub-model group comprising a respective portion of the inference operation of the first machine learning model, the operation further comprising: the one or more hardware processing units performing inference operations on sub-models of the first sub-model group during the first remaining period of occurrence of the recurring time window.

15. Receiving data representing the first machine learning model includes: and further comprising receiving data representing a plurality of machine learning models, each of the plurality of machine learning models configured to perform a respective task and including a respective inference operation performed by the system to process the input, wherein receiving the data representing the first machine learning model comprises: determining a respective priority level for each of the plurality of machine learning models based on characteristics of the respective task; selecting a machine learning model from the plurality of machine learning models as the first machine learning model based on the respective priority levels; The system of claim 14 further comprising:

16. receiving data representing a second machine learning model; the system performing the inference operation of the second machine learning model to process the input and obtain a second estimated duration for generating a second inference output; (i) determining the preferred period during which the preferred inference operation is performed, and (ii) a second remaining period remaining after reserving at least a respective estimated duration for performing an inference operation of a sub-model of the first machine learning model for each occurrence of the recurring time window; determining whether the second estimated duration is greater than the second remaining period; and in response to determining that the second estimated duration is greater than the second remaining duration, dividing the second machine learning model into a second sub-model group having respective estimated durations less than or equal to the second remaining duration, each sub-model of the second sub-model group comprising a respective portion of the inference operation of the second machine learning model, the operation comprising: the one or more processing units performing an inference operation for sub-models of the second sub-model group during the second remaining period of occurrence of the recurring time window; The system of claim 14 further comprising:

17. the input includes image frames of a plurality of image frames captured by a sensor; each occurrence of the repeating time window corresponds to an image frame of the plurality of image frames; each of the tasks includes at least one of background detection, focus detection, object detection, or human face recognition; 16. The system of claim 15, wherein the characteristics of each of the tasks include at least dependencies of each of the tasks and respective estimated durations for execution of each of the tasks by the one or more processing units in the system.

18. One or more computer-readable storage media storing instructions that, when executed by one or more computers, cause the one or more computers to perform respective operations performed by a system including a host and one or more hardware processing units configured to perform inference operations for a plurality of machine learning models, each of the operations comprising: receiving, at the host, data representative of a first machine learning model including an inference operation that processes an input to generate a first inference output; the system performing the inference operation of the first machine learning model to process the input and obtain a first estimated duration for generating the first inference output; identifying a preferred period reserved for performing a preferred inference operation of a preferred machine learning model during each occurrence of a recurring time window during which the one or more hardware processing units perform at least a portion of the inference operations of the plurality of machine learning models; determining a first remaining period remaining after reserving the priority period for performing the priority inference operation for each occurrence of the recurring time window; and determining whether the first estimated duration is greater than the first remaining period; and in response to determining that the first estimated duration is greater than the first remaining period, dividing the first machine learning model into a first sub-model group having a respective estimated duration that is less than or equal to the first remaining period, each sub-model of the first sub-model group comprising a respective portion of the inference operation of the first machine learning model, the operation further comprising: the one or more hardware processing units performing an inference operation on sub-models of the first sub-model group during the first remaining period of occurrence of the recurring time window.

19. Receiving data representing the first machine learning model includes: and further comprising receiving data representing a plurality of machine learning models, each of the plurality of machine learning models configured to perform a respective task and including a respective inference operation performed by the system to process the input, wherein receiving the data representing the first machine learning model comprises: determining a respective priority level for each of the plurality of machine learning models based on characteristics of the respective task; selecting a machine learning model from the plurality of machine learning models as the first machine learning model based on the respective priority levels; 20. The one or more computer-readable storage media of claim 18, further comprising:

20. receiving data representing a second machine learning model; the system performing the inference operation of the second machine learning model to process the input and obtain a second estimated duration for generating a second inference output; (i) determining the preferred period during which the preferred inference operation is performed, and (ii) a second remaining period remaining after reserving at least a respective estimated duration for performing an inference operation of a sub-model of the first machine learning model for each occurrence of the recurring time window; determining whether the second estimated duration is greater than the second remaining period; and in response to determining that the second estimated duration is greater than the second remaining duration, dividing the second machine learning model into a second sub-model group having respective estimated durations less than or equal to the second remaining duration, each sub-model of the second sub-model group comprising a respective portion of the inference operation of the second machine learning model, the operation comprising: the one or more processing units performing an inference operation for sub-models of the second sub-model group during the second remaining period of occurrence of the recurring time window; 20. The one or more computer-readable storage media of claim 18, further comprising:

Citation Information

Patent Citations

  • Engine control device

    JP2021105368A

  • Neural network processing

    US20200184320A1

Cited By

  • Processing control device, processing control method, and program

    JP2026150846A