Systems and methods for efficient processing of input with dynamic input size using machine learning model
By identifying and executing valid and semi-valid operations while skipping invalid ones, the system optimizes machine learning model processing for dynamic input sizes, enhancing efficiency and reducing resource usage.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-10-02
- Publication Date
- 2026-04-09
AI Technical Summary
Existing machine learning models with static computational graphs face inefficiencies when processing inputs with dynamic sizes, leading to unnecessary computations, memory usage, and battery power consumption due to padding with zeroes or garbage data, regardless of the actual input size.
A system identifies differences between input and context window sizes, executing valid and semi-valid operations while skipping invalid operations, reusing existing implementations where possible and modifying or creating new ones for semi-valid operations to enhance efficiency.
This approach improves processing efficiency by reducing unnecessary computations, memory usage, and power consumption, making AI accelerators more flexible and efficient with dynamic input sizes.
Smart Images

Figure CN2024123161_09042026_PF_FP_ABST
Abstract
Description
SYSTEMS AND METHODS FOR EFFICIENT PROCESSING OF INPUT WITH DYNAMIC INPUT SIZE USING MACHINE LEARNING MODELFIELD
[0001] This application is related to machine learning model operation and / or optimization. More specifically, this application relates to systems and methods for automatically processing inputs having dynamic input sizes (e.g., token sizes or token lengths) efficiently in the context of a trained machine learning model using a static computational graph and / or context window size, for instance by executing certain operations in the static computational graph (e.g., valid operations and / or semi-valid operations) while skipping other operations in the static computational graph (e.g., invalid operations corresponding to a difference between input size and context window size) .BACKGROUND
[0002] A machine learning (ML) model is a type of artificial intelligence algorithm that learns how to perform a task, or estimate an outcome of a task, based on training data. For instance, the training data may include examples of inputs and outputs of the task. In some examples, an ML model can use statistical analyses to identify a most likely outcome based on an input to the ML model and / or based on the training of the ML model.
[0003] BRIEF SUMMARY
[0004] Systems and techniques for machine learning model operation and / or optimization are described. In some examples, a system identifies a difference between an input size of an input and a context window size associated with a trained machine learning model. The trained machine learning model is associated with a computational graph having a static shape. The computational graph includes a plurality of operations. The system processes the input using the trained machine learning model to generate an output. To process the input using the trained machine learning model, the system executes a first subset of the plurality of operations (e.g., valid operations and / or semi-valid operations) and skips a second subset of the plurality of operations (e.g., invalid operations) . The first subset of the plurality of operations is associated with the input, while the second subset of the plurality of operations is associated with the difference.
[0005] In some examples, the first subset of the plurality of operations includes valid operations and / or semi-valid operations. To execute the valid operations of the first subset, the system can execute a valid operation according to a predetermined operation implementation for the valid operation. To execute the semi-valid operations of the first subset, the system can execute a semi-valid operation according to a predetermined operation implementation for the semi-valid operation, according to a modified variant of a predetermined operation implementation (e.g., with one or more loops skipped) for the semi-valid operation, or according to a new operation implementation.
[0006] In one example, an apparatus is provided. The apparatus includes a memory and one or more processors (e.g., implemented in circuitry) coupled to the memory. The one or more processors are configured to and can: identify a difference between a token size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; and execute a first subset of the plurality of operations and skip a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.
[0007] In another example, a method is provided. The method includes: identifying a difference between a token size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; and executing a first subset of the plurality of operations and skipping a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.
[0008] In another example, a non-transitory computer-readable medium is provided that has stored thereon instructions that, when executed by one or more processors, cause the one or more processors to: identify a difference between a token size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; and execute a first subset of the plurality of operations and skip a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.
[0009] In another example, an apparatus is provided. The apparatus includes: means for identifying a difference between a token size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; and means for executing a first subset of the plurality of operations and skipping a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.
[0010] In some aspects, the apparatus is part of, and / or includes a wearable device, an extended reality device (e.g., a virtual reality (VR) device, an augmented reality (AR) device, or a mixed reality (MR) device) , a head-mounted display (HMD) device, a wireless communication device, a mobile device (e.g., a mobile telephone and / or mobile handset and / or so-called “smart phone” or other mobile device) , a camera, a personal computer, a laptop computer, a server computer, a vehicle or a computing device or component of a vehicle, another device, or a combination thereof. In some aspects, the apparatus includes a camera or multiple cameras for capturing one or more images. In some aspects, the apparatus further includes a display for displaying one or more images, notifications, and / or other displayable data. In some aspects, the apparatuses described above can include one or more sensors (e.g., one or more inertial measurement units (IMUs) , such as one or more gyroscopes, one or more gyrometers, one or more accelerometers, any combination thereof, and / or other sensor) .
[0011] This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used in isolation to determine the scope of the claimed subject matter. The subject matter should be understood by reference to appropriate portions of the entire specification of this patent, any or all drawings, and each claim.
[0012] The foregoing, together with other features and aspects, will become more apparent upon referring to the following specification, claims, and accompanying drawings.BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Illustrative aspects of the present application are described in detail below with reference to the following drawing figures:
[0014] FIG. 1 is a block diagram illustrating an example of a neural network that can be used for processing input data to generate output data using various operations, in accordance with some examples;
[0015] FIG. 2A is a conceptual diagram illustrating an example of a static computational graph associated with a machine learning model, with a first subset of the operations in the static computational graph being valid operations, a second subset of the operations in the static computational graph being semi-valid operations, and a third subset of the operations in the static computational graph being invalid operations, in accordance with some examples;
[0016] FIG. 2B is a conceptual diagram illustrating an example of a static computational graph associated with a machine learning model, with a first subset of the operations in the static computational graph being valid operations, a second subset of the operations in the static computational graph being semi-valid operations, and a third subset of the operations in the static computational graph being invalid operations, in accordance with some examples;
[0017] FIG. 3 is a flow diagram illustrating a process for classification and / or processing of an operation in a static computational graph associated with a machine learning model, in accordance with some examples;
[0018] FIG. 4 is a flow diagram illustrating a process for classification and / or processing of operations of a static computational graph associated with a machine learning model, in accordance with some examples;
[0019] FIG. 5 is a block diagram illustrating a process for spilling and / or filling to apply shape propagation, in accordance with some examples;
[0020] FIG. 6 is a graph diagram illustrating comparisons of performance of a machine learning model using different operation processing schemes for processing operations in a static computational graph associated with the machine learning model, in accordance with some examples;
[0021] FIG. 7 is a flow diagram illustrating a process for ML model operation, in accordance with some examples; and
[0022] FIG. 8 is a diagram illustrating an example of a computing system for implementing certain aspects described herein.DETAILED DESCRIPTION
[0023] Certain aspects of this disclosure are provided below. Some of these aspects may be applied independently and some of them may be applied in combination as would be apparent to those of skill in the art. In the following description, for the purposes of explanation, specific details are set forth in order to provide a thorough understanding of aspects of the application. However, it will be apparent that various aspects may be practiced without these specific details. The figures and description are not intended to be restrictive.
[0024] The ensuing description provides example aspects only, and is not intended to limit the scope, applicability, or configuration of the disclosure. Rather, the ensuing description of the example aspects will provide those skilled in the art with an enabling description for implementing an example aspect. It should be understood that various changes may be made in the function and arrangement of elements without departing from the spirit and scope of the application as set forth in the appended claims.
[0025] A machine learning (ML) model is a type of artificial intelligence algorithm that learns how to perform a task, or estimate an outcome of a task, based on training data. For instance, the training data may include examples of inputs and outputs of the task. In some examples, an ML model can use statistical analyses to identify a most likely outcome based on an input to the ML model and / or based on the training of the ML model.
[0026] Systems and techniques for machine learning model operation and / or optimization are described. In some examples, a system identifies a difference between an input size of an input and a context window size associated with a trained machine learning model. The trained machine learning model is associated with a computational graph having a static shape. The computational graph includes a plurality of operations. The system processes the input using the trained machine learning model to generate an output. To process the input using the trained machine learning model, the system executes a first subset of the plurality of operations (e.g., valid operations and / or semi-valid operations) and skips a second subset of the plurality of operations (e.g., invalid operations) . The first subset of the plurality of operations is associated with the input, while the second subset of the plurality of operations is associated with the difference.
[0027] In some examples, the first subset of the plurality of operations includes valid operations and / or semi-valid operations. To execute the valid operations of the first subset, the system can execute a valid operation according to a predetermined operation implementation for the valid operation. To execute the semi-valid operations of the first subset, the system can execute a semi-valid operation according to a predetermined operation implementation for the semi-valid operation, according to a modified variant of a predetermined operation implementation (e.g., with one or more loops skipped) for the semi-valid operation, or according to a new operation implementation.
[0028] The systems and techniques allow for automatically processing inputs having dynamic input sizes (e.g., token sizes or token lengths) efficiently in the context of a trained machine learning model using a static computational graph and / or context window size, for instance by executing certain operations in the static computational graph (e.g., valid operations and / or semi-valid operations) while skipping other operations in the static computational graph (e.g., invalid operations corresponding to a difference between input size and context window size) .
[0029] Various aspects of the application will be described with respect to the figures. FIG. 1 is a block diagram illustrating an example of a neural network 100 that can be used for imaging operations. The neural network 100 can include any type of deep network, such as a convolutional neural network (CNN) , an autoencoder, a deep belief net (DBN) , a Recurrent Neural Network (RNN) , a Generative Adversarial Networks (GAN) , an auto-regressive transformer models, and / or other type of neural network. The neural network 100 may be, and / or may include, an ML model associated with the static computational graph 200A, an ML model associated with the static computational graph 200B, an ML model associated with the process 300, an ML model associated with the process 400, an ML model associated with the process 500, an ML model having the performance 615, an ML model having the performance 620, an ML model having the performance 625, an ML model associated with the process 700, an ML model running on the computing system 800, or a combination thereof.
[0030] An input layer 110 of the neural network 100 includes input data. The input data received by the input layer 110 can include the input 210, the input 250, the input of block 305, the input of block 705, characters (e.g., alphanumeric characters) , strings of text, image data, audio data, video data, depth data such as point clouds, other types of inputs discussed herein, or a combination thereof. In some examples, for instance if the neural network 100 is a large language model (LLM) , the input data received by the input layer 110 can include a prompt for the LLM. In some examples, the input data of the input layer 110 includes processed data that is to be processed further, such as various features, weights, intermediate data, output (s) of certain intermediate layer (s) or node (s) , or a combination thereof.
[0031] The neural network 100 includes multiple hidden layers 112, 112B, through 112N. The hidden layers 112, 112B, through 112N include “N” number of hidden layers, where “N” is an integer greater than or equal to one. The number of hidden layers can be made to include as many layers as needed for the given application. The neural network 100 further includes an output layer 114 that provides an output resulting from the processing performed by the hidden layers 112, 1012B, through 1012N.
[0032] In some examples, the output layer 114 can provide output data. The output data can include the output 215, the output 255, the output of block 350, the output of block 710, characters (e.g., alphanumeric characters) , strings of text, image data, audio data, video data, depth data such as point clouds, other types of outputs discussed herein, or a combination thereof. In some examples, for instance if the neural network 100 is a large language model (LLM) , the output data provided by the output layer 114 can include a response generated by the LLM to be responsive to a prompt. In some examples, the output data from the output layer 114 includes processed data that is to be processed further, such as various features, weights, intermediate data, output (s) of certain intermediate layer (s) or node (s) , or a combination thereof.
[0033] The neural network 100 is a multi-layer neural network of interconnected filters. Each filter can be trained to learn a feature representative of the input data. Information associated with the filters is shared among the different layers and each layer retains information as information is processed. In some cases, the neural network 100 can include a feed-forward network, in which case there are no feedback connections where outputs of the network are fed back into itself. In some cases, the network 100 can include a recurrent neural network, which can have loops that allow information to be carried across nodes while reading in input.
[0034] In some cases, information can be exchanged between the layers through node-to-node interconnections between the various layers. In some cases, the network can include a convolutional neural network, which may not link every node in one layer to every other node in the next layer. In networks where information is exchanged between layers, nodes of the input layer 110 can activate a set of nodes in the first hidden layer 112A. For example, as shown, each of the input nodes of the input layer 110 can be connected to each of the nodes of the first hidden layer 112A. The nodes of a hidden layer can transform the information of each input node by applying activation functions (e.g., filters) to this information. The information derived from the transformation can then be passed to and can activate the nodes of the next hidden layer 112B, which can perform their own designated functions. Example functions include convolutional functions, downscaling, upscaling, data transformation, and / or any other suitable functions. The output of the hidden layer 112B can then activate nodes of the next hidden layer, and so on. The output of the last hidden layer 112N can activate one or more nodes of the output layer 114, which provides a processed output image. In some cases, while nodes (e.g., node 116) in the neural network 100 are shown as having multiple output lines, a node has a single output and all lines shown as being output from a node represent the same output value.
[0035] In some cases, each node or interconnection between nodes can have a weight that is a set of parameters derived from the training of the neural network 100. For example, an interconnection between nodes can represent a piece of information learned about the interconnected nodes. The interconnection can have a tunable numeric weight that can be tuned (e.g., based on a training dataset) , allowing the neural network 100 to be adaptive to inputs and able to learn as more and more data is processed.
[0036] In some aspects, training of one or more of the machine learning systems or neural networks described herein can be performed using online training (e.g., in some case on-device training) , offline training, and / or various combinations of online and offline training. In some cases, online may refer to time periods during which the input data (e.g., such as the input data discussed with respect to the input layer 110) is processed, for instance for generating output data (e.g., such as the input data discussed with respect to the output layer 114) . In some examples, offline may refer to idle time periods or time periods during which input data is not being processed. Additionally, offline may be based on one or more time conditions (e.g., after a particular amount of time has expired, such as a day, a week, a month, etc. ) and / or may be based on various other conditions such as network and / or server availability, etc., among various others. In some aspects, offline training of a machine learning model (e.g., a neural network model) can be performed by a first device (e.g., a server device) to generate a pre-trained model, and a second device can receive the trained model from the second device. In some cases, the second device (e.g., a mobile device, an XR device, a vehicle or system / component of the vehicle, or other device) can perform online (or on-device) training of the pre-trained model to further adapt or tune the parameters of the model.
[0037] The neural network 100 is pre-trained to process the features from the data in the input layer 110 using the different hidden layers 112, 112B, through 112N in order to provide the output through the output layer 114.
[0038] In some examples, the neural network 100 may be a large language model (LLM) . An LLM is a computational model capable of language generation or other natural language processing tasks. LLMs acquire these abilities by learning statistical relationships from vast amounts of text during a self-supervised and / or semi-supervised training processes. In some examples, an LLM can be used for language-based tasks such as autocompleting a partially- written message, responding to a message with a reply that is conversationally-responsive to the message, translating a message, summarizing a message, finding and / or fixing errors in a message (e.g., typographical errors, grammatical errors, spelling errors, bugs in code, and the like) , other language-based tasks, or combinations thereof.
[0039] Inputs to machine learning models, such as the neural network 100 and / or an LLM, can have variable sizes and / or lengths. In some examples, a size or length of an input can be referred to as an input size or input length. In some cases, the input size can be measured in tokens, in which case the input size can be referred to as a token size or token length. A token can refer to one or more characters (e.g., alphanumeric characters) . In some examples, a token refers to a word, a part of a word, or a combination thereof. For instance, an input to an LLM can include a prompt that a user can use to ask the LLM to perform a task. Different prompts can have different token sizes. For instance, a prompt reading “describe an LCD” has a shorter token size than a prompt reading “write a poem about chocolate cake with at least four stanzas in the style of William Shakespeare. ” A context window size (context window length) can represent a maximum token size of an input to an ML models (e.g., LLM) . In some examples, an ML model (e.g., LLM) has a context window size (context window length) that is static.
[0040] In cases where an ML model uses a static context window size and / or a static computational graph, the ML model may process the input by processing the full contents of the static context window (e.g., the full size of the static context window) , even if the input size is smaller than the static context window size. For instance, the input can fill up a portion of the static context window, and the rest of the static context window (representing a difference between the static context window size and the input size) can be filled in (padded) with zeroes or other garbage data. However, even if the rest of the static context window is filled with zeroes or other garbage data, the ML model still performs unnecessary operations using those zeroes or other garbage data, which can be inefficient, cause the processor (s) to perform unnecessary computations, use up unnecessary memory, use up unnecessary bandwidth, use up unnecessary battery power, or a combination thereof. For instance, using the examples above, padding the unused portion of the static context window (e.g., with zeroes or other garbage data) can cause processing of inputs to have the same inference latency, regardless of the actual input size (e.g., same inference latency for “describe an LCD” as for “write a poem about chocolate cake with at least four stanzas in the style of William Shakespeare” ) .
[0041] Instead, the systems and methods discussed herein can allow processor (s) to skip such operation (s) (corresponding to the difference between an input’s size and the context window size) entirely, improving efficiency in processing the input using an ML model. The systems and methods discussed herein can allow processor (s) to improve efficiency for the operations that the processor (s) do perform as well, for instance by re-using existing operation implementations where possible and / or by bypassing unnecessary computation loops where possible.
[0042] AI accelerator hardware can include deep learning processor (s) and / or or neural processing unit (s) (NPU (s) ) , is a class of specialized hardware processor, accelerator, and / or computer system that is designed to efficiently perform operations that are commonly used by ML model (s) (e.g., LLM (s) ) and / or other AI model (s) . In some examples, certain AI accelerators, NPU(s) , and / or NPU compilers may require a static context window size and / or a static computational graph, or may operate with improved efficiency when a static context window size and / or a static computational graph are used. Thus, improving efficiency of processing input (s) for ML model (s) with a static context window size and / or a static computational graph (as is done by the systems and methods described herein) can further enhance AI accelerator hardware, and / or can make AI accelerator hardware more flexible (e.g., by working better with dynamic input sizes) and / or more efficient (e.g., by improving efficiency where there is a difference between input size and context window size) .
[0043] FIG. 2A is a conceptual diagram illustrating an example of a static computational graph 200A associated with a machine learning (ML) model, with a first subset of the operations in the static computational graph 200A being valid operations 230, a second subset of the operations in the static computational graph 200A being semi-valid operations 235, and a third subset of the operations in the static computational graph 200A being invalid operations 240. An input 210 is provided to the ML model. The static computational graph 200A may have a size, shape, and / or dimension (s) that are static.
[0044] The ML model and / or static computational graph 200A may have a context window size 220 (also referred to as context window length) that is static, in some examples. the context window size 220 may represent a maximum size (e.g., length, in the case of a string of text) of the input 210. The shape, size, and / or other dimension (s) of the static computational graph 200A may be based on the context window size 220. The input 210 may have an input size 225 (also known as input length) that is smaller than a context window size (context window length) associated with the ML model and / or the static computational graph 200A. For instance, there may be a difference 228 between the input size 225 and the context window size 220.
[0045] In the static computational graph 200A illustrated in FIG. 2A, each operation of the static computational graph 200A is illustrated as a circle. The operations can include, for example, Abs, Acos, Acosh, Add, And, ArgMax, ArgMin, Asin, Asinh, Atan, Atanh, AveragePool, BatchNormalization, BitShift, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseXor, Cast, Ceil, Col2Im, Compress, Concat, ConcatFromSequence, Constant, ConstantOfShape, Conv, ConvInteger, ConvTranspose, Cos, Cosh, CumSum, DFT, DeformConv, DepthToSpace, DequantizeLinear, Det, Div, Dropout, Einsum, Equal, Erf, Exp, Expand, EyeLike, Flatten, Floor, GRU, Gather, GatherElements, GatherND, Gemm, GlobalAveragePool, GlobalLpPool, GlobalMaxPool, Greater, GridSample, Hardmax, Identity, If, ImageDecoder, InstanceNormalization, IsInf, IsNaN, LRN, LSTM, Less, Log, Loop, LpNormalization, LpPool, MatMul, MatMulInteger, Max, MaxPool, MaxRoiPool, MaxUnpool, Mean, MelWeightMatrix, Min, Mod, Mul, Multinomial, Neg, NonMaxSuppression, NonZero, Norm, Not, OneHot, Optional, OptionalGetElement, OptionalHasElement, Or, Pad, Pow, QLinearConv, QLinearMatMul, QuantizeLinear, RNN, RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike, Reciprocal, ReduceMax, ReduceMean, ReduceMin, ReduceProd, ReduceSum, RegexFullMatch, Reshape, Resize, ReverseSequence, RoiAlign, Round, STFT, Scan, Scatter (deprecated) , ScatterElements, ScatterND, SequenceAt, SequenceConstruct, SequenceEmpty, SequenceErase, SequenceInsert, SequenceLength, Shape, Sigmoid, Sign, Sin, Sinh, Size, Slice, SpaceToDepth, Split, SplitToSequence, Sqrt, Squeeze, StringConcat, StringNormalizer, StringSplit, Sub, Sum, Tan, Tanh, TfIdfVectorizer, Tile, TopK, Transpose, Trilu, Unique, Unsqueeze, Upsample (deprecated) , Where, Xor, Function, AffineGrid, Bernoulli, BlackmanWindow, CastLike, Celu, CenterCropPad, Clip, DynamicQuantizeLinear, Elu, Gelu, GreaterOrEqual, GroupNormalization, HammingWindow, HannWindow, HardSigmoid, HardSwish, LayerNormalization, LeakyRelu, LessOrEqual, LogSoftmax, MeanVarianceNormalization, Mish, NegativeLogLikelihoodLoss, PRelu, Range, ReduceL1, ReduceL2, ReduceLogSum, ReduceLogSumExp, ReduceSumSquare, Relu, Selu, SequenceMap, Shrink, Slidepad, Softmax, SoftmaxCrossEntropyLoss, Softplus, Softsign, ThresholdedRelu, sigmoid functions, or a combination thereof. In an illustrative example, the operations can include mean, matmul (matrix multiplication) , softmax, norm, max, min, add, divide, sigmoid functions, concat (concatenation) , conv (convolution) , any of the other operations listed above, or a combination thereof. In some examples, the operations can be referred to as ops. In some examples, the operations can be referred to as mini-operations or miniops.
[0046] In the static computational graph 200A illustrated in FIG. 2A, a classifier processes the input and / or the ML model to categorize the various operations of the static computational graph 200A so that each operation is categorized under one of the categories identified in the legend 245: valid operations 230, semi-valid operations 235, or invalid operations 240. Any operations (of the static computational graph 200A) that process a part of the input 210 that fits within the input size 225 are classified, by the classifier, as valid operations 230 or semi-valid operations 235. Any operations (of the static computational graph 200A) that are to process part of the input 210 that represents the valid operations 230 between the context window size 220 and the input size 225 are classified, by the classifier, as invalid operations 240. As noted in the 245 / / , the valid operations 230 are illustrated as circles filled in with black, the semi-valid operations 235 are illustrated as circled filled in with a halftone pattern, and the invalid operations 240 are illustrated as circled filled in with white.
[0047] In an illustrative example illustrated in FIG. 2A, the input 210 includes a string of text (e.g., a prompt for an LLM) reading “Describe an LCD. ” For illustrative purposes, the context window size 220 and the input size 225 are represented in terms of number of characters. For instance, the input size 225 (the length of the string “Describe an LCD” in characters) is 15 characters. On the other hand, the context window size 220 is 22 characters. This leaves a difference 228 of 7 characters that are essentially empty data, filler data, and / or padding data in the input 210, just to fill up the context window size 220. In the context of this example, the operations in the static computational graph 200A that process the “Describe an LCD” text (e.g., with the 15-character input size 225) are classified (by the classifier) as valid operations 230 and / or semi-valid operations 235. On the other hand, the operations in the context window size 220 that are to process the remaining 7 characters in the context window (representing the valid operations 230 between the context window size 220 and the input size 225) are classified (by the classifier) as invalid operations 240. An example of the output 215 is also illustrated in FIG. 2A as stating “A liquid crystal display (LCD) is a type of disp…, ” representing an output that is conversationally responsive to the input 210 that reads “Describe an LCD. ” In some examples, the context window size 220 and / or the input size 225 are measured in token size and / or token length (e.g., number of tokens) rather than number of characters.
[0048] When a computing system processes the input 210 using the ML model (e.g., using the static computational graph 200A) , the computing system can use the classifications generated by the classifier to skip performance of certain operations entirely, and to process other operations as efficiently as possible. For instance, the classifier detects when certain operations are invalid operations 240 so that the computing system can skip performance of the invalid operations 240 entirely. The classifier detects when certain operations are valid operations 230 so the computing system can re-use existing (predetermined) operation implementations when performing the valid operations 230. The classifier detects when certain operations are semi-valid operations 235 so that the classifier and / or the computing system can perform a more detailed analysis for the semi-valid operations 235. For instance, the computing system can execute a semi-valid operation according to an existing (predetermined) operation implementation for the semi-valid operation, according to a modified variant of an existing (predetermined) operation implementation (e.g., with one or more loops skipped) for the semi-valid operation, or according to a new (dynamic) operation implementation.
[0049] FIG. 2B is a conceptual diagram illustrating an example of a static computational graph 200B associated with a machine learning (ML) model, with a first subset of the operations in the static computational graph 200B being valid operations 230, a second subset of the operations in the static computational graph 200B being semi-valid operations 235, and a third subset of the operations in the static computational graph 200B being invalid operations 240. The static computational graph 200B may have a size, shape, and / or dimension (s) that are static.
[0050] In the static computational graph 200B of FIG. 2B, the context window size 220 is 2048 tokens, while the input size 225 is 300 tokens, as indicated by the notation [1, 2048 (300) , D] for the input 250. Each of the individual operations of the static computational graph 200B, on the other hand, have a operation-specific context window size of 256. In the example illustrated in FIG. 2B, the left-most operation (s) process the first 256 tokens of the 300-token input 210, while the second-from-left operation (s) process the remaining 44 tokens of the 300-token input 210 (e.g., because 300 –256 = 44) . Because the operation-specific context window sizes of the operations are 256, and the left-most operation (s) fill up the operation-specific context window size fully (processes the first 256 tokens of the 300-token input 210) , the classifier can classify the left-most operation (s) as valid operations 230. Because the operation-specific context window sizes of the operations are 256, and the second-from-left operation (s) do not fill up the operation-specific context window size fully (processes 44 out of 256 tokens) , the classifier can classify the second-from-left operation (s) as semi-valid operations 235. Because the rest of the operations are empty (e.g., zero out of 256 tokens of the operation-specific context window size used) , the classifier can classify the rest of the operations as invalid operations 240, to be skipped.
[0051] In some examples, the machine learning model that is associated with the static computational graph 200A and / or the static computational graph 200B can include, for example, one or more neural network (NNs) (e.g., the neural network 100) , convolutional NN (s) (CNN (s) ) , trained time delay NN (s) (TDNN (s) ) , deep network (s) , autoencoder (s) (AE (s) ) , variational AE (s) (VAE (s) ) , deep belief net (s) (DBN (s) ) , recurrent NN (s) (RNN (s) ) , generative adversarial network (s) (GAN (s) ) , conditional GAN (s) (cGAN (s) ) , support vector machine (s) (SVM (s) ) , state space model (s) (SSM (s) ) , random forest (s) (RF (s) ) , decision tree (s) , NN (s) with fully connected (FC) layer (s) , NN (s) with convolutional layer (s) , NN (s) with convolutional layer (s) , computer vision system (s) , deep learning system (s) , classifier (s) , transformer (s) , clustering algorithm (s) , reinforcement learning model (s) , supervised learning model (s) , unsupervised learning model (s) , gradient boosting model (s) , sequence-to-sequence (Seq2Seq) model (s) , autoregressive (AR) model (s) , large language model (s) (LLMs) , or combinations thereof. Examples of LLMs that can be used can include, for instance, a Generative Pre-Trained Transformer (GPT) (e.g., GPT-2, GPT-3, GPT-3.5, GPT-4, GPT-4o, o1, and / or other GPT variant (s) ) . DaVinci, an LLM using Massachusetts Institute of Technology (MIT) langchain, Text-to-text Transfer Transformer (T5) , Large Language Model Meta AI (LLaMA) , Mistral Mistral 7B, Mistral Mixtral-8x7B, Baichuan Baichuan-7B, Mamba2, Bidirectional Representations from Transformers (BERT) , Retrieval-Enhanced Transformer another LLM, or a combination thereof.
[0052] FIG. 3 is a flow diagram illustrating a process 300 for classification and / or processing of an operation in a static computational graph associated with a machine learning model. The process 300 may be performed by a system.
[0053] At block 305, the system (or at least one subsystem thereof) is configured to, and can, receive an input (e.g., input layer 110, input 210, input 250) to an operation. At block 310, the system (or at least one subsystem thereof) is configured to, and can, set valid dimension (s) (e.g., operation-specific context window size, portion (s) of the input to be processed that fit within the operation-specific context window size) based on the input received in block 305.
[0054] At block 315 and decision 320, the system (or at least one subsystem thereof) is configured to, and can, set a state (or classification) for the operation. As illustrated by the arrows leading from the decision 320, the state (or classification) for the operation can be valid (e.g., as in the valid operations 230) , semi-valid (e.g., as in the semi-valid operations 235) , or invalid (e.g., as in the invalid operations 240) . If the operation is valid, the process 300 goes from decision 320 to block 325. If the operation is invalid, the process 300 goes from decision 320 to block 330. If the operation is semi-valid, the process 300 goes from decision 320 to decision 335.
[0055] At block 325, where the operation is valid (per the decision 320) , the system (or at least one subsystem thereof) is configured to, and can, execute the operation according to an existing operation implementation (also known as a predetermined operation implementation) . At block 350, where the operation is valid (per the decision 320) , the system (or at least one subsystem thereof) is configured to, and can, generate the output of the operation via the execution of the operation according to the existing operation implementation (of block 325) .
[0056] At block 330, where the operation is invalid (per the decision 320) , the system (or at least one subsystem thereof) is configured to, and can, skip the operation. At block 350, where the operation is invalid (per the decision 320) , the system (or at least one subsystem thereof) is configured to, and can, generate the output of the operation (e.g., a blank output) by skipping the operation (at block 330) .
[0057] At decision 335, where the operation is semi-valid (per the decision 320) , the system (or at least one subsystem thereof) is configured to, and can, determine whether the system can re-use an existing operation implementation (also known as a predetermined operation implementation) for the operation. If, at decision 335, the system determines that there is the system can re-use an existing operation implementation for the operation, then decision 335 is followed by block 340. If, at decision 335, the system determines that there is the system cannot re-use an existing operation implementation for the operation, then decision 335 is followed by block 345.
[0058] At block 340, where the system can re-use an existing operation implementation for the operation (per the decision 335) , the system (or at least one subsystem thereof) is configured to, and can, execute the operation while re-using the existing operation implementation. In some examples, the system modifies the existing operation implementation (e.g., by removing or skipping unnecessary loops) to generate a modified operation implementation, and executes the operation with the modified operation implementation. At block 350, where the system can re-use an existing operation implementation for the operation (per the decision 335) , the system (or at least one subsystem thereof) is configured to, and can, generate the output of the operation via the execution of the operation according to the existing operation implementation or modified operation implementation (of block 340) .
[0059] At block 345, where the system cannot re-use an existing operation implementation for the operation (per the decision 335) , the system (or at least one subsystem thereof) is configured to, and can, execute the operation with a new (dynamic) operation implementation. In some examples, the system uses and / or modifies an existing operation implementation (e.g., by removing or skipping unnecessary loops) to generate the new (dynamic) operation implementation. In some examples, the system optimizes the new (dynamic) operation implementation further (e.g., by removing or skipping unnecessary loops) . At block 350, where the system cannot re-use an existing operation implementation for the operation (per the decision 335) , the system (or at least one subsystem thereof) is configured to, and can, generate the output of the operation via the execution of the operation according to the new (dynamic) operation implementation (of block 345) .
[0060] FIG. 4 is a flow diagram illustrating a process 400 for classification and / or processing of operations of a static computational graph associated with a machine learning model. The process 400 may be performed by a system.
[0061] At block 405, the system (or at least one subsystem thereof) is configured to, and can, propagate valid dimensions and / or state information from input (s) (e.g., input layer 110, input 210, input 250, block 305) to output (s) (e.g., output layer 114, output 215, output 255, block 350) .
[0062] At block 410, the system (or at least one subsystem thereof) is configured to, and can, skip invalid operations and execute valid operations (e.g., using an existing operation implementation) .
[0063] At block 415, the system (or at least one subsystem thereof) is configured to, and can, for semi-valid operations, speed up the execution while keeping accuracy (e.g., using an existing operation implementation or a modified variant thereof where possible) , bypass unnecessary computation loops if possible, call the operation with a new dynamic implementation, or a combination thereof.
[0064] FIG. 5 is a block diagram illustrating a process 500 for spilling and / or filling to apply shape propagation. The process may be performed by a system, such as an AI accelerator, an NPU, or another processor or computing system.
[0065] In some examples, some operations have uncertain dynamic behavior with respect to shape, and may need additional limitations to apply shape propagation. For instance, the Reshape operation can benefit from such limitations to apply shape propagation, since Reshape can allow modification of shapes and / or dimensions. Limitations on shape changes can help maintain shape and / or dimensions.
[0066] In some examples, some operations are sensitive to garbage (e.g., padding) , so the system can improve accuracy by providing precise valid dimensions and / or implementation adjustments to maintain and / or improve accuracy. Operations that are sensitive, and benefit from such improvements, include, for instance, Mean, Matmul, Softmax, and Norm. For instance, garbage input into such operations can make the outputs of the calculations performed by these operations inaccurate.
[0067] In some examples, some inplace operations can be removed in runtime via hardware-specific optimizations that allow such operations to be performed by manipulating which portions of memory are viewed or accessed. In some examples, such inplace operations can be made, by the system, to be executable for the purpose (s) of computing shape and state. Examples of such operations include Slicepad or Concat.
[0068] In some examples, the system can adopt certain optimizations, such as the process 500 for spills and fills illustrated in FIG. 5, to rebuild graph connectivity and recover correct shape (s) and / or dimension (s) .
[0069] The process 500 illustrated in FIG. 5 progresses from a computational node A 505 to a computational node B 555. In some examples, the computational node A 505 and the computational node B 555 are each operations (e.g., of the static computational graph 200A or the static computational graph 200B) . The computational node A 505 is associated with a dynamic shape 510. The process 500 include generation of a spilled tensor 515 from the computational node A 505. The spilled tensor 515, during a spill Dyn operation 520, can transfer the spilled tensor 515 from a local memory to a main memory 530 (e.g., double data rate (DDR) memory) . In some examples, the spill Dyn operation 520 can skip invalid data and / or operations. The process 500 can include retrieving the tensor from the main memory 530 as a filled tensor 550, via fill DynA operation 540 and / or fill DynB operation 545. In some examples, the fill DynA operation 540 and / or fill DynB operation 545 can skip invalid data and / or operations. In some examples, spaces in the filled tensor 550 corresponding to the invalid data and / or operations (that were skipped by the spill Dyn operation 520, the fill DynA operation 540, and / or the fill DynB operation 545) can be filled in with dummy data 535 (e.g., null) . In some examples, the spilled tensor 515 can identify valid and / or semi-valid information (data and / or operations) for the spill Dyn operation 520, the fill DynA operation 540, and / or the fill DynB operation 545 via get valid_info functions 525A-525C.
[0070] A dynamic shape 560 associated with the spilled tensor 515 is stored (e.g., in the main memory 530 or another memory) . When the filled tensor 550 is retrieved from the main memory 530, the dynamic shape 560 can be retrieved (e.g., from the main memory 530 or another memory) so that the filled tensor 550 can recover the shape of the spilled tensor 515. In some examples, the dynamic shape 560 matches the dynamic shape 510. Because the dynamic shape 560 is preserved from the spilled tensor 515 to the filled tensor 550, the computational node B 555 is associated with the dynamic shape 510 (like the computational node A 505 is associated with the dynamic shape 510) .
[0071] In some examples, the spilled tensor 515 represents an output of the operation of the computational node A 505 (e.g., the output of block 350 for the operation of the computational node A 505) . In some examples, the filled tensor 550 represents an input of the operation of the computational node B 555 (e.g., the input of block 305 for the operation of the computational node B 555) .
[0072] FIG. 6 is a graph diagram 600 illustrating comparisons of performance of a machine learning model using different operation processing schemes for processing operations in a static computational graph associated with the machine learning model. Performance is measured based on cycle counts 610 from input of an input (e.g., input layer 110, input 210, input 250) to the ML model to generation of an output (e.g., output layer 114, output 215, output 255) by the ML model. The cycle counts 610 increase from zero up to L, M, N, P, and eventually Q along the vertical axis in the graph diagram 600. It should be understood that L, M, N, P, and Q represent non-zero positive sequentially increasing values. The horizontal axis of the graph diagram 600 tracks sequence length 605 (e.g., input size in tokens) of the input to the ML model, increasing from zero to 2048 (e.g., which may be a context window size of the ML model in some examples) .
[0073] Three lines representing performance of the ML model under different schemes are illustrated in the graph diagram 600. A first line represents performance 615 of the ML model that performs all operations without first using a classifier to classify the operations (e.g., into valid operations 230, semi-valid operations 235, and / or invalid operations 240) . The performance 615 of the ML model that performs all operations is flat, with a cycle count of N regardless of sequence length of the input.
[0074] A second line represents performance 620 of the ML model that uses a classifier to classify the operations (e.g., into valid operations 230, semi-valid operations 235, and / or invalid operations 240) before executing a subset of the operations (e.g., the valid operations 230 and / or the semi-valid operations 235) and skipping another subset of the operations (e.g., the invalid operations 240) . The performance 620 of the ML model that classifies the operations, performs certain operations (e.g., the valid operations 230 and / or the semi-valid operations 235) , and skips other operations (e.g., the invalid operations 240) starts at a cycle count of M (for a low sequence length of 256) and increases to a cycle count of P (for a high sequence length of 2048) . Thus, for any sequence length below ~1600, the performance 620 is more efficient than the performance 615.
[0075] A third line represents performance 625 of the ML model that uses the classifier to classify the operations (e.g., into valid operations 230, semi-valid operations 235, and / or invalid operations 240) before executing a subset of the operations (e.g., the valid operations 230 and / or the semi-valid operations 235) and skipping another subset of the operations (e.g., the invalid operations 240) and also performing the spill / fill shape propagation optimization (e.g., illustrated in the process 500 of FIG. 5) . The performance 625 of the ML model starts at a cycle count of L (for a low sequence length of 256) and increases to a cycle count of P (for a high sequence length of 2048) . The performance 625 is generally more efficient than the performance 620 for any any sequence length below ~2048. For sequence lengths at or near 2048, the performance 625 similar to the performance 625. For any sequence length below ~1300, the performance 625 is more efficient than the performance 615.
[0076] FIG. 7 is a flow diagram illustrating a process 700 for ML model operation. The process 700 may be performed by a system. In some examples, the imaging system can include, for example, the neural network 100, an ML model associated with the static computational graph 200A, an ML model associated with the static computational graph 200B, the classifier discussed with respect to FIGs. 2A-2B, the computing system discussed with respect to FIGs. 2A-2B, a system that performs the process 300, an ML model associated with the process 300, a system that performs the process 400, an ML model associated with the process 400, a system that performs the process 500, an ML model associated with the process 500, an ML model having the performance 615, an ML model having the performance 620, an ML model having the performance 625, an ML model associated with the process 700, an ML model running on the computing system 800, the computing system 800, the processor 810, an apparatus, a system, a non-transitory computer-readable medium coupled to a processor, or a combination thereof.
[0077] At block 705, the system (or at least one subsystem thereof) is configured to, and can, identify a difference (e.g., valid operations 230) between an input size (e.g., input size 225) of an input (e.g., input layer 110, input 210, input 250, block 305) and a context window size (e.g., context window size 220) associated with a trained machine learning model (e.g., neural network 100) . The trained machine learning model is associated with a computational graph having a static shape (e.g., static computational graph 200A, static computational graph 200B) . The computational graph including a plurality of operations (e.g., valid operations 230, semi-valid operations 235, invalid operations 240) .
[0078] In some examples, the context window size is fixed, as in the context window size 220 of FIG. 2A. In some examples, the context window size is associated with an AI accelerator, a processor, neural processing unit (NPU) compiler, an AI accelerator compiler, a CPU, a GPU, a compiler, a controller, or a combination thereof.
[0079] In some examples, the input is a string of text (e.g., “Describe an LCD” in the example of FIG. 2A) . In some examples, the input size corresponds to a length of the string of text (e.g., the input size 225) . In some examples, the context window size corresponds to a maximum length for the string of text (e.g., a maximum length of string of text that the trained machine learning model would accept) . In some examples, the input size and / or the context window size are measured in tokens.
[0080] In some examples, the computational graph is a static computational graph (e.g., static computational graph 200A, static computational graph 200B) .
[0081] At block 710, the system (or at least one subsystem thereof) is configured to, and can, Process the input using the trained machine learning model, for instance to generate an output (e.g., output layer 114, output 215, output 255, block 350) . Block 710 can include block 715 and / or block 720. For instance, to process the input using the trained machine learning model (as in block 710) , the system (or at least one subsystem thereof) is configured to, and can, performs the operation (s) of block 715 and / or block 720.
[0082] At block 715, the system (or at least one subsystem thereof) is configured to, and can, execute a first subset of the plurality of operations (e.g., valid operations 230 and / or semi-valid operations 235) . The first subset of the plurality of operations is associated with the input (e.g., with the input size 225) .
[0083] At block 720, the system (or at least one subsystem thereof) is configured to, and can, skip a second subset of the plurality of operations (e.g., invalid operations 240) . The second subset of the plurality of operations is associated with the difference (e.g., difference 228) .
[0084] In some examples, the system (or at least one subsystem thereof) is configured to, and can, classify (e.g., between block 705 and block 710, or as part of block 710) at least a portion of the first subset of the plurality of operations in the computational graph as valid operations (e.g., valid operations 230) based on the first subset being associated with the input (e.g., with the input size 225 rather than the difference 228) .
[0085] In some examples, the system (or at least one subsystem thereof) is configured to, and can, classify (e.g., between block 705 and block 710, or as part of block 710) at least a portion of the first subset of the plurality of operations in the computational graph as semi-valid operations (e.g., semi-valid operations 235) based on the first subset being associated with the input (e.g., with the input size 225 rather than the difference 228) .
[0086] In some examples, the system (or at least one subsystem thereof) is configured to, and can, classify (e.g., between block 705 and block 710, or as part of block 710) the second subset of the plurality of operations in the computational graph as invalid operations based on the second subset being associated with the difference (e.g., with the difference 228 rather than the input size 225) .
[0087] In some examples, the first subset of the plurality of operations includes a valid subset of the plurality of operations (e.g., valid operations 230) and a semi-valid subset of the plurality of operations (e.g., semi-valid operations 235) . In some examples, executing the first subset of the plurality of operations (as in block 715) includes executing the valid subset of the plurality of operations according to a respective predetermined operation implementation for each of the valid subset of the plurality of operations (e.g., as in block 325) , and executing the semi-valid subset of the plurality of operations (e.g., as in block 340 and / or block 345) . In some examples, executing the semi-valid subset of the plurality of operations includes executing a semi-valid operation of the semi-valid subset according to a predetermined operation implementation (e.g., as in block 340) . In some examples, executing the semi-valid subset of the plurality of operations includes skipping one or more loops of a predetermined operation implementation to generate a modified operation implementation; and executing a semi-valid operation of the semi-valid subset according to the modified operation implementation (e.g., as in block 340 with the modifications to skip unnecessary loop (s) ) . In some examples, executing the semi-valid subset of the plurality of operations includes executing a semi-valid operation of the semi-valid subset according to a new operation implementation (e.g., as in block 345) .
[0088] In some examples, the plurality of operations includes at least one of a mean operation, a matrix multiplication operation, a softmax operation, or a norm operation. In some examples, the plurality of operations includes at least one of any of the following operations: abs, acos, acosh, add, and, argmax, argmin, asin, asinh, atan, atanh, averagepool, batchnormalization, bitshift, bitwiseand, bitwisenot, bitwiseor, bitwisexor, cast, ceil, col2im, compress, concat, concatfromsequence, constant, constantofshape, conv, convinteger, convtranspose, cos, cosh, cumsum, dft, deformconv, depthtospace, dequantizelinear, det, div, dropout, einsum, equal, erf, exp, expand, eyelike, flatten, floor, gru, gather, gatherelements, gathernd, gemm, globalaveragepool, globallppool, globalmaxpool, greater, gridsample, hardmax, identity, if, imagedecoder, instancenormalization, isinf, isnan, lrn, lstm, less, log, loop, lpnormalization, lppool, matmul, matmulinteger, max, maxpool, maxroipool, maxunpool, mean, melweightmatrix, min, mod, mul, multinomial, neg, nonmaxsuppression, nonzero, norm, not, onehot, optional, optionalgetelement, optionalhaselement, or, pad, pow, qlinearconv, qlinearmatmul, quantizelinear, rnn, randomnormal, randomnormallike, randomuniform, randomuniformlike, reciprocal, reducemax, reducemean, reducemin, reduceprod, reducesum, regexfullmatch, reshape, resize, reversesequence, roialign, round, stft, scan, scatter (deprecated) , scatterelements, scatternd, sequenceat, sequenceconstruct, sequenceempty, sequenceerase, sequenceinsert, sequencelength, shape, sigmoid, sign, sin, sinh, size, slice, spacetodepth, split, splittosequence, sqrt, squeeze, stringconcat, stringnormalizer, stringsplit, sub, sum, tan, tanh, tfidfvectorizer, tile, topk, transpose, trilu, unique, unsqueeze, upsample (deprecated) , where, xor, function, affinegrid, bernoulli, blackmanwindow, castlike, celu, centercroppad, clip, dynamicquantizelinear, elu, gelu, greaterorequal, groupnormalization, hammingwindow, hannwindow, hardsigmoid, hardswish, layernormalization, leakyrelu, lessorequal, logsoftmax, meanvariancenormalization, mish, negativeloglikelihoodloss, prelu, range, reducel1, reducel2, reducelogsum, reducelogsumexp, reducesumsquare, relu, selu, sequencemap, shrink, slidepad, softmax, softmaxcrossentropyloss, softplus, softsign, thresholdedrelu, sigmoid functions, or a combination thereof.
[0089] In some examples, the system (or at least one subsystem thereof) is configured to, and can, propagate at least one dimension from the input to an output of the trained machine learning model (e.g., as in block 405) .
[0090] In some examples, the system (or at least one subsystem thereof) is configured to, and can, propagate state information from the input to an output of the trained machine learning model (e.g., as in block 405) . The state information is associated with at least one of a valid operation state (e.g., valid operations 230) , a semi-valid operation state (e.g., semi-valid operations 235) , or an invalid operation state (e.g., invalid operations 240) .
[0091] In some examples, executing the first subset of the plurality of operations (as in block 715) includes storing a shape of a tensor in at least one memory, processing the tensor to generate a processed tensor, recovering the shape from the at least one memory, and applying the shape to the processed tensor.
[0092] The computing device can include any suitable device, such as a mobile device (e.g., a mobile phone) , a desktop computing device, a tablet computing device, a wearable device (e.g., a VR headset, an AR headset, AR glasses, a network-connected watch or smartwatch, or other wearable device) , a server computer, an autonomous vehicle or computing device of an autonomous vehicle, a robotic device, a television, and / or any other computing device with the resource capabilities to perform the processes described herein. In some cases, the computing device or apparatus may include various components, such as one or more input devices, one or more output devices, one or more processors, one or more microprocessors, one or more microcomputers, one or more cameras, one or more sensors, and / or other component (s) that are configured to carry out the steps of processes described herein. In some examples, the computing device may include a display, a network interface configured to communicate and / or receive the data, any combination thereof, and / or other component (s) . The network interface may be configured to communicate and / or receive Internet Protocol (IP) based data or other type of data.
[0093] The components of the computing device can be implemented in circuitry. For example, the components can include and / or can be implemented using electronic circuits or other electronic hardware, which can include one or more programmable electronic circuits (e.g., microprocessors, graphics processing units (GPUs) , digital signal processors (DSPs) , central processing units (CPUs) , and / or other suitable electronic circuits) , and / or can include and / or be implemented using computer software, firmware, or any combination thereof, to perform the various operations described herein.
[0094] The processes described herein are illustrated as logical flow diagrams, block diagrams, or conceptual diagrams, the operation of which represents a sequence of operations that can be implemented in hardware, computer instructions, or a combination thereof. In the context of computer instructions, the operations represent computer-executable instructions stored on one or more computer-readable storage media that, when executed by one or more processors, perform the recited operations. Generally, computer-executable instructions include routines, programs, objects, components, data structures, and the like that perform particular functions or implement particular data types. The order in which the operations are described is not intended to be construed as a limitation, and any number of the described operations can be combined in any order and / or in parallel to implement the processes.
[0095] Additionally, the processes described herein may be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors, by hardware, or combinations thereof. As noted above, the code may be stored on a computer-readable or machine-readable storage medium, for example, in the form of a computer program comprising a plurality of instructions executable by one or more processors. The computer-readable or machine-readable storage medium may be non-transitory.
[0096] FIG. 8 is a diagram illustrating an example of a system for implementing certain aspects of the present technology. In particular, FIG. 8 illustrates an example of computing system 800, which can be for example any computing device making up internal computing system, a remote computing system, a camera, or any component thereof in which the components of the system are in communication with each other using connection 805. Connection 805 can be a physical connection using a bus, or a direct connection into processor 810, such as in a chipset architecture. Connection 805 can also be a virtual connection, networked connection, or logical connection.
[0097] In some aspects, computing system 800 is a distributed system in which the functions described in this disclosure can be distributed within a datacenter, multiple data centers, a peer network, etc. In some aspects, one or more of the described system components represents many such components each performing some or all of the function for which the component is described. In some aspects, the components can be physical or virtual devices.
[0098] Example system 800 includes at least one processing unit (CPU or processor) 810 and connection 805 that couples various system components including system memory 815, such as read-only memory (ROM) 820 and random access memory (RAM) 825 to processor 810. Computing system 800 can include a cache 812 of high-speed memory connected directly with, in close proximity to, or integrated as part of processor 810.
[0099] Processor 810 can include any general purpose processor and a hardware service or software service, such as services 832, 834, and 836 stored in storage device 830, configured to control processor 810 as well as a special-purpose processor where software instructions are incorporated into the actual processor design. Processor 810 may essentially be a completely self-contained computing system, containing multiple cores or processors, a bus, memory controller, cache, etc. A multi-core processor may be symmetric or asymmetric.
[0100] To enable user interaction, computing system 800 includes an input device 845, which can represent any number of input mechanisms, such as a microphone for speech, a touch-sensitive screen for gesture or graphical input, keyboard, mouse, motion input, speech, etc. Computing system 800 can also include output device 835, which can be one or more of a number of output mechanisms. In some instances, multimodal systems can enable a user to provide multiple types of input / output to communicate with computing system 800. Computing system 800 can include communications interface 840, which can generally govern and manage the user input and system output. The communication interface may perform or facilitate receipt and / or transmission wired or wireless communications using wired and / or wireless transceivers, including those making use of an audio jack / plug, a microphone jack / plug, a universal serial bus (USB) port / plug, an port / plug, an Ethernet port / plug, a fiber optic port / plug, a proprietary wired port / plug, a wireless signal transfer, a low energy (BLE) wireless signal transfer, an wireless signal transfer, a radio-frequency identification (RFID) wireless signal transfer, near-field communications (NFC) wireless signal transfer, dedicated short range communication (DSRC) wireless signal transfer, 802.11 Wi-Fi wireless signal transfer, wireless local area network (WLAN) signal transfer, Visible Light Communication (VLC) , Worldwide Interoperability for Microwave Access (WiMAX) , Infrared (IR) communication wireless signal transfer, Public Switched Telephone Network (PSTN) signal transfer, Integrated Services Digital Network (ISDN) signal transfer, 3G / 4G / 5G / LTE cellular data network wireless signal transfer, ad-hoc network signal transfer, radio wave signal transfer, microwave signal transfer, infrared signal transfer, visible light signal transfer, ultraviolet light signal transfer, wireless signal transfer along the electromagnetic spectrum, or some combination thereof. The communications interface 840 may also include one or more Global Navigation Satellite System (GNSS) receivers or transceivers that are used to determine a location of the computing system 800 based on receipt of one or more signals from one or more satellites associated with one or more GNSS systems. GNSS systems include, but are not limited to, the US-based Global Positioning System (GPS) , the Russia-based Global Navigation Satellite System (GLONASS) , the China-based BeiDou Navigation Satellite System (BDS) , and the Europe-based Galileo GNSS. There is no restriction on operating on any particular hardware arrangement, and therefore the basic features here may easily be substituted for improved hardware or firmware arrangements as they are developed.
[0101] Storage device 830 can be a non-volatile and / or non-transitory and / or computer-readable memory device and can be a hard disk or other types of computer readable media which can store data that are accessible by a computer, such as magnetic cassettes, flash memory cards, solid state memory devices, digital versatile disks, cartridges, a floppy disk, a flexible disk, a hard disk, magnetic tape, a magnetic strip / stripe, any other magnetic storage medium, flash memory, memristor memory, any other solid-state memory, a compact disc read only memory (CD-ROM) optical disc, a rewritable compact disc (CD) optical disc, digital video disk (DVD) optical disc, a blu-ray disc (BDD) optical disc, a holographic optical disk, another optical medium, a secure digital (SD) card, a micro secure digital (microSD) card, a Memory card, a smartcard chip, a EMV chip, a subscriber identity module (SIM) card, a mini / micro / nano / pico SIM card, another integrated circuit (IC) chip / card, random access memory (RAM) , static RAM (SRAM) , dynamic RAM (DRAM) , read-only memory (ROM) , programmable read-only memory (PROM) , erasable programmable read-only memory (EPROM) , electrically erasable programmable read-only memory (EEPROM) , flash EPROM (FLASHEPROM) , cache memory (L1 / L2 / L3 / L4 / L5 / L#) , resistive random-access memory (RRAM / ReRAM) , phase change memory (PCM) , spin transfer torque RAM (STT-RAM) , another memory chip or cartridge, and / or a combination thereof.
[0102] The storage device 830 can include software services, servers, services, etc., that when the code that defines such software is executed by the processor 810, it causes the system to perform a function. In some aspects, a hardware service that performs a particular function can include the software component stored in a computer-readable medium in connection with the necessary hardware components, such as processor 810, connection 805, output device 835, etc., to carry out the function.
[0103] As used herein, the term “computer-readable medium” includes, but is not limited to, portable or non-portable storage devices, optical storage devices, and various other mediums capable of storing, containing, or carrying instruction (s) and / or data. A computer-readable medium may include a non-transitory medium in which data can be stored and that does not include carrier waves and / or transitory electronic signals propagating wirelessly or over wired connections. Examples of a non-transitory medium may include, but are not limited to, a magnetic disk or tape, optical storage media such as compact disk (CD) or digital versatile disk (DVD) , flash memory, memory or memory devices. A computer-readable medium may have stored thereon code and / or machine-executable instructions that may represent a procedure, a function, a subprogram, a program, a routine, a subroutine, a module, a software package, a class, or any combination of instructions, data structures, or program statements. A code segment may be coupled to another code segment or a hardware circuit by passing and / or receiving information, data, arguments, parameters, or memory contents. Information, arguments, parameters, data, etc. may be passed, forwarded, or transmitted using any suitable means including memory sharing, message passing, token passing, network transmission, or the like.
[0104] In some aspects, the computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bit stream and the like. However, when mentioned, non-transitory computer-readable storage media expressly exclude media such as energy, carrier signals, electromagnetic waves, and signals per se.
[0105] Specific details are provided in the description above to provide a thorough understanding of the aspects and examples provided herein. However, it will be understood by one of ordinary skill in the art that the aspects may be practiced without these specific details. For clarity of explanation, in some instances the present technology may be presented as including individual functional blocks including functional blocks comprising devices, device components, steps or routines in a method embodied in software, or combinations of hardware and software. Additional components may be used other than those shown in the figures and / or described herein. For example, circuits, systems, networks, processes, and other components may be shown as components in block diagram form in order not to obscure the aspects in unnecessary detail. In other instances, well-known circuits, processes, algorithms, structures, and techniques may be shown without unnecessary detail in order to avoid obscuring the aspects.
[0106] Individual aspects may be described above as a process or method which is depicted as a flowchart, a flow diagram, a data flow diagram, a structure diagram, or a block diagram. Although a flowchart may describe the operations as a sequential process, many of the operations can be performed in parallel or concurrently. In addition, the order of the operations may be re-arranged. A process is terminated when its operations are completed, but could have additional steps not included in a figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc. When a process corresponds to a function, its termination can correspond to a return of the function to the calling function or the main function.
[0107] Processes and methods according to the above-described examples can be implemented using computer-executable instructions that are stored or otherwise available from computer-readable media. Such instructions can include, for example, instructions and data which cause or otherwise configure a general purpose computer, special purpose computer, or a processing device to perform a certain function or group of functions. Portions of computer resources used can be accessible over a network. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, firmware, source code, etc. Examples of computer-readable media that may be used to store instructions, information used, and / or information created during methods according to described examples include magnetic or optical disks, flash memory, USB devices provided with non-volatile memory, networked storage devices, and so on.
[0108] Devices implementing processes and methods according to these disclosures can include hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof, and can take any of a variety of form factors. When implemented in software, firmware, middleware, or microcode, the program code or code segments to perform the necessary tasks (e.g., a computer-program product) may be stored in a computer-readable or machine-readable medium. A processor (s) may perform the necessary tasks. Typical examples of form factors include laptops, smart phones, mobile phones, tablet devices or other small form factor personal computers, personal digital assistants, rackmount devices, standalone devices, and so on. Functionality described herein also can be embodied in peripherals or add-in cards. Such functionality can also be implemented on a circuit board among different chips or different processes executing in a single device, by way of further example.
[0109] The instructions, media for conveying such instructions, computing resources for executing them, and other structures for supporting such computing resources are example means for providing the functions described in the disclosure.
[0110] In the foregoing description, aspects of the application are described with reference to specific aspects thereof, but those skilled in the art will recognize that the application is not limited thereto. Thus, while illustrative aspects of the application have been described in detail herein, it is to be understood that the inventive concepts may be otherwise variously embodied and employed, and that the appended claims are intended to be construed to include such variations, except as limited by the prior art. Various features and aspects of the above-described application may be used individually or jointly. Further, aspects can be utilized in any number of environments and applications beyond those described herein without departing from the broader spirit and scope of the specification. The specification and drawings are, accordingly, to be regarded as illustrative rather than restrictive. For the purposes of illustration, methods were described in a particular order. It should be appreciated that in alternate aspects, the methods may be performed in a different order than that described.
[0111] One of ordinary skill will appreciate that the less than ( “<” ) and greater than ( “>” ) symbols or terminology used herein can be replaced with less than or equal to ( “≤” ) and greater than or equal to ( “≥” ) symbols, respectively, without departing from the scope of this description.
[0112] Where components are described as being “configured to” perform certain operations, such configuration can be accomplished, for example, by designing electronic circuits or other hardware to perform the operation, by programming programmable electronic circuits (e.g., microprocessors, or other suitable electronic circuits) to perform the operation, or any combination thereof.
[0113] The phrase “coupled to” refers to any component that is physically connected to another component either directly or indirectly, and / or any component that is in communication with another component (e.g., connected to the other component over a wired or wireless connection, and / or other suitable communication interface) either directly or indirectly.
[0114] Claim language or other language reciting “at least one of” a set and / or “one or more” of a set indicates that one member of the set or multiple members of the set (in any combination) satisfy the claim. For example, claim language reciting “at least one of A and B” means A, B, or A and B. In another example, claim language reciting “at least one of A, B, and C” means A, B, C, or A and B, or A and C, or B and C, or A and B and C. The language “at least one of” a set and / or “one or more” of a set does not limit the set to the items listed in the set. For example, claim language reciting “at least one of A and B” can mean A, B, or A and B, and can additionally include items not listed in the set of A and B.
[0115] The various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the aspects disclosed herein may be implemented as electronic hardware, computer software, firmware, or combinations thereof. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
[0116] The techniques described herein may also be implemented in electronic hardware, computer software, firmware, or any combination thereof. Such techniques may be implemented in any of a variety of devices such as general purposes computers, wireless communication device handsets, or integrated circuit devices having multiple uses including application in wireless communication device handsets and other devices. Any features described as modules or components may be implemented together in an integrated logic device or separately as discrete but interoperable logic devices. If implemented in software, the techniques may be realized at least in part by a computer-readable data storage medium comprising program code including instructions that, when executed, performs one or more of the methods described above. The computer-readable data storage medium may form part of a computer program product, which may include packaging materials. The computer-readable medium may comprise memory or data storage media, such as random access memory (RAM) such as synchronous dynamic random access memory (SDRAM) , read-only memory (ROM) , non-volatile random access memory (NVRAM) , electrically erasable programmable read-only memory (EEPROM) , FLASH memory, magnetic or optical data storage media, and the like. The techniques additionally, or alternatively, may be realized at least in part by a computer-readable communication medium that carries or communicates program code in the form of instructions or data structures and that can be accessed, read, and / or executed by a computer, such as propagated signals or waves.
[0117] The program code may be executed by a processor, which may include one or more processors, such as one or more digital signal processors (DSPs) , general purpose microprocessors, an application specific integrated circuits (ASICs) , field programmable logic arrays (FPGAs) , or other equivalent integrated or discrete logic circuitry. Such a processor may be configured to perform any of the techniques described in this disclosure. A general purpose processor may be a microprocessor; but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. Accordingly, the term “processor, ” as used herein may refer to any of the foregoing structure, any combination of the foregoing structure, or any other structure or apparatus suitable for implementation of the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated software modules or hardware modules configured for encoding and decoding, or incorporated in a combined video encoder-decoder (CODEC) .
[0118] Illustrative aspects of the disclosure include:
[0119] Aspect 1. An apparatus for machine learning model operation, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to:identify a difference between an input size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; and execute a first subset of the plurality of operations and skip a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.
[0120] Aspect 2. The apparatus of Aspect 1, wherein the context window size is fixed.
[0121] Aspect 3. The apparatus of any of Aspects 1 or 2, wherein the input is a string of text, wherein the input size corresponds to a length of the string of text, and wherein the context window size corresponds to a maximum length for the string of text.
[0122] Aspect 4. The apparatus of any of Aspects 1 to 3, wherein the computational graph is a static computational graph.
[0123] Aspect 5. The apparatus of any of Aspects 1 to 4, wherein the at least one processor is configured to: classify at least a portion of the first subset of the plurality of operations in the computational graph as valid operations based on the first subset being associated with the input.
[0124] Aspect 6. The apparatus of any of Aspects 1 to 5, wherein the at least one processor is configured to: classify at least a portion of the first subset of the plurality of operations in the computational graph as semi-valid operations based on the first subset being associated with the input.
[0125] Aspect 7. The apparatus of any of Aspects 1 to 6, wherein the at least one processor is configured to: classify the second subset of the plurality of operations in the computational graph as invalid operations based on the second subset being associated with the difference.
[0126] Aspect 8. The apparatus of any of Aspects 1 to 7, wherein the first subset of the plurality of operations includes a valid subset of the plurality of operations and a semi-valid subset of the plurality of operations, and wherein, to execute the first subset of the plurality of operations, the at least one processor is configured to: execute the valid subset of the plurality of operations according to a respective predetermined operation implementation for each of the valid subset of the plurality of operations; and execute the semi-valid subset of the plurality of operations.
[0127] Aspect 9. The apparatus of Aspect 8, wherein, to execute the semi-valid subset of the plurality of operations, the at least one processor is configured to: execute a semi-valid operation of the semi-valid subset according to a predetermined operation implementation.
[0128] Aspect 10. The apparatus of any of Aspects 8 or 9, wherein, to execute the semi-valid subset of the plurality of operations, the at least one processor is configured to: skip one or more loops of a predetermined operation implementation to generate a modified operation implementation; and execute a semi-valid operation of the semi-valid subset according to the modified operation implementation.
[0129] Aspect 11. The apparatus of any of Aspects 8 to 10, wherein, to execute the semi-valid subset of the plurality of operations, the at least one processor is configured to: execute a semi-valid operation of the semi-valid subset according to a new operation implementation.
[0130] Aspect 12. The apparatus of any of Aspects 1 to 11, wherein the plurality of operations includes at least one of a mean operation, a matrix multiplication operation, a softmax operation, or a norm operation.
[0131] Aspect 13. The apparatus of any of Aspects 1 to 12, wherein the context window size is associated with a neural processing unit (NPU) compiler.
[0132] Aspect 14. The apparatus of any of Aspects 1 to 13, wherein the at least one processor is configured to: propagate at least one dimension from the input to an output of the trained machine learning model.
[0133] Aspect 15. The apparatus of any of Aspects 1 to 14, wherein the at least one processor is configured to: propagate state information from the input to an output of the trained machine learning model, wherein the state information is associated with at least one of a valid operation state, a semi-valid operation state, or an invalid operation state.
[0134] Aspect 16. The apparatus of any of Aspects 1 to 15, wherein, to execute the first subset of the plurality of operations, the at least one processor is configured to: store a shape of a tensor in the at least one memory; process the tensor to generate a processed tensor; recover the shape from the at least one memory; and apply the shape to the processed tensor.
[0135] Aspect 17. The apparatus of any of Aspects 1 to 16, wherein the input size and the context window size are measured in tokens.
[0136] Aspect 18. A method for machine learning model operation, the method comprising: identifying a difference between a input size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; and executing a first subset of the plurality of operations and skipping a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.
[0137] Aspect 19. The method of Aspect 18, wherein the context window size is fixed.
[0138] Aspect 20. The method of any of Aspects 18 or 19, wherein the input is a string of text, wherein the input size corresponds to a length of the string of text, and wherein the context window size corresponds to a maximum length for the string of text.
[0139] Aspect 21. The method of any of Aspects 18 to 20, wherein the computational graph is a static computational graph.
[0140] Aspect 22. The method of any of Aspects 18 to 21, further comprising: classifying at least a portion of the first subset of the plurality of operations in the computational graph as valid operations based on the first subset being associated with the input.
[0141] Aspect 23. The method of any of Aspects 18 to 22, further comprising: classifying at least a portion of the first subset of the plurality of operations in the computational graph as semi-valid operations based on the first subset being associated with the input.
[0142] Aspect 24. The method of any of Aspects 18 to 23, further comprising: classifying the second subset of the plurality of operations in the computational graph as invalid operations based on the second subset being associated with the difference.
[0143] Aspect 25. The method of any of Aspects 18 to 24, wherein the first subset of the plurality of operations includes a valid subset of the plurality of operations and a semi-valid subset of the plurality of operations, and wherein executing the first subset of the plurality of operations includes: executing the valid subset of the plurality of operations according to a respective predetermined operation implementation for each of the valid subset of the plurality of operations; and executing the semi-valid subset of the plurality of operations.
[0144] Aspect 26. The method of Aspect 25, wherein executing the semi-valid subset of the plurality of operations includes: executing a semi-valid operation of the semi-valid subset according to a predetermined operation implementation.
[0145] Aspect 27. The method of any of Aspects 25 or 26, wherein executing the semi-valid subset of the plurality of operations includes: skipping one or more loops of a predetermined operation implementation to generate a modified operation implementation; and executing a semi-valid operation of the semi-valid subset according to the modified operation implementation.
[0146] Aspect 28. The method of any of Aspects 25 to 27, wherein executing the semi-valid subset of the plurality of operations includes: executing a semi-valid operation of the semi-valid subset according to a new operation implementation.
[0147] Aspect 29. The method of any of Aspects 18 to 28, wherein the plurality of operations includes at least one of a mean operation, a matrix multiplication operation, a softmax operation, or a norm operation.
[0148] Aspect 30. The method of any of Aspects 18 to 29, wherein the context window size is associated with a neural processing unit (NPU) compiler.
[0149] Aspect 31. The method of any of Aspects 18 to 30, further comprising: propagating at least one dimension from the input to an output of the trained machine learning model.
[0150] Aspect 32. The method of any of Aspects 18 to 31, further comprising: propagating state information from the input to an output of the trained machine learning model, wherein the state information is associated with at least one of a valid operation state, a semi-valid operation state, or an invalid operation state.
[0151] Aspect 33. The method of any of Aspects 18 to 32, wherein executing the first subset of the plurality of operations includes: storing a shape of a tensor in at least one memory; processing the tensor to generate a processed tensor; recovering the shape from the at least one memory; and applying the shape to the processed tensor.
[0152] Aspect 34. The method of any of Aspects 18 to 33, wherein the input size and the context window size are measured in tokens.
[0153] Aspect 35. A non-transitory computer-readable medium having stored thereon instructions that, when executed by one or more processors, cause the one or more processors to perform operations according to any of Aspects 1 to 34.
[0154] Aspect 36. An apparatus, the apparatus comprising one or more means for performing operations according to any of Aspects 1 to 34.
Claims
1.An apparatus for machine learning model operation, the apparatus comprising:at least one memory; andat least one processor coupled to the at least one memory and configured to:identify a difference between an input size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; andexecute a first subset of the plurality of operations and skip a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.2.The apparatus of claim 1, wherein the context window size is fixed.3.The apparatus of claim 1, wherein the input is a string of text, wherein the input size corresponds to a length of the string of text, and wherein the context window size corresponds to a maximum length for the string of text.4.The apparatus of claim 1, wherein the computational graph is a static computational graph.5.The apparatus of claim 1, wherein the at least one processor is configured to:classify at least a portion of the first subset of the plurality of operations in the computational graph as valid operations based on the first subset being associated with the input.6.The apparatus of claim 1, wherein the at least one processor is configured to:classify at least a portion of the first subset of the plurality of operations in the computational graph as semi-valid operations based on the first subset being associated with the input.7.The apparatus of claim 1, wherein the at least one processor is configured to:classify the second subset of the plurality of operations in the computational graph as invalid operations based on the second subset being associated with the difference.8.The apparatus of claim 1, wherein the first subset of the plurality of operations includes a valid subset of the plurality of operations and a semi-valid subset of the plurality of operations, and wherein, to execute the first subset of the plurality of operations, the at least one processor is configured to:execute the valid subset of the plurality of operations according to a respective predetermined operation implementation for each of the valid subset of the plurality of operations; andexecute the semi-valid subset of the plurality of operations.9.The apparatus of claim 8, wherein, to execute the semi-valid subset of the plurality of operations, the at least one processor is configured to:execute a semi-valid operation of the semi-valid subset according to a predetermined operation implementation.10.The apparatus of claim 8, wherein, to execute the semi-valid subset of the plurality of operations, the at least one processor is configured to:skip one or more loops of a predetermined operation implementation to generate a modified operation implementation; andexecute a semi-valid operation of the semi-valid subset according to the modified operation implementation.11.The apparatus of claim 8, wherein, to execute the semi-valid subset of the plurality of operations, the at least one processor is configured to:execute a semi-valid operation of the semi-valid subset according to a new operation implementation.12.The apparatus of claim 1, wherein the plurality of operations includes at least one of a mean operation, a matrix multiplication operation, a softmax operation, or a norm operation.13.The apparatus of claim 1, wherein the context window size is associated with a neural processing unit (NPU) compiler.14.The apparatus of claim 1, wherein the at least one processor is configured to:propagate at least one dimension from the input to an output of the trained machine learning model.15.The apparatus of claim 1, wherein the at least one processor is configured to:propagate state information from the input to an output of the trained machine learning model, wherein the state information is associated with at least one of a valid operation state, a semi-valid operation state, or an invalid operation state.16.The apparatus of claim 1, wherein, to execute the first subset of the plurality of operations, the at least one processor is configured to:store a shape of a tensor in the at least one memory;process the tensor to generate a processed tensor;recover the shape from the at least one memory; andapply the shape to the processed tensor.17.The apparatus of claim 1, wherein the input size and the context window size are measured in tokens.18.A method for machine learning model operation, the method comprising:identifying a difference between a input size of an input and a context window size associated with a trained machine learning model, wherein the trained machine learning model is associated with a computational graph having a static shape, the computational graph including a plurality of operations; andexecuting a first subset of the plurality of operations and skipping a second subset of the plurality of operations to process the input using the trained machine learning model, wherein the first subset of the plurality of operations is associated with the input, and wherein the second subset of the plurality of operations is associated with the difference.19.The method of claim 18, wherein the context window size is fixed.20.The method of claim 18, wherein the input is a string of text, wherein the input size corresponds to a length of the string of text, and wherein the context window size corresponds to a maximum length for the string of text.
Citation Information
Patent Citations
Multi-head attention mechanism-based enhancer-promoter interaction prediction model construction method
CN116312748A
Medical text classification method of homogeneity and heterogeneity combined ensemble learning model
CN118113874A
Constructing and processing computational graphs for dynamically structured machine learning models
US20180129967A1
Pretraining of split layer portions for multilingual model
US20240193377A1