Systems and Methods for Optimization of Graphics Processing for Machine Learning Inference

Systems and methods of the present disclosure are directed to a method for optimizing utilization of graphics processors for machine learning inference tasks. The method includes simultaneously rendering, by a computing system comprising one or more computing devices, a plurality of textures from an input to a machine-learned model. The method includes generating, by the computing system, a plurality of shaders based at least in part on a layout of the plurality of textures, wherein each of the plurality of shaders corresponds to at least one operator of a plurality of operators of the machine-learned model. The method includes processing, by the computing system using a Graphics Processing Unit (GPU), the plurality of textures with the plurality of shaders to obtain a machine-learning output for the machine-learned model.

FIELD

The present disclosure relates generally to optimizing utilization of system resources. More particularly, the present disclosure relates to optimizing usage of graphics processing hardware via application programming interfaces for machine learning inference.

BACKGROUND

Recently, many applications have begun to leverage machine learning to significantly optimize the performance of various tasks (e.g., videoconferencing, image recognition services, etc.). However, in certain execution environments, such as web browsers, these applications generally lack the capacity to efficiently utilize the bandwidth of specialized hardware (e.g., graphics processing units) for processing of machine learning inference tasks.

SUMMARY

One example aspect of the present disclosure is directed to a computing system for optimizing utilization of graphics processors for machine learning inference tasks. The computing system includes one or more processors, wherein the one or more processors comprises a Graphics Processing Unit (GPU). The computing system includes one or more non-transitory computer-readable media that collectively store instructions that, when executed by the one or more processors, cause the computing system to perform operations. The operations include simultaneously rendering a plurality of textures from an input to a machine-learned model. The operations include generating a plurality of shaders based at least in part on a layout of the plurality of textures, wherein each of the plurality of shaders corresponds to at least one operator of a plurality of operators of the machine-learned model. The operations include processing, using the GPU, the plurality of textures with the plurality of shaders to obtain a machine-learning output for the machine-learned model.

Another example aspect of the present disclosure is directed to a method for optimizing utilization of graphics processors for machine learning inference tasks. The method includes simultaneously rendering, by a computing system comprising one or more computing devices, a plurality of textures from an input to a machine-learned model. The method includes generating, by the computing system, a plurality of shaders based at least in part on a layout of the plurality of textures, wherein each of the plurality of shaders corresponds to at least one operator of a plurality of operators of the machine-learned model. The method includes processing, by the computing system using a Graphics Processing Unit (GPU), the plurality of textures with the plurality of shaders to obtain a machine-learning output for the machine-learned model.

Another example aspect of the present disclosure is directed to one or more non-transitory computer-readable media that collectively store instructions that, when executed by the one or more processors, cause the computing system to perform operations. The operations include simultaneously rendering a plurality of textures from an input to a machine-learned model. The operations include generating a plurality of shaders based at least in part on a layout of the plurality of textures, wherein each of the plurality of shaders corresponds to at least one operator of a plurality of operators of the machine-learned model. The operations include processing, using a GPU, the plurality of textures with the plurality of shaders to obtain a machine-learning output for the machine-learned model.

DETAILED DESCRIPTION

Overview

Generally, the present disclosure is directed to optimizing utilization of system resources. More particularly, the present disclosure relates to optimizing usage of graphics processing hardware via application programming interfaces for machine learning inference. Specifically, for example, an input (e.g., image input data for an image segmentation task, etc.) can be obtained for trained machine-learned model that is utilized by an application executed within a web browser (e.g., a videoconferencing application, etc.). To obtain a high quality result, the application may leverage specialized hardware such as a graphics processing units (GPUs) for processing of the machine learned model via an application programming interface. However, some conventional application programming interfaces (APIs) lack the capacity to optimally utilize the bandwidth of a GPU (e.g., WebGL API, etc.).

Accordingly, systems and methods of the present disclosure propose to optimize utilization of graphics processors for machine learning inference tasks. For example, after obtaining the input, a plurality of textures can be simultaneously rendered from the input to the machine learned model (e.g., via a Multi-Render Targets (MRT) process of a WebGL API, etc.). A plurality of shaders (e.g., fragment shaders, etc.) can next be generated based at least in part on a layout of the plurality of textures (e.g., a number of textures, dimensions of the textures, etc.). Each of the plurality of shaders can correspond to at least one operator of a plurality of operators of the machine learned model. Utilizing the GPU, the plurality of textures can be processed with the plurality of shaders to obtain a machine-learning output for the machine-learned model.

Systems and methods of the present disclosure provide a number of technical effects and benefits. As one example technical effects and benefit, shader operations performed by the GPU incur a certain degree of overhead. As GPUs are heavily parallelized, inefficiencies can arise when the complexity of shader operations are less than the overhead. Accordingly, by leveraging existing features of certain APIs, such as the MRT feature of WebGL, embodiments of the present disclosure can complicate the shader operations by translating a model input to a plurality of textures, therefore substantially increasing utilization of GPU bandwidth (e.g., via parallelization, etc.). In turn, by increasing GPU bandwidth utilization, embodiments of the present disclosure facilitate more efficient model utilization and provision of higher quality model outputs, while also reducing or eliminating any processing bottlenecks at the GPU (e.g., therefore reducing power usage, compute cycles, memory usage, etc. associated with bottlenecks).

Example Devices and Systems

FIG.1Adepicts a block diagram of an example computing system100that optimizes utilization of graphics processors for machine learning inference tasks according to example embodiments of the present disclosure. The system100includes a user computing device102, a server computing system130, and a training computing system150that are communicatively coupled over a network180.

The user computing device102includes one or more processors112and a memory114. The one or more processors112can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be one processor or a plurality of processors that are operatively connected. For example, the processor(s)112may include one or more Graphics Processing Unit(s) (GPUs). These GPUs can be leveraged via application programming interfaces (APIs) accessed by applications executed by the user computing device (102) and/or other computing devices (e.g., the server computing system130, etc.). The memory114can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory114can store data116and instructions118which are executed by the processor112to cause the user computing device102to perform operations.

In some implementations, the user computing device102can store or include one or more models120. For example, the models120can be or can otherwise include various machine-learned models such as neural networks (e.g., deep neural networks) or other types of machine-learned models, including non-linear models and/or linear models. Neural networks can include feed-forward neural networks, recurrent neural networks (e.g., long short-term memory recurrent neural networks), convolutional neural networks or other forms of neural networks. Some example machine-learned models can leverage an attention mechanism such as self-attention. For example, some example machine-learned models can include multi-headed self-attention models (e.g., transformer models).

In some implementations, the one or more models120can be received from the server computing system130over network180, stored in the user computing device memory114, and then used or otherwise implemented by the one or more processors112. In some implementations, the user computing device102can implement multiple parallel instances of a single model120(e.g., to perform parallel processing across multiple instances of the models).

Additionally or alternatively, one or more models140can be included in or otherwise stored and implemented by the server computing system130that communicates with the user computing device102according to a client-server relationship. For example, the models140can be implemented by the server computing system130as a portion of a web service (e.g., an image segmentation service, an image recognition service, etc.). Thus, one or more models120can be stored and implemented at the user computing device102and/or one or more models140can be stored and implemented at the server computing system130.

The user computing device102can also include one or more user input components122that receives user input. For example, the user input component122can be a touch-sensitive component (e.g., a touch-sensitive display screen or a touch pad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component can serve to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other means by which a user can provide user input.

As described above, the server computing system130can store or otherwise include one or more models140. For example, the models140can be or can otherwise include various machine-learned models. Example machine-learned models include neural networks or other multi-layer non-linear models. Example neural networks include feed forward neural networks, deep neural networks, recurrent neural networks, and convolutional neural networks. Some example machine-learned models can leverage an attention mechanism such as self-attention. For example, some example machine-learned models can include multi-headed self-attention models (e.g., transformer models).

The user computing device102and/or the server computing system130can train the models120and/or140via interaction with the training computing system150that is communicatively coupled over the network180. The training computing system150can be separate from the server computing system130or can be a portion of the server computing system130.

The training computing system150can include a model trainer160that trains the machine-learned models120and/or140stored at the user computing device102and/or the server computing system130using various training or learning techniques, such as, for example, backwards propagation of errors. For example, a loss function can be backpropagated through the model(s) to update one or more parameters of the model(s) (e.g., based on a gradient of the loss function). Various loss functions can be used such as mean squared error, likelihood loss, cross entropy loss, hinge loss, and/or various other loss functions. Gradient descent techniques can be used to iteratively update the parameters over a number of training iterations.

In some implementations, if the user has provided consent, the training examples can be provided by the user computing device102. Thus, in such implementations, the model120provided to the user computing device102can be trained by the training computing system150on user-specific data received from the user computing device102. In some instances, this process can be referred to as personalizing the model.

The machine-learned models described in this specification may be used in a variety of tasks, applications, and/or use cases.

In some implementations, the input to the machine-learned model(s) of the present disclosure can be image data. The machine-learned model(s) can process the image data to generate an output. As an example, the machine-learned model(s) can process the image data to generate an image recognition output (e.g., a recognition of the image data, a latent embedding of the image data, an encoded representation of the image data, a hash of the image data, etc.). As another example, the machine-learned model(s) can process the image data to generate an image segmentation output. As another example, the machine-learned model(s) can process the image data to generate an image classification output. As another example, the machine-learned model(s) can process the image data to generate an image data modification output (e.g., an alteration of the image data, etc.). As another example, the machine-learned model(s) can process the image data to generate an encoded image data output (e.g., an encoded and/or compressed representation of the image data, etc.). As another example, the machine-learned model(s) can process the image data to generate an upscaled image data output. As another example, the machine-learned model(s) can process the image data to generate a prediction output.

In some implementations, the input to the machine-learned model(s) of the present disclosure can be text or natural language data. The machine-learned model(s) can process the text or natural language data to generate an output. As an example, the machine-learned model(s) can process the natural language data to generate a language encoding output. As another example, the machine-learned model(s) can process the text or natural language data to generate a latent text embedding output. As another example, the machine-learned model(s) can process the text or natural language data to generate a translation output. As another example, the machine-learned model(s) can process the text or natural language data to generate a classification output. As another example, the machine-learned model(s) can process the text or natural language data to generate a textual segmentation output. As another example, the machine-learned model(s) can process the text or natural language data to generate a semantic intent output. As another example, the machine-learned model(s) can process the text or natural language data to generate an upscaled text or natural language output (e.g., text or natural language data that is higher quality than the input text or natural language, etc.). As another example, the machine-learned model(s) can process the text or natural language data to generate a prediction output.

In some implementations, the input to the machine-learned model(s) of the present disclosure can be speech data. The machine-learned model(s) can process the speech data to generate an output. As an example, the machine-learned model(s) can process the speech data to generate a speech recognition output. As another example, the machine-learned model(s) can process the speech data to generate a speech translation output. As another example, the machine-learned model(s) can process the speech data to generate a latent embedding output. As another example, the machine-learned model(s) can process the speech data to generate an encoded speech output (e.g., an encoded and/or compressed representation of the speech data, etc.). As another example, the machine-learned model(s) can process the speech data to generate an upscaled speech output (e.g., speech data that is higher quality than the input speech data, etc.). As another example, the machine-learned model(s) can process the speech data to generate a textual representation output (e.g., a textual representation of the input speech data, etc.). As another example, the machine-learned model(s) can process the speech data to generate a prediction output.

In some implementations, the input to the machine-learned model(s) of the present disclosure can be latent encoding data (e.g., a latent space representation of an input, etc.). The machine-learned model(s) can process the latent encoding data to generate an output. As an example, the machine-learned model(s) can process the latent encoding data to generate a recognition output. As another example, the machine-learned model(s) can process the latent encoding data to generate a reconstruction output. As another example, the machine-learned model(s) can process the latent encoding data to generate a search output. As another example, the machine-learned model(s) can process the latent encoding data to generate a reclustering output. As another example, the machine-learned model(s) can process the latent encoding data to generate a prediction output.

In some implementations, the input to the machine-learned model(s) of the present disclosure can be statistical data. Statistical data can be, represent, or otherwise include data computed and/or calculated from some other data source. The machine-learned model(s) can process the statistical data to generate an output. As an example, the machine-learned model(s) can process the statistical data to generate a recognition output. As another example, the machine-learned model(s) can process the statistical data to generate a prediction output. As another example, the machine-learned model(s) can process the statistical data to generate a classification output. As another example, the machine-learned model(s) can process the statistical data to generate a segmentation output. As another example, the machine-learned model(s) can process the statistical data to generate a visualization output. As another example, the machine-learned model(s) can process the statistical data to generate a diagnostic output.

In some implementations, the input to the machine-learned model(s) of the present disclosure can be sensor data. The machine-learned model(s) can process the sensor data to generate an output. As an example, the machine-learned model(s) can process the sensor data to generate a recognition output. As another example, the machine-learned model(s) can process the sensor data to generate a prediction output. As another example, the machine-learned model(s) can process the sensor data to generate a classification output. As another example, the machine-learned model(s) can process the sensor data to generate a segmentation output. As another example, the machine-learned model(s) can process the sensor data to generate a visualization output. As another example, the machine-learned model(s) can process the sensor data to generate a diagnostic output. As another example, the machine-learned model(s) can process the sensor data to generate a detection output.

In some cases, the machine-learned model(s) can be configured to perform a task that includes encoding input data for reliable and/or efficient transmission or storage (and/or corresponding decoding). For example, the task may be an audio compression task. The input may include audio data and the output may comprise compressed audio data. In another example, the input includes visual data (e.g. one or more images or videos), the output comprises compressed visual data, and the task is a visual data compression task. In another example, the task may comprise generating an embedding for input data (e.g. input audio or visual data).

In some cases, the input includes audio data representing a spoken utterance and the task is a speech recognition task. The output may comprise a text output which is mapped to the spoken utterance. In some cases, the task comprises encrypting or decrypting input data. In some cases, the task comprises a microprocessor performance task, such as branch prediction or memory address translation.

FIG.1Bdepicts a block diagram of an example computing device10that performs according to example embodiments of the present disclosure. The computing device10can be a user computing device or a server computing device.

The computing device10includes a number of applications (e.g., applications 1 through N). Each application contains its own machine learning library and machine-learned model(s). For example, each application can include a machine-learned model. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc.

FIG.1Cdepicts a block diagram of an example computing device50that performs according to example embodiments of the present disclosure. The computing device50can be a user computing device or a server computing device.

The computing device50includes a number of applications (e.g., applications 1 through N). Each application is in communication with a central intelligence layer. Example applications include a text messaging application, an email application, a dictation application, a virtual keyboard application, a browser application, etc. In some implementations, each application can communicate with the central intelligence layer (and model(s) stored therein) using an API (e.g., a common API across all applications).

FIG.2depicts a data flow diagram for optimizing utilization of graphics processors for machine learning inference tasks according to example embodiments of the present disclosure. Specifically, as described previously, the significance of certain applications, such as video conferencing, has increased in recent years with an increasing number of meetings held virtually with remote participants. For video conferencing applications, one feature that has become increasingly important in this setting is background replacement or blurring, which is typically achieved through foreground/background segmentation. In conventional high-quality (HQ) segmentation networks, model capacity is usually the critical limitation beyond what central processing unit (CPU) inference can deliver. Accordingly, embodiments of the present disclosure leverage the GPU for real-time model inference of heavier networks. However, existing engines and/or application programming interfaces (APIs), such as JavaScript inference engines featuring WebGL acceleration, exhibit a sizable performance gap compared to others, such as OpenGL inference in a native app.

To achieve maximum performance, some embodiments of the present disclosure are fully executed on the GPU, from acquisition of the input202(e.g., image acquisition, etc.) over model (e.g., neural network) inference to providing the output210(e.g., rendering the segmented result on the screen).

Conventionally, the basic architecture of a GPU-accelerated neural network inference engine implements neural network operators in the form of GPU shaders. The inference loop is essentially enqueueing these shader programs in topologically sorted order of the neural network into the GPU command queue for asynchronous execution. Authoring such kernel implementations is relatively straightforward with modern GPU APIs supporting compute shaders. However, some existing APIs, such as WebGL, lack support for compute shaders. Thus, in some embodiments, the kernel implementations for a WebGL inference engine can be written in the form of fragment shaders.

Turning toFIG.2, the input202(e.g., an image input) to a machine-learned model can be obtained. Next, in some embodiments, logical and GPU objects can be separated. Logical objects refer to model (e.g., neural network) objects such as tensors, tensor buffers, spatial tensors, weight tensors etc. GPU objects refer to storage types available in APIs (e.g., WebGL) such as 2D texture, 2D texture array, framebuffer, etc. Separating these two types of objects allows the programmer to employ the fastest GPU building blocks for a particular situation, and not be bound to a specific GPU object

Next, the renderer204processes the input202while leveraging features of the API to render a plurality of textures206. For example, the renderer204may leverage WebGL features such as multi render targets (MRT). MRT is a feature of modern GPUs that allows rendering of images to multiple textures at once. When a programmer writes a shader that returns an output value for each render target, the shader renders to all render targets with a single draw call, significantly saving the overhead of multiple draw calls. In such fashion, the input202can be rendered by the renderer204via MRT to generate textures206.

The shaders208can be generated based at least in part on the plurality of textures206. Specifically, in some embodiments, a flexible tensor layout and shader code generation may be leveraged to generate the shaders208. For example, in the naivest form, a tensor of shape [H,W,C] can generally be mapped to a 4-channel 2D texture of size

However, depending on the parallelization of the workload and its memory access pattern, a different layout, with the x-axis and y-axis swapped, may be more efficient than the naive mapping. To be able to optimize various use cases, embodiments of the present disclosure facilitate flexible tensor layouts that can be specified by a user, or determined in real-time. As this must be accompanied by multiple shader implementations that can accommodate the different axis layouts, embodiments of the present disclosure support on-the-fly shader code generation with respect to the active layout to generate the shaders208. The shaders208can process the textures206to obtain the machine learning output210.

In such fashion, Multi-Target rendering can be utilized to substantially increase efficiency of GPU processing for inference. To provide an illustrative example, a convolution can be performed for 32x32x1 to 32x32x1. Using conventional techniques, 32x32 (1024) threads must be run. For example, reading the input value from the source tensor incurs 1 float per thread (1024 float total), reading weight value from weight tensor incurs 1 float per thread (1024 float total), and writing output value to destination tensor incurs 1 float per thread (1024 float total). However, using embodiments of the present disclosure, 16x16 threads (256) could be run in which each thread processes 4x values. For example, reading an input value from the source tensor incurs 4 floats per thread (1024 float total), reading weight values from the weight tensor incurs one float per thread (256total), and writing the output value to the destination tensor incurs 4 floats per thread (1024 float total) via MRT. Accordingly, 1024 requests can be reduced to256total requests.

More specifically, in conventional approaches, logical objects such as tensors are mapped in a one-to-one manner with GPU objects (e.g., textures, buffers, etc.). For example, a three-dimensional tensor (e.g., logical object) with shape [H, W, 3] may be represented as a GL texture (e.g., webGL, etc.) of size [H,W], as GL textures have a depth of 4. Accordingly, the representation of tensors as textures is performed in a hard-coded fashion.

Conversely, embodiments of the present disclosure provide for seperation between logical and GPU objects, therefore facilitating mapping of logical and GPU objects outside of a hard-coded one-to-one manner. For example, an input tensor202may be represented with 4 GL textures206. As such, By separating logical and physical objects, execution of shaders208can read multiple textures representing an input (e.g., via MRT, etc.). When rendering, the compiler is fully aware of the characteristics of the logical objects, and can transform to GPU objects (e.g., textures, etc.) automatically. As such, a single source representation of an ML operation (e.g., convolution) can use a tensor as input and a tensor as output. However, the storage / layout of these tensors can be determined later on depending on other requirements (e.g., performance, memory consumption, initialization time, GPU capabilities, etc.).

As an example, inference-time processing for a machine-learned model can requested an application programming interface. Model processing can include the following operations: input (512x512x3) > conv1 > relu1 > depth_wise_conv > conv2 > relu2 > resize > output (512x512x1). Input202can be a gpu_texture (512x512x3) (e.g., width x height x RGB channels). For the initialization stage, GPU programs can be created for conv1 + relu1, depth_wise_conv, conv2 + relu2, and resize. In some embodiments, relu1 can be performed in a single pass with convolution to save memory bandwidth.

To follow the previous example, GPU objects tensor1 (256x256x16), tensor2 (256x256x16), tensor3 (128x128x1), and tensor 4 (512x512x1) can be created. In some embodiments, tensors can reuse memory. Starting from the input, processing can occur such that tensor0(input) > conv1+relu1 > tensor1 > depth_wise_conv > tensor2 > conv2+relu2 > tensor3 > resize > tensor4(output). In this example, tensor 1 can utlize 4 textures for layout/storage to fully utilize MRT in the conv1+relu1 operation. Tensor 2 can utilize 1 texture to optimize performance for conv2+relu2. Tensor 3 can include 4 textures to facilitate MRT utilization in conv2+relu2 operations, and tensor 4 can include 1 texture to exclude extra conversion for output of the gpu_texture (512x512x1). Specifically, as tensor 2 is an input for conv2+relu2 operations, and tensor 3 is the output of said operations, the combination with best performance can be asymmetric in the number of textures used for tensor representation.

As an example, input202can be a tensor of 5 dimensions. Textures206can include four textures that are rendered to represent the input tensor202at the renderer204.

It should be noted that embodiments of the present disclosure are described with regards to the WebGL API merely to illustrate the functionality of said embodiments. Specifically, image segmentation is illustrated as CPU inference is not sufficient to run higher capacity image segmentation networks at a high frame rate, and therefore, inference must be performed using available hardware accelerators via certain APIs (e.g., WebGL). While newer accelerators such as the digital signal processor (DSP) and the neural processing unit (NPU) are fragmented and do not have a web standard, the graphics processing unit (GPU) is universally available and has a well-established API for the web, making it a natural choice to illustrate.

Similarly, WebGL is a standard API for GPU rendering for applications executed within a web browser, and supported by all major web browsers. There are a handful of other ML inference engines for the web with WebGL acceleration such as TensorFlow and ONNX runtime web, but the performance of the WebGL acceleration of the existing solutions did not meet expectations, being 3-4 times slower than native performance. Thus, examples of the present disclosure are illustrated via WebGL acceleration.

Some aspects of the present disclosure are based on conventional engines, such as tensor flow. However, the model (e.g., neural network) operations of the present disclosure are implemented via shaders (e.g., fragment shaders), as WebGL does not support compute shaders. MRT is utilized to rephrase these tasks in the language of rendering. MRT allows rendering of images to multiple textures at once with a single draw command, significantly reducing the overhead of multiple draw calls. In some embodiments, to leverage MRT, modifications are applied to existing engine blueprints, such as TFLite GPU. First, logical tensors and physical GPU objects are separated (e.g., which have a 1:1 correspondence in TFLite GPU.) Then, the tensors are allowed to take flexible shapes instead of the hard-coded layout to efficiently employ MRT.

FIG.3illustrates a data flow diagram for an implemented decoder block according to some embodiments of the present disclosure. Specifically,FIG.3illustrates a decoder block for a segmentation head with 1x1 convolution, batch normalization, and activation layers omitted. As illustrated, decoder block300takes a low-resolution segmentation result and a high-resolution skip connection, and outputs a high-resolution result to the next level. It extracts features from the skip connection through channel-wise attention, and adds them to the segmentation result from the previous level. The enriched segmentation is further refined with some convolution layers. For foreground/background segmentation, the head only needs to output a one-channel mask. To illustrate the effectiveness of a segmentation head that includes the decoder block300, two models are trained with the same backbone (MobileNetV3-Small) and training configurations, but with different heads: LR-ASPP and the head illustrated inFIG.3. Figure As illustrated in the following table, the segmentation head ofFIG.3significantly boosts the quality metrics of intersection-over-union (IOU) and boundary F-score, while only adding 8% more parameters:

FIG.4Aillustrates results for inference latency for high quality segmentation on various implementations of application programming interfaces according to some embodiments of the present disclosure. Specifically, to evaluate the embodiments of the present disclosure, a focus is placed on in-browser applications, such as web-based video conferencing and AR effects, where ML solutions are running in a sandbox environment without direct access to on-device GPUs.FIG.4Aillustrates inference time utilizing embodiments of the present disclosure (e.g., ML Drift) versus other inference engines, such as TensorFlow.js (TF.js) WebAssembly (Wasm) and WebGL. The Wasm backend is accelerated by SIMD instructions, TF.j s WebGL backend utilizes GPU to accelerate model inference, and similar implementations are available in other engines with comparable performance.

FIG.4Billustrates results for evaluation of high quality segmentation models according to some embodiments of the present disclosure. Specifically, utilizing embodiments of the present disclosure, HQ models can be run with larger capacities and image sizes in browsers. For evaluation two groups of segmentation models are trained according to some embodiments of the present disclosure: HQ-MS, HQ-ML, and HQ-E0~E4. The first two are based on small and large versions of MobileNetV3. The remaining five are based on EfficientNet-Lite with increasing model sizes. All models are equipped with our segmentation head and trained with the same data and hyperparameters. The input image size is512×288

As depicted inFIG.3, the HQ-MS model shows higher quality than HQ-E0 with a comparable model size. This demonstrates the effectiveness of the SE for small-sized models. As model size increases, the two groups of HQ models show similar values of quality metrics. For the models of comparable inference time, HQ-E models have consistently higher quality than HQ-M models, with noticeable margins. This is due to the global pooling in the squeeze-and-excite layers, which is challenging for GPU acceleration.

FIG.5Aillustrates image segmentation results utilizing two models processed according to some embodiments of the present disclosure. In particular,FIG.5Aillustrates improvements in image segmentation in comparison to conventional techniques. For example, image502is an image of a particular input size (e.g.,512x288pixels, etc.). Image segmentation result504is the output of a conventional CPU-based image segmentation model. As depicted, the segmentation result demonstrates substantial loss of detail. Image segmentation results506and508are the outputs of two machine-learned models constructed according to two particular implementations of the present disclosure. As illustrated, unlike the image segmentation results504generated using conventional models, the image segmentation results506and508retain substantially more detail.

FIG.5Billustrates high quality segmentation results utilizing two models processed according to some embodiments of the present disclosure.

FIG.6depicts a flow chart diagram of an example method to perform according to example embodiments of the present disclosure. AlthoughFIG.6depicts operations performed in a particular order for purposes of illustration and discussion, the methods of the present disclosure are not limited to the particularly illustrated order or arrangement. The various operations of the method600can be omitted, rearranged, combined, and/or adapted in various ways without deviating from the scope of the present disclosure.

At operation602, a computing system can include a Graphics Processing Unit (GPU). The computing system can simultaneously render a plurality of textures from an input to a machine-learned model. For example, the computing system can render the textures via a Multi-Render Target (MRT) process of a WebGL Application Programming Interface (API). The machine-learned model can be associated with an application that uses the WebGL API. For example, the application can be a gaming application that renders textures using the WebGL API, and the machine-learned model can be a model associated with the gaming application. In some implementations, the application can be executed in a web browser. Additionally, or alternatively, in some implementations, the application can be a videoconferencing application.

In some implementations, the plurality of textures can be simultaneously rendered by the computing system using the GPU. For example, the input to the machine-learned model can be an image. The computing system can utilize rendering software and/or hardware of the GPU to simultaneously render textures that are representative of the image. In other words, the computing system can, in some implementations, simultaneously render a plurality of textures that is representative of the machine-learned model (e.g., a plurality of textures that collectively represent an image input or a tensor derived from an input image, etc.).

More specifically, the MRT process is a feature of the WebGL API that allows rendering of inputs, such as images, to multiple textures at once. Although this is conventionally used for rendering, it can also be used for machine-learned inference. For example, for an image segmentation task, a plurality of textures can be simultaneously rendered from the image to be segmented. The textures can then be processed with machine-learned model objects that are represented by shaders (e.g., fragment shaders). This allows for usage of the GPU, rather than a central processor, and also facilitates parallel processing to substantially increase performance, efficiency, and accuracy of the machine-learned model.

In some implementations, prior to simultaneously rendering the plurality of textures, the computing system can obtain the input to the machine-learned model. The machine-learned model can be trained to perform a task associated with the input. For example, the input to the machine-learned model can be, or otherwise include, image data, and the task the machine-learned model is trained to perform can be an image segmentation task.

At operation604, the computing system can generate a plurality of shaders based at least in part on a layout of the plurality of textures. Each of the plurality of shaders can correspond to at least one operator of a plurality of operators of the machine-learned model. For example, the plurality of shaders can be a plurality of fragment shaders.

In some implementations, prior to generating the plurality of shaders, the computing system can determine a plurality of GPU objects indicative of available processing capabilities of the GPU. The computing system can determine the layout of the plurality of textures based at least in part on the plurality of GPU objects. In other words, the layout of the plurality of textures can be determined based on the processing capabilities of the GPU. In some implementations, the layout of the textures can be specified by a user.

At operation606, the computing system can process the plurality of textures with the plurality of shaders to obtain a machine-learning output for the machine-learned model. In some implementations, to process the shaders, the computing system can extract the machine learning output from an intermediate representation. For example, the machine-learning output can be, or otherwise include, an intermediate texture output representative of the machine-learning output. The computing system can extract the machine-learning output from the intermediate texture output.

Additional Disclosure