Mixed-precision quantization of machine learning model parameters
Patent Information
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- QUALCOMM INC
- Filing Date
- 2023-08-03
- Publication Date
- 2026-06-10
AI Technical Summary
Machine learning models, especially deep learning models, require a large number of parameters, leading to significant memory and computing resource usage, which is problematic in resource-constrained scenarios. Conventional parameter quantization techniques introduce errors and either prune outlier values or use higher-bit quantization to accommodate them, resulting in inefficiencies.
The method involves accessing a parameter tensor for a machine learning model, identifying rows with outlier values, decomposing the tensor into sub-tensors, and applying mixed-precision quantization using different schemes for outlier and non-outlier values. This approach minimizes memory usage while maintaining model accuracy.
This solution reduces the memory footprint and computational resources required for machine learning models, enabling efficient deployment on resource-constrained devices while minimizing the introduction of quantization errors.
Smart Images

Figure CN2023110928_06022025_PF_FP_ABST
Abstract
Description
MIXED-PRECISION QUANTIZATION OF MACHINE LEARNING MODEL PARAMETERS
[0001] INTRODUCTION
[0002] Aspects of the present disclosure relate to machine learning.
[0003] A wide variety of machine learning model architectures have proliferated and have been used to provide solutions for a multitude of prediction problems. Though the specific architectures may vary, machine learning models generally rely on a set of model parameters having values that are learned or trained based on training data (which may include labeled data and / or unlabeled data) . In many architectures (e.g., deep learning models) , a large number of such parameters (well into the billions in some cases) are used to provide better utility. Additionally, in many cases, bigger models (e.g., models having more parameters) tend to perform better (e.g., with higher prediction accuracy) and / or tend to be better suited for more complex prediction tasks. However, even comparatively small models generally have a relatively large number of parameters and have a substantial memory footprint.
[0004] Such a large number of parameters inherently incurs a significant memory and / or storage footprint, as well as a similarly vast use of other computing resources. Model size has become particularly problematic in resource-constrained scenarios, where it is desired to deploy a trained model on a device having relatively limited resources (e.g., mobile devices, embedded devices, smart vehicles, and the like) . Some conventional approaches to ameliorate such concerns involve parameter quantization. However, parameter quantization is an approximation-based process, which inherently introduces error into the model.
[0005] BRIEF SUMMARY
[0006] Certain aspects provide a method, comprising: accessing a parameter tensor for a machine learning model; identifying a set of rows, in the parameter tensor, that each include one or more outlier values; decomposing the parameter tensor into a first parameter sub-tensor corresponding to the set of rows and a second parameter sub-tensor corresponding to at least one remaining row in the parameter tensor; quantizing the first parameter sub-tensor according to a first quantization scheme; quantizing the second parameter sub-tensor according to a second quantization scheme; and generating a quantized version of the machine learning model comprising the quantized first and second parameter sub-tensors.
[0007] Certain aspects provide a method, comprising: accessing an input tensor for a layer of a machine learning model; decomposing the input tensor into a first input sub-tensor corresponding to a set of outlier indices and a second input sub-tensor corresponding to at least one remaining element in the input tensor; generating a first output sub-tensor based on multiplying the first input sub-tensor with a first parameter sub-tensor; generating a second output sub-tensor based on multiplying the second input sub-tensor with a second parameter sub-tensor; and generating an output tensor for the layer of the machine learning model based on the first and second output sub-tensors.
[0008] Other aspects provide processing systems configured to perform the aforementioned methods as well as those described herein; non-transitory, computer-readable media comprising instructions that, when executed by one or more processors of a processing system, cause the processing system to perform the aforementioned methods as well as those described herein; a computer program product embodied on a computer-readable storage medium comprising code for performing the aforementioned methods as well as those further described herein; and a processing system comprising means for performing the aforementioned methods as well as those further described herein.
[0009] The following description and the related drawings set forth in detail certain illustrative features of one or more aspects.BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The appended figures depict certain features of one or more aspects of the present disclosure and are therefore not to be considered limiting of the scope of this disclosure.
[0011] FIG. 1 illustrates an example workflow for machine learning model parameter quantization according to various aspects of the present disclosure.
[0012] FIG. 2 illustrates an example workflow for generating inferences using quantized machine learning model parameters according to various aspects of the present disclosure.
[0013] FIG. 3 is a flow diagram depicting an example method for generating quantized machine learning models according to various aspects of the present disclosure.
[0014] FIG. 4 is a flow diagram depicting an example method for generating output tensors based on quantized machine learning model parameters according to various aspects of the present disclosure.
[0015] FIG. 5 is a flow diagram depicting an example method for parameter quantization according to various aspects of the present disclosure.
[0016] FIG. 6 is a flow diagram depicting an example method for generating an output tensor according to various aspects of the present disclosure.
[0017] FIG. 7 depicts an example processing system configured to perform various aspects of the present disclosure.
[0018] FIG. 8 depicts an example processing system configured to perform various aspects of the present disclosure.
[0019] To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the drawings. It is contemplated that elements and features of one aspect may be beneficially incorporated in other aspects without further recitation.DETAILED DESCRIPTION
[0020] Aspects of the present disclosure provide apparatuses, methods, processing systems, and computer-readable mediums for machine learning model parameter quantization.
[0021] Quantization of machine learning model parameters is a lossy compression technique that generally involves mapping high-precision parameters (e.g., weights encoded in a floating-point representation) to a relatively smaller set of values that can be represented using fewer bits. For example, sixteen-bit weights (e.g., weights encoded or stored using sixteen bits per weight) may be quantized to four-bit or eight-bit representations (e.g., quantized weights encoded or stored using four or eight bits per weight, respectively) , substantially reducing the memory footprint of the model. One approach to quantization involves using a scale factor and a zero-point (also referred to in some embodiments as the bias and / or offset) to map original values to a value that can be accurately stored in a desired bitwidth (smaller than the original bitwidth) .
[0022] In some aspects, the bitwidth is selected as a hyperparameter of the quantization process. In some aspects, the bitwidth is selected or determined based on the values of the parameters being quantized (e.g., where values with larger standard deviations are assigned higher quantization bitwidths) . In some aspects, some quantization parameters (e.g., zero-point and scale factor) may similarly be determined or learned based on the original values of the parameters. For example, based on the mean and standard deviation of the original parameters, the various quantization parameters may be selected to map the original values to a set of quantized values having a mean and standard deviation that fits within a desired quantized bitwidth. However, as quantization is inherently an approximation-based approach, errors are naturally introduced by these approaches.
[0023] Further, when the parameters include extreme values (e.g., outlier values) , the model accuracy may be substantially reduced by quantization. For example, some conventional approaches involve pruning or removing such outlier parameters prior to quantization. This may enable small bitwidth quantization but introduces additional error through the loss of these parameter values. Some conventional approaches involve retaining the outlier values when quantizing. However, this may introduce substantial quantization loss, as the quantization parameters are selected to encompass these outliers. To mitigate such unacceptable quantization losses, some conventional approaches instead rely on higher-bit quantization, which increases memory footprint of the model.
[0024] Aspects of the present disclosure provide mixed-precision quantization that enables efficient parameter quantization using multiple quantization schemes to minimize (or at least decrease) memory usage while also accommodating outlier parameter values. In some aspects, outlier values may be quantized using a first quantization scheme selected to accurately quantize such outliers, while non-outlier values may be quantized using a second quantization scheme selected to reduce the quantized parameter size to a minimum (or at least reduced) amount. For example, in some aspects, parameters corresponding to outlier values may be quantized to a first quantized bitwidth, while remaining parameters may be quantized to a second quantized bitwidth that is smaller than the first quantized bitwidth. Although some examples described herein discuss use of two bitwidths (a first for outlier parameters and a second for non-outliers) , in some aspects, more than two bitwidths may be used (e.g., a first bitwidth for non-outlier parameterse, a second bitwidth for extreme outlier parameters, and a third bitwidth (between the first and second bitwidths) for moderate outliers that are less extreme than the extreme outlier parameters) .
[0025] Some aspects of the present disclosure are used to quantize parameters used in matrix multiplication operations. Matrix multiplication, where an input tensor (e.g., a matrix of activation data from a prior layer in the model) is multiplied with a parameter tensor (e.g., a matrix of weights) , is a common operation in a variety of machine learning model architectures. For example, feedforward layers or operations are often implemented using matrix multiplication. Similarly, transformers (which involve self-attention) generally use multiple matrix multiplication operations to generate attention output. In many conventional architectures, the computing expenses (e.g., memory and / or processing resources) used to perform inferencing are largely caused by matrix multiplication operations. In some aspects, therefore, parameter tensors (e.g., weight matrices) used in matrix multiplication operations can be decomposed based on identified outlier parameter values, and each sub-tensor can be quantized using appropriate quantization parameters to balance reduction in parameter size with retention of model accuracy.
[0026] In some aspects, during inferencing, the input tensor to an operation (e.g., input to a matrix multiplication) can similarly be decomposed based on the outliers identified in the parameter tensor, and each sub-tensor of the input can be multiplied with a corresponding quantized sub-tensor from the parameter tensor. The resulting intermediate outputs can then be aggregated or combined (e.g., using element-wise summation) to generate an output tensor for the matrix multiplication operation.
[0027] Example Workflow for Machine Learning Model Parameter Quantization
[0028] FIG. 1 illustrates an example workflow 100 for machine learning model parameter quantization. In some aspects, the workflow 100 is performed by a quantization system (e.g., a computing system that performs model quantization on trained machine learning models) . For example, the quantization system may be a component of a training system (e.g., a component of the computing system that trained the machine learning model) , a component of an inferencing system (e.g., a component of the computing system that uses the trained machine learning model for inferencing) , or a separate system discrete from the training and inferencing systems.
[0029] The illustrated workflow 100 is implemented by an outlier component 110, a decomposition component 120, a quantization component 130, and a compilation component 140. Although depicted as discrete components for conceptual clarity, in some aspects, the operations of the depicted components (as well as others not illustrated) may be combined or distributed across any number and variety of components and systems. Further, the depicted components may generally be implemented using hardware, software, or a combination of hardware and software.
[0030] In the illustrated example, a parameter tensor 105 is accessed by the outlier component 110, which generates outlier indices 115. The parameter tensor 105 generally corresponds to a subset of the parameters of a machine learning model. That is, the parameter tensor 105 may comprise one or more parameters having values that were learned during a training process for the model (e.g., based on supervised and / or unsupervised training) . For example, in some aspects, the parameter tensor 105 comprises a weight matrix for a matrix multiplication operation. In some aspects, the parameter tensor 105 generally corresponds to an original or nonquantized set of parameters from a nonquantized machine learning model.
[0031] In the illustrated example, the outlier indices 115 indicate indices (in the parameter tensor 105) that correspond to parameters having outlier values. As used herein, an “outlier” parameter refers to a parameter with a value that satisfies one or more outlier criteria. Generally, the particular definition of outlier criteria may vary depending on the particular implementation. For example, in some aspects, a parameter is an outlier if its value exceeds a defined threshold magnitude (e.g., a defined threshold above or below zero) . In some aspects, a parameter is an outlier if the parameter falls outside of a defined range from a mean value of the values in the parameter tensor 105. For example, a given parameter may be classified as an outlier if its value is further than two standard deviations from the mean value of the values in the parameter tensor 105. Generally, any suitable criteria may be used to define outlier values.
[0032] In some aspects, the outlier indices 115 indicate the index of each outlier value explicitly (e.g., the row and column of the outlier value) . In some aspects, the outlier indices are row indices indicating the row (s) that have one or more outlier values, and / or column indices indicating the column (s) that have one or more outlier values. For example, if the second row of the parameter tensor 105 includes one or more outlier values, the outlier indices 115 may indicate a row index of “two” as corresponding to one or more outliers. Notably, one or more other values in the same row (e.g., in the second row) may have non-outlier values. For example, the second row may contain fifteen non-outlier values and one outlier value. In some aspects, the outlier indices 115 may indicate that the second row includes at least one outlier value, regardless of the other (non-outlier) values in the row.
[0033] In some aspects, the outlier component 110 can similarly generate a set of non-outlier indices indicating the row (s) , from the parameter tensor 105, that have no outlier values. In other aspects, the non-outlier indices may be inferred implicitly, as the non-outlier rows inherently correspond to all other parameters or rows that are not indicated in the outlier indices 115. For example, suppose the parameter tensor 105 comprises eight rows of parameters, and the first, third, fourth, and eighth rows include one or more outlier values. In some aspects, the outlier indices 115 may indicate the first, third, fourth, and eighth rows. The system may thereby infer that the remaining rows (the second, fifth, sixth, and seventh rows) do not contain any outliers.
[0034] As illustrated, the outlier indices 115 are then provided to the compilation component 140, discussed in more detail below. The outlier indices 115 are further accessed by the decomposition component 120. In the illustrated example, the decomposition component 120 additionally accesses the parameter tensor 105. The decomposition component 120 decomposes the parameter tensor 105 into a set of parameter sub-tensors 125A and 125B (collectively, parameter sub-tensors 125) based on the outlier indices 115. As used herein, “decomposing” a tensor (also referred to as splitting, slicing, or delineating in some aspects) refers to distributing elements of the tensor across two or more sub-tensors. For example, in the illustrated aspect, the parameter sub-tensor 125A may contain any outliers found in the parameter tensor 105 (e.g., as indicated by the outlier indices 115) , and the parameter sub-tensor 125B may contain remaining (non-outlier) elements from the parameter tensor 105.
[0035] In some aspects, as discussed above, the outlier indices 115 indicate which row (s) , in the parameter tensor 105, include at least one outlier. In some such aspects, the decomposition component 120 slices the parameter tensor 105 to separate the row (s) indicated by the outlier indices 115 (which each include at least one outlier) to form the parameter sub-tensor 125A. The decomposition component 120 uses the remaining row (s) (which are not indicated by the outlier indices 115 and do not contain any outliers) to form the parameter sub-tensor 125B. That is, in some aspects, the parameter sub-tensor 125B is a matrix of parameters (e.g., weights) containing no outlier values, and the parameter sub-tensor 125A is a matrix of parameters (e.g., weights) containing any outliers found in the parameter tensor 105. As discussed above, the parameter sub-tensor 125A may additionally include one or more non-outlier values (e.g., if a non-outlier element is in the same row as an outlier element in the parameter tensor 105) .
[0036] Although the illustrated example depicts the decomposition component 120 decomposing the parameter tensor 105 into two parameter sub-tensors 125, in some aspects, any multiple number of sub-tensors may be used. For example, in some aspects, the outlier component 110 may generate multiple sets of indices, such as one set of outlier indices used to indicate values exceeding a first threshold (e.g., weights with values that are further than two standard deviations from the mean value) and a second set of outlier indices used to indicate values that exceed a second (lower) threshold but do not exceed the first (higher) threshold (e.g., weights with values that are between one and two standard deviations from the mean) . In some such aspects, the decomposition component 120 may generate three parameter sub-tensors 125: a first for extreme outliers (e.g., values more than two standard deviations from the mean) , a second for moderate outliers (e.g., values between one and two standard deviations from the mean) , and a third for remaining (non-outlier) values.
[0037] In the depicted workflow 100, the parameter sub-tensors 125 are each accessed by the quantization component 130, which generates corresponding quantized parameter sub-tensors 135A and 135B (collectively, quantized parameter sub-tensors 135) . Generally, the quantization component 130 may use any number and variety of quantization schemes to quantize the parameter sub-tensors 125. In some aspects, the quantization component 130 uses a different quantization scheme for each parameter sub-tensor 125. For example, the quantization component 130 may determine a respective set of quantization parameters for each respective parameter sub-tensor. As one example, the quantization component 130 may evaluate the value (s) contained in a given parameter sub-tensor 125 to determine a suitable quantization scale factor and / or zero-point for the given parameter sub-tensor. In this way, the quantized parameter sub-tensor 135A (which may correspond to the parameter sub-tensor 125A) may be quantized using a first scale and zero-point selected specifically for the values reflected in the parameter sub-tensor 125A, and the quantized parameter sub-tensor 135B (which may correspond to the parameter sub-tensor 125B) may similarly be quantized using a second scale and zero- point selected specifically for the values reflected in the parameter sub-tensor 125B. In other aspects, the quantization component uses at least two different quantization schemes for more than two parameter sub-tensors.
[0038] In some aspects, the quantization component 130 may further select or determine a suitable bitwidth for each respective parameter sub-tensor 125. For example, based on a predefined configuration and / or based on dynamic evaluation of the individual parameter sub-tensors 125, the quantization component 130 may determine to use a relatively smaller bitwidth for quantizing the parameter sub-tensor 125B (which does not include outliers) , as compared to the bitwidth used to quantize the parameter sub-tensor 125A (which includes one or more outliers) . As discussed above, using a relatively larger bitwidth for quantizing these outlier sub-tensors can enable improved accuracy, while using relatively smaller bitwidths for non-outlier values (which do not benefit from the increased precision of larger bitwidths) can minimize (or at least reduce) the total size (e.g., number of bits) of the collective quantized parameters.
[0039] For example, in some aspects, quantization hyperparameters may indicate that the parameter sub-tensor 125A (which contains outliers) should be quantized to one bitwidth (e.g., sixteen bits) while the parameter sub-tensor 125B (which contains no outliers) should be quantized to a second bitwidth (e.g., eight bits) . In some aspects, in addition to or instead of using such preconfigured bitwidths, the quantization component 130 may dynamically determine a suitable bitwidth. For example, based on the range and / or standard deviation of values in a given parameter sub-tensor 125, the quantization component 130 may select a bitwidth to balance the precision and size of the resulting quantized parameter sub-tensor 135.
[0040] As discussed above, although two quantized parameter sub-tensors 135 (generated using two discrete quantization schemes) are depicted for conceptual clarity, in some aspects, the quantization component 130 may generate any number of quantized parameter sub-tensors 135 using any number and variety of quantization schemes. For example, as discussed above, if three parameter sub-tensors 125 are generated, the quantization component 130 may generate three corresponding quantized parameter sub-tensors 135 (e.g., using the largest bitwidth for the parameter sub-tensor 125 containing the most extreme outliers, a medium bitwidth for the parameter sub-tensor 125 containing moderate outliers, and a smallest bitwidth for the parameter sub-tensor 125 containing no outliers) .
[0041] In the illustrated example, the quantized parameter sub-tensors 135 are then accessed by the compilation component 140. The compilation component 140 further accesses the outlier indices 115 (generated by the outlier component 110) and generates a quantized machine learning model 145. For example, the compilation component 140 may aggregate, combine, or compile the quantized parameter sub-tensors 135 and the outlier indices 115 as a machine learning model such that other systems can use the model for inferencing. In some aspects, as discussed below in more detail, the outlier indices 115 may be included in the quantized machine learning model 145 or otherwise provided to inferencing systems, as the outlier indices 115 are used during inferencing to decompose input tensors. For example, the outlier indices 115 may be included as hyperparameters for the portion (s) (e.g., layers or other operations) of the model that correspond to the original parameter tensor 105. In some aspects, in addition to the outlier indices, the compilation component 140 may similarly include the quantization parameters of each quantized parameter sub-tensor 135 in the compiled quantized machine learning model 145.
[0042] Although not included in the illustrated example, in some aspects, the compilation component 140 may similarly compile remaining parameters and / or hyperparameters of the machine learning model to generate the quantized machine learning model 145. For example, the workflow 100 may be performed for any other matrix multiplication operations, and the resulting quantized parameter sub-tensors 135 and outlier indices 115 for each such matrix multiplication operation may be compiled to form a single quantized machine learning model 145. In some aspects, other parameters and / or hyperparameters (e.g., parameters not corresponding to matrix multiplication operations) from the machine learning model may similarly be compiled to form the quantized machine learning model 145. In some aspects, such other parameters may similarly be quantized appropriately (e.g., using the workflow 100, or using any other suitable techniques) .
[0043] In this way, the quantized machine learning model 145 can represent or correspond to the original machine learning model (from which the parameter tensor 105 was drawn) , but with substantially reduced size due to the reduced bitwidth (s) used to encode the parameters. This reduces the memory footprint of the model, as well as reducing the bandwidth consumed by transmitting all or a part of the model across communication links (e.g., via a network, such as the Internet, to deploy the model to inferencing systems, as well as via links used to retrieve parameters from memory and transmit the retrieved parameters to processing units during inferencing) . This significantly improves the operations of the involved computing devices.
[0044] Example Workflow for Generating Inferences Using Quantized Machine Learning Model Parameters
[0045] FIG. 2 illustrates an example workflow 200 for generating inferences using quantized machine learning model parameters. In some aspects, the workflow 200 is performed by an inferencing system (e.g., a computing system that uses trained machine learning model for inferencing) . For example, the inferencing system may be a separate system discrete from the training system (e.g., the system that trains the machine learning models) and / or the quantization systems (e.g., the system that performs model quantization on trained machine learning models) . In other aspects, the inferencing system may be implemented as a component of another system, such as a component of the training system and / or as a component of the quantization system.
[0046] The illustrated workflow 200 is implemented by a decomposition component 210, a set of multiplication components 220A and 220B (collectively, multiplication components 220) , a set of dequantization components 230A and 230B (collectively, dequantization components 230) , and an aggregation component 240. Although depicted as discrete components for conceptual clarity, in some aspects, the operations of the depicted components (as well as others not illustrated) may be combined or distributed across any number and variety of components and systems. Further, the depicted components may generally be implemented using hardware, software, or a combination of hardware and software.
[0047] In the illustrated example, an input tensor 205 is accessed by the decomposition component 210, which also accesses a set of outlier indices (e.g., the outlier indices 115, as illustrated) . The input tensor 205 generally corresponds to a set of values used as input to a layer or operation of a machine learning model. For example, the input tensor 205 may comprise activation data output by an activation function of a prior layer, or the input tensor 205 may comprise feature data used as input to the model (e.g., if the operation is the first layer) . In some aspects, the input tensor 205 is received as input to a matrix multiplication operation (e.g., for a feedforward operation and / or an attention operation) , as discussed above.
[0048] The outlier indices 115 generally indicate the index of any outlier values in a parameter tensor (e.g., parameter tensor 105 of FIG. 1) , as discussed above. That is, the outlier indices 115 may have been generated during quantization of the machine learning model. In some aspects, the outlier indices 115 indicate the outlier values explicitly (e.g., the row and column, in the original parameter tensor, of each outlier value) . In some aspects, the outlier indices 115 indicate the row (s) in the parameter tensor that had one or more outlier values. In some aspects, as discussed above, the outlier indices 115 are provided as metadata or hyperparameters associated with the matrix multiplication operation in the model.
[0049] In the illustrated example, the decomposition component 210 slices or decomposes the input tensor 205 based on the outlier indices 115 to generate a set of input sub-tensors 215A and 215B (collectively, input sub-tensors 215) . For example, if the outlier indices 115 indicate the columns (s) of the original parameter tensor that include one or more outliers, the decomposition component 210 may slice the input tensor 205 such that corresponding row (s) of the input tensor 205 are allocated to the input sub-tensor 215A, while remaining rows (which are not indicated in the outlier indices 115 and therefore correspond to columns of parameters that did not have outliers) are allocated to the input sub-tensor 215B.
[0050] As another example, if the outlier indices 115 indicate the row (s) of the original parameter tensor that include one or more outliers, the decomposition component 210 may slice the input tensor 205 such that corresponding column (s) of the input tensor 205 are allocated to the input sub-tensor 215A, while remaining columns (which are not indicated in the outlier indices 115 and therefore correspond to rows of parameters that did not have outliers) are allocated to the input sub-tensor 215B. For example, if the outlier indices 115 indicate that the first, third, and fourth rows of the parameter tensor contained outliers, the decomposition component 210 may allocate the first, third, and fourth columns of the input tensor 205 to the input sub-tensor 215A. In this way, by performing column-wise slicing (while the parameter tensor was sliced row-wise) , the decomposition component 210 ensures that the width of the input sub-tensors 215 matches the height of the corresponding quantized parameter sub-tensor, and each value in the input tensor 205 remains aligned with its corresponding parameter in the parameter tensor in order to enable the matrix multiplication.
[0051] As discussed above, although two input sub-tensors 215 are depicted for conceptual clarity, in aspects, the decomposition component 210 may slice the input tensor 205 into any number of sub-tensors (based on the outlier indices 115) . As illustrated, the input sub-tensors 215 are accessed by respective multiplication components 220. Specifically, the input sub-tensor 215A is accessed by multiplication component 220A, and the input sub-tensor 215B is accessed by multiplication component 220B. Although two multiplication components 220 are depicted for conceptual clarity (one for each input sub-tensor 215) , in some aspects, the inferencing system may use a single multiplication component 220 (e.g., processing the input sub-tensors 215 sequentially) . In other aspects, multiple multiplication components 220 may be used, where at least one of the multiplication components processes multiple input sub-tensors sequentially.
[0052] As illustrated, each multiplication component 220 further accesses a quantized parameter sub-tensor (e.g., the quantized parameter sub-tensors 135, as shown) that corresponds to the input sub-tensor 215. Specifically, the multiplication component 220A accesses the quantized parameter sub-tensor 135A, which corresponds to the input sub-tensor 215A (e.g., because both the quantized parameter sub-tensor 135A and the input sub-tensor 215A correspond to the outlier indices 115) . In addition, the multiplication component 220B accesses the quantized parameter sub-tensor 135B, which corresponds to the input sub-tensor 215B (e.g., because both the quantized parameter sub-tensor 135B and the input sub-tensor 215B correspond to the remaining values not indicated by the outlier indices 115) .
[0053] In the illustrated workflow 200, each of the multiplication components 220 then performs matrix multiplication to multiply each input sub-tensor 215 with the corresponding quantized parameter sub-tensor 135. Specifically, the multiplication component 220A multiplies the input sub-tensor 215A with the quantized parameter sub-tensor 135A to generate an output sub-tensor 225A. In addition, the multiplication component 220B multiplies the input sub-tensor 215B with the quantized parameter sub-tensor 135B to generate an output sub-tensor 225B.
[0054] As illustrated, these output sub-tensors 225A and 225B (collectively, output sub-tensors 225) are accessed by the dequantization components 230A and 230B, respectively. Specifically, the output sub-tensor 225A (which corresponds to or was generated based on outlier parameter values) is accessed by the dequantization component 230A, and the output sub-tensor 225B (which corresponds to non-outlier parameter values) is accessed by the dequantization component 230B. Although two dequantization components 230 are depicted for conceptual clarity (one for each output sub-tensor 225) , in some aspects, the inferencing system may use a single dequantization component 230 (e.g., processing the output sub-tensors 225 sequentially) .
[0055] In the illustrated example, the dequantization components 230 perform dequantization operations on the output sub-tensors 225 to generate dequantized output sub-tensors 235A and 235B (collectively, dequantized output sub-tensors 235) . Specifically, the dequantization component 230A dequantizes the output sub-tensor 225A based on the quantization parameters that were used to quantize the quantized parameter sub-tensor 135A to generate the dequantized output sub-tensor 235A, and the dequantization component 230B dequantizes the output sub-tensor 225B based on the quantization parameters that were used to quantize the quantized parameter sub-tensor 135B to generate the dequantized output sub-tensor 235B.
[0056] The dequantized output sub-tensors 235 are then accessed by the aggregation component 240, which generates an output tensor 245. In some aspects, the particular aggregation operation (s) used by the aggregation component 240 may vary depending on the particular implementation. For example, the aggregation component 240 may use summation, concatenation, averaging, and the like. In the illustrated example, the aggregation component 240 performs element-wise summation on the dequantized output sub-tensors 235 to generate the output tensor 245.
[0057] The output tensor 245 may be used as the output of the matrix multiplication (or other operation) to which the quantized parameter sub-tensors correspond. For example, the output tensor 245 may be provided as output of the model, and / or as output to a subsequent layer or operation in the machine learning model (e.g., as part of a feedforward layer or an attention component, as discussed above) .
[0058] Using the workflow 200, the inferencing system can perform efficient matrix multiplication using mixed-precision quantized parameters. As discussed above, this mixed-precision representation can represent or correspond to the original machine learning model (from which the parameter tensor was drawn) , with substantially reduced size due to the reduced bitwidth (s) used to encode the parameters. This reduces the memory footprint of the model, as well as reducing the bandwidth consumed by transmitting all or a part of the model across communication links (e.g., from memory to the processing unit (s) used to perform the multiplications during inferencing) . This significantly improves the operations of the involved computing devices.
[0059] Example Method for Generating Quantized Machine Learning Models
[0060] FIG. 3 is a flow diagram depicting an example method 300 for generating quantized machine learning models. In some aspects, the method 300 is performed by a quantization system, such as the quantization system discussed above with reference to FIG. 1.
[0061] At block 305, the quantization system accesses a parameter tensor (e.g., the parameter tensor 105 of FIG. 1) . As discussed above, the parameter sensor generally comprises one or more parameters for one or more components or portions of a machine learning model. For example, the parameter tensor may correspond to a weight matrix used to perform a matrix multiplication operation within the model (e.g., as part of an attention mechanism or operation, or as part of a feedforward layer of a neural network) . Generally, there may be any number of parameter tensors in a given model, each having any number of parameters. In some aspects, the quantization system may perform the method 300 for each such tensor (e.g., sequentially or in parallel) to quantize the model. In some aspects, as discussed above, the parameters or elements in the parameter tensor may have values that were learned or trained during a training process for the model (e.g., based on labeled and / or unlabeled training data) .
[0062] At block 310, the quantization system identifies a set of outlier indices (e.g., the outlier indices 115 of FIG. 1) for the parameter tensor. In some aspects, as discussed above, the outlier indices generally indicate the position (s) (in the tensor) of any parameters having an outlier value. In some aspects, outliers are defined with respect to the other values in the parameter tensor. For example, a parameter may be designated as an outlier if the value of the parameter is more than two standard deviations away from the mean value of the parameter tensor. In other aspects, outliers are defined using a fixed threshold (rather than with respect to the other values in the tensor) . For example, a parameter may be labeled as an outlier if the value of the parameter exceeds a static threshold value (e.g., more than a value of ten) . Generally, the quantization system may use a variety of criteria to define outliers.
[0063] In some aspects, as discussed above, the outlier indices are row indices, where each indicated row comprises at least one outlier parameter value. That is, if the parameter tensor is a weight matrix, the outlier indices may indicate the row (s) that have at least one outlier value.
[0064] At block 315, the quantization system decomposes the parameter tensor, based on the outlier indices, to generate parameter sub-tensors (e.g., the parameter sub-tensors 125 of FIG. 1) . For example, in some aspects, the quantization system creates a first parameter sub-tensor and a second parameter sub-tensor. The first parameter sub-tensor may contain the values indicated in the outlier indices (e.g., by stacking or concatenating the indicated rows, from the parameter tensor, to generate a new matrix) . The second parameter sub-tensor may contain the remaining values (e.g., by stacking or concatenating the rows, from the parameter tensor, that are not indicated in the outlier indices) . As discussed above, although the non-outlier sub-tensor contains no outlier values, the outlier sub-tensor may contain one or more non-outlier values (in addition to all outlier values from the parameter tensor) . Although decomposing the parameter tensor into two sub-tensors is described for conceptual clarity, as discussed above, the quantization system may decompose the parameter tensor into any number of sub-tensors.
[0065] At block 320, the quantization system selects one of the parameter sub-tensors. Generally, the quantization system may use any suitable technique or criteria to select the sub-tensor, as the quantization system will process each sub-tensor during the method 300. Additionally, though depicted as an iterative process (where the quantization system selects and processes each sub-tensor sequentially) for conceptual clarity, in some aspects, the quantization system may process some or all of the sub-tensors in parallel.
[0066] At block 325, the quantization system determines or selects a quantization scheme for the selected sub-tensor. In some aspects, as discussed above, the quantization system determines the quantization scheme by identifying a defined scheme (e.g., indicated in a prior-generated or defined mapping) that corresponds to the selected sub-tensor. For example, the quantization system may use a first defined scheme for any non-outlier sub-tensors, and a second defined scheme for any outlier-containing sub-tensors. In some aspects, as discussed above, the quantization system may determine the quantization scheme based on the distribution of values in the selected sub-tensor. For example, the quantization system may select or define a quantization scheme based on the mean value, range of values, standard deviation of values, minimum and / or maximum value, and the like. This may allow the quantization system to dynamically quantize each sub-tensor using a custom-defined quantization for each sub-tensor.
[0067] In some aspects, as discussed above, the quantization scheme generally includes a quantization scale (e.g., selected based on the range of the values in the sub-tensor) , a quantization zero-point or offset (e.g., selected based on the mean of values in the sub-tensor) , and a quantization bitwidth (e.g., selected based on the range of values in the sub-tensor and / or based on a defined mapping based on whether the sub-tensor contains outliers) . For example, as discussed above, the quantization system may select a quantization scheme having a relatively higher bitwidth (e.g., encoding each quantized parameter using more bits) for the outlier-containing sub-tensor, and use a quantization scheme having a relatively lower bitwidth (e.g., encoding each quantized parameter using fewer bits) for the non-outlier sub-tensor.
[0068] At block 330, the quantization system quantizes the selected parameter sub-tensor using the determined quantization scheme (e.g., to generate the quantized parameter sub-tensors 135 of FIG. 1) . As discussed above, quantizing the sub-tensor generally includes encoding each parameter in a relatively smaller bitwidth, as compared to the nonquantized parameter. For example, for each parameter, the quantization system may (i) multiply the parameter by the determined quantization scale and / or (ii) add or subtract the zero point. The resulting value can then be encoded using the determined bitwidth. In this way, the quantized sub-tensor can be represented using relatively fewer bits, as compared to the non-quantized sub-tensor.
[0069] At block 335, the quantization system determines whether there is at least one additional parameter sub-tensor (generated at block 315) that has not yet been quantized. If so, the method 300 returns to block 320 to select a parameter sub-tensor for processing. If not, the method 300 continues to block 340.
[0070] At block 340, the quantization system generates a quantized machine learning model based on the quantized sub-tensors. For example, as discussed above, the quantization system may compile the quantized sub-tensors, along with relevant metadata such as the quantization parameter (s) used for each sub-tensor, the outlier indices, and the like, to represent the original parameter tensor in the quantized model. In some aspects, generating the quantized machine learning model similarly includes compiling the quantized parameters (and other relevant data) for other parameter (s) in the original model (e.g., for other parameter tensors and / or other layers or portions of the model) .
[0071] In this way, the quantization system can dynamically generate a quantized version of the (original) machine learning model, which can be represented or stored using fewer bits. This reduces the memory footprint of the model, as well as reducing the communication bandwidth consumed by sending the quantized model (e.g., over a network to an inferencing system, and / or from memory to a processing component of the inferencing system) . In this way, the quantized model can be used for inferencing using reduced computational resources, which may enable more efficient execution and / or use of the model on resource-limited devices.
[0072] Example Method for Generating Output Tensors Based on Quantized Machine Learning Model Parameters
[0073] FIG. 4 is a flow diagram depicting an example method 400 for generating output tensors based on quantized machine learning model parameters. In some aspects, the method 400 is performed by an inferencing system, such as the inferencing system discussed above with reference to FIG. 2.
[0074] At block 405, the inferencing system accesses an input tensor (e.g., the input tensor 205) . As discussed above, the input tensor is generally used as input to a layer or portion of a machine learning model (e.g., as input to a matrix multiplication operation, such as in a feedforward layer and / or an attention layer) . As discussed above, the input tensor is generally a tensor comprising one or more elements of data (e.g., a vector, a matrix, or a scalar value) that is used as input to an operation (e.g., matrix multiplication) of a machine learning model. For example, if the operation is the first layer of the model, the input tensor may be data that is provided as input to the model (e.g., sensor data) . If the operation is part of an internal layer (e.g., an attention operation or feedforward layer internal to the model) , the input tensor may comprise data output by a prior layer or operation (e.g., activation data from the prior layer) .
[0075] At block 410, the inferencing system determines the set of outlier indices that correspond to the current operation or layer of the model. That is, if the input tensor is received or accessed to be processed using a given layer or operation, the inferencing system may identify the outlier indices generated for that given layer or operation. In some aspects, as discussed above, these outlier indices may be determined (e.g., by a quantization system) during quantization of the model. These outlier indices may be provided or included as part of the compiled quantized model.
[0076] As discussed above, in some aspects, the outlier indices indicate the row (s) in an original parameter tensor that include one or more outlier parameter values. This allows the inferencing system to identify the element (s) in the input tensor that correspond to the outlier row (s) .
[0077] At block 415, the inferencing system decomposes the input tensor into a set of input sub-tensors (e.g., the input sub-tensors 215 of FIG. 2) based on the outlier indices. For example, if the outlier indices correspond to specific parameters (e.g., specific column c and row r indices for each outlier value) , the inferencing system may use these indices to identify the corresponding input element (e.g., the input element at the same column c and row r, or the input element at the inverse index column r and row c) . In some aspects, if the outlier indices are row indices (e.g., each index indicating a row, from the original parameter tensor, that included at least one outlier) , the inferencing system may identify a corresponding column for each such row.
[0078] For example, if the outlier indices indicate that rows [2, 5, …, r] contained one or more outliers in the parameter tensor, the inferencing system may generate an input sub-tensor that includes columns [2, 5, …, r] from the input tensor. In some aspects, in addition to this outlier sub-tensor (an input sub-tensor containing elements that correspond to the parameters in the outlier parameter sub-tensor) , the inferencing system similarly generate a non-outlier sub-tensor containing the remaining elements from the input tensor. Although decomposing the input tensor into two sub-tensors is described for conceptual clarity, as discussed above, the inferencing system may decompose the input tensor into any number of sub-tensors.
[0079] At block 420, the inferencing system selects one of the input sub-tensors. Generally, the inferencing system may use any suitable technique or criteria to select the sub-tensor, as the inferencing system will process each sub-tensor during the method 400. Additionally, though depicted as an iterative process (where the inferencing system selects and processes each sub-tensor sequentially) for conceptual clarity, in some aspects, the inferencing system may process some or all of the sub-tensors in parallel.
[0080] At block 425, the inferencing system accesses the parameter sub-tensor that corresponds to the selected sub-tensor. For example, if the selected sub-tensor corresponds to the outlier indices, the inferencing system may access the parameter sub-tensor that also corresponds to the outlier indices. Similarly, if the selected sub-tensor contains the remaining elements from the input tensor (those that do not correspond to the outlier indices) , the inferencing system may access the parameter sub-tensor that also corresponds to the remaining (non-outlier) parameters. In some aspects, as discussed above, the parameter sub-tensor may be a quantized sub-tensor (e.g., quantized by a quantization component based on a set of quantization parameters) . That is, at block 425, the inferencing system may access the corresponding quantized parameter sub-tensor (e.g., one of the quantized parameter sub-tensors 135 of FIG. 1) .
[0081] At block 430, the inferencing system generates an output sub-tensor based on the selected input sub-tensor and the corresponding parameter sub-tensor. For example, in the case of matrix multiplication, the inferencing system may multiply the selected input sub-tensor with the corresponding parameter sub-tensor.
[0082] At block 435, the inferencing system dequantizes the generated output sub-tensor based on the quantization parameters that were used to quantize the parameter sub-tensor (accessed at block 425) . In some aspects, as discussed above, these quantization parameters may be provided or included as part of the quantized machine learning model, allowing the inferencing device to dequantize the parameters appropriately.
[0083] At block 440, the inferencing system determines whether there is at least one additional input sub-tensor remaining to be processed. If so, the method 400 returns to block 420. If not, the method 400 continues to block 445.
[0084] At block 445, the inferencing system aggregates the output sub-tensors to generate an output tensor (such as the output tensor 245 of FIG. 2) . For example, in some aspects, the inferencing system may compute an element-wise summation of the output sub-tensors to generate the output tensor. This output tensor corresponds to the output of the current operation or layer (e.g., the output of the matrix multiplication operation) in the machine learning model.
[0085] In this way, the inferencing system can generate machine learning model outputs and / or internal values (e.g., results of matrix multiplication operations) with substantially reduced computational expense, as compared to at least some conventional machine learning models. Although not included in the illustrated example, in some aspects, the inferencing system may similarly perform the method 400 for each other relevant operation or layer (e.g., for each other matrix multiplication operation) in the quantized model.
[0086] Example Method for Parameter Quantization
[0087] FIG. 5 is a flow diagram depicting an example method 500 for parameter quantization. In some aspects, the method 500 is performed by a quantization system, such as the quantization system discussed above with reference to FIG. 1 and / or FIG. 3.
[0088] At block 505, a parameter tensor for a machine learning model is accessed.
[0089] In some aspects, the parameter tensor comprises weights for a matrix multiplication operation.
[0090] In some aspects, the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.
[0091] At block 510, a set of rows, in the parameter tensor, that each include one or more outlier values is identified.
[0092] In some aspects, the method 500 further includes identifying the one or more outlier values comprising: determining one or more outlier criteria; and evaluating each respective value in the parameter tensor using the one or more outlier criteria.
[0093] In some aspects, the one or more outlier criteria comprise a magnitude threshold.
[0094] In some aspects, the method 500 further includes generating a set of outlier indices comprising a respective index of each respective row in the set of rows. The set of outlier indices may be used during inferencing to decompose input tensors.
[0095] At block 515, the parameter tensor is decomposed into a first parameter sub-tensor corresponding to the set of rows and a second parameter sub-tensor corresponding to at least one remaining row in the parameter tensor.
[0096] At block 520, the first parameter sub-tensor is quantized according to a first quantization scheme.
[0097] At block 525, the second parameter sub-tensor is quantized according to a second quantization scheme.
[0098] In some aspects, the first quantization scheme comprises a first quantized bitwidth, and the second quantization scheme comprises a second quantized bitwidth smaller than the first quantized bitwidth.
[0099] At block 530, a quantized version of the machine learning model comprising the quantized first and second parameter sub-tensors is generated.
[0100] In some aspects, the inferencing comprises: accessing an input tensor, decomposing the input tensor into a first input sub-tensor having columns corresponding to the set of outlier indices and a second input sub-tensor corresponding to at least one remaining column in the input tensor, generating a first output sub-tensor based on multiplying the first input sub-tensor with the first parameter sub-tensor, and generating a second output sub-tensor based on multiplying the second input sub-tensor with the second parameter sub-tensor.
[0101] In some aspects, the inferencing further comprises: dequantizing the first and second output sub-tensors generating an output tensor by element-wise summing the first and second dequantized output sub-tensors.
[0102] Example Generation of an Output Tensor
[0103] FIG. 6 is a flow diagram depicting an example method 600 for generating an output tensor. In some aspects, the method 600 is performed by an inferencing system, such as the inferencing system discussed above with reference to FIG. 2 and / or FIG. 4.
[0104] At block 605, an input tensor for a layer of a machine learning model is accessed.
[0105] At block 610, the input tensor is decomposed into a first input sub-tensor corresponding to a set of outlier indices and a second input sub-tensor corresponding to at least one remaining element in the input tensor.
[0106] In some aspects, the set of outlier indices indicates a set of rows, in a nonquantized parameter tensor for the layer of the machine learning model, that each included one or more outlier values.
[0107] At block 615, a first output sub-tensor is generated based on multiplying the first input sub-tensor with a first parameter sub-tensor.
[0108] At block 620, a second output sub-tensor is generated based on multiplying the second input sub-tensor with a second parameter sub-tensor.
[0109] In some aspects, the first parameter sub-tensor is quantized according to a first quantization scheme, and the second parameter sub-tensor is quantized according to a second quantization scheme.
[0110] In some aspects, the first quantization scheme comprises a first quantized bitwidth, and the second quantization scheme comprises a second quantized bitwidth larger than the first quantized bitwidth.
[0111] In some aspects, the first and second parameter sub-tensors comprise weights for a matrix multiplication operation.
[0112] In some aspects, the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.
[0113] At block 625, an output tensor for the layer of the machine learning model is generated based on the first and second output sub-tensors.
[0114] In some aspects, generating the output tensor comprises: dequantizing the first and second output sub-tensors and element-wise summing the first and second dequantized output sub-tensors.
[0115] Example Processing System for Data Quantization
[0116] In some aspects, the workflows, techniques, and methods described with reference to FIGS. 1-6 may be implemented on one or more devices or systems. FIG. 7 depicts an example processing system 700 configured to perform various aspects of the present disclosure, including, for example, the techniques and methods described with respect to FIGS. 1-6. In some aspects, the processing system 700 may correspond to a quantization system, such as the quantization system discussed above with reference to of FIG. 1 and / or FIG. 3. For example, the processing system 700 may correspond to a system that quantizes machine learning models after training. Although depicted as a single system for conceptual clarity, in some aspects, as discussed above, the operations described below with respect to the processing system 700 may be distributed across any number of devices or systems.
[0117] The processing system 700 includes a central processing unit (CPU) 702, which in some examples may be a multi-core CPU. Instructions executed at the CPU 702 may be loaded, for example, from a program memory associated with the CPU 702 or may be loaded from a memory partition (e.g., a partition of memory 724) .
[0118] The processing system 700 also includes additional processing components tailored to specific functions, such as a graphics processing unit (GPU) 704, a digital signal processor (DSP) 706, a neural processing unit (NPU) 708, a multimedia component 710 (e.g., a multimedia processing unit) , and a wireless connectivity component 712.
[0119] An NPU, such as NPU 708, is generally a specialized circuit configured for implementing the control and arithmetic logic for executing machine learning algorithms, such as algorithms for processing artificial neural networks (ANNs) , deep neural networks (DNNs) , random forests (RFs) , and the like. An NPU may sometimes alternatively be referred to as a neural signal processor (NSP) , tensor processing unit (TPU) , neural network processor (NNP) , intelligence processing unit (IPU) , vision processing unit (VPU) , or graph processing unit.
[0120] NPUs, such as the NPU 708, are configured to accelerate the performance of common machine learning tasks, such as image classification, machine translation, object detection, and various other predictive models. In some examples, a plurality of NPUs may be instantiated on a single chip, such as a system on a chip (SoC) , while in other examples the NPUs may be part of a dedicated neural-network accelerator.
[0121] NPUs may be optimized for training or inference, or in some cases configured to balance performance between both. For NPUs that are capable of performing both training and inference, the two tasks may still generally be performed independently.
[0122] NPUs designed to accelerate training are generally configured to accelerate the optimization of new models, which is a highly compute-intensive operation that involves inputting an existing dataset (often labeled or tagged) , iterating over the dataset, and then adjusting model parameters, such as weights and biases, in order to improve model performance. Generally, optimizing based on a wrong prediction involves propagating back through the layers of the model and determining gradients to reduce the prediction error.
[0123] NPUs designed to accelerate inference are generally configured to operate on complete models. Such NPUs may thus be configured to input a new piece of data and rapidly process this piece of data through an already trained model to generate a model output (e.g., an inference) .
[0124] In some implementations, the NPU 708 is a part of one or more of the CPU 702, the GPU 704, and / or the DSP 706.
[0125] In some examples, the wireless connectivity component 712 may include subcomponents, for example, for third generation (3G) connectivity, fourth generation (4G) connectivity (e.g., 4G Long-Term Evolution (LTE) ) , fifth generation connectivity (e.g., 5G or New Radio (NR) ) , Wi-Fi connectivity, Bluetooth connectivity, and / or other wireless data transmission standards. The wireless connectivity component 712 is further coupled to one or more antennas 714.
[0126] The processing system 700 may also include one or more sensor processing units 716 associated with any manner of sensor, one or more image signal processors (ISPs) 718 associated with any manner of image sensor, and / or a navigation processor 720, which may include satellite-based positioning system components (e.g., GPS or GLONASS) , as well as inertial positioning system components.
[0127] The processing system 700 may also include one or more input and / or output devices 722, such as screens, touch-sensitive surfaces (including touch-sensitive displays) , physical buttons, speakers, microphones, and the like.
[0128] In some examples, one or more of the processors of the processing system 700 may be based on an ARM or RISC-V instruction set.
[0129] The processing system 700 also includes the memory 724, which is representative of one or more static and / or dynamic memories, such as a dynamic random access memory, a flash-based static memory, and the like. In this example, the memory 724 includes computer-executable components, which may be executed by one or more of the aforementioned processors of the processing system 700.
[0130] In particular, in this example, the memory 724 includes an outlier component 724A, a decomposition component 724B, a quantization component 724C, and a compilation component 724D. The memory 724 further includes model parameters 724E for one or more models (e.g., parameter tensors 105 of FIG. 1) . Although not included in the illustrated example, in some aspects the memory 724 may also include other data, such as training data (e.g., to train and / or fine-tune the model (s) ) . Though depicted as discrete components for conceptual clarity in FIG. 7, the illustrated components (and others not depicted) may be collectively or individually implemented in various aspects.
[0131] The processing system 700 further comprises an outlier circuit 726, a decomposition circuit 727, a quantization circuit 728, and a compilation circuit 729. The depicted circuits, and others not depicted, may be configured to perform various aspects of the techniques described herein.
[0132] For example, the outlier component 724A and / or the outlier circuit 726 (which may correspond to the outlier component 110 of FIG. 1) may be used to identify outlier parameters in the model parameters 724E and / or generate outlier indices, as discussed above. For example, the outlier component 724A and / or the outlier circuit 726 may use various outlier criteria to identify outlier values, and generate outlier indices indicating the row (s) , in one or more parameter tensors, that contain such outlier (s) .
[0133] The decomposition component 724B and / or the decomposition circuit 727 (which may correspond to the decomposition component 120 of FIG. 1) may be used to decompose parameter tensors based on outlier indices, as discussed above. For example, the decomposition component 724B and / or the decomposition circuit 727 may decompose the parameter tensors by generating one sub-tensor containing row (s) of the parameter tensor that include one or more outliers and generating a second sub-tensor containing the remaining row (s) of the parameter tensor.
[0134] The quantization component 724C and / or the quantization circuit 728 (which may correspond to the quantization component 130 of FIG. 1) may be used to quantize parameter sub-tensors, as discussed above. For example, the quantization component 724C and / or the quantization circuit 728 may determine or select a quantization scheme for each parameter sub-tensor, quantizing each respective sub-tensor according to a respective quantization scheme.
[0135] The compilation component 724D and / or the compilation circuit 729 (which may correspond to the compilation component 140 of FIG. 1) may be used to compile quantized parameter sub-tensors and relevant metadata, such as outlier indices and quantization parameters, as discussed above. For example, the compilation component 724D and / or the compilation circuit 729 may aggregate the set of quantized parameter sub-tensors and corresponding outlier indices and quantization parameters for each operation in the machine learning model to generate a quantized version of the machine learning model.
[0136] Though depicted as separate components and circuits for clarity in FIG. 7, the outlier circuit 726, the decomposition circuit 727, the quantization circuit 728, and the compilation circuit 729 may collectively or individually be implemented in other processing devices of the processing system 700, such as within the CPU 702, the GPU 704, the DSP 706, the NPU 708, and the like.
[0137] Generally, the processing system 700 and / or components thereof may be configured to perform the methods described herein.
[0138] Notably, in other aspects, elements of the processing system 700 may be omitted, such as where the processing system 700 is a server computer or the like. For example, the multimedia component 710, the wireless connectivity component 712, the sensor processing units 716, the ISPs 718, and / or the navigation processor 720 may be omitted in other aspects. Further, aspects of the processing system 700 may be distributed between multiple devices.
[0139] Example Processing System for Inferencing
[0140] In some aspects, the workflows, techniques, and methods described with reference to FIGS. 1-6 may be implemented on one or more devices or systems. FIG. 8 depicts an example processing system 800 configured to perform various aspects of the present disclosure, including, for example, the techniques and methods described with respect to FIGS. 1-6. In some aspects, the processing system 800 may correspond to an inferencing system, such as the inferencing system discussed above with reference to of FIG. 2 and / or FIG. 4. For example, the processing system 800 may correspond to a system that uses quantized machine learning models to generate inferences during runtime. Although depicted as a single system for conceptual clarity, in some aspects, as discussed above, the operations described below with respect to the processing system 800 may be distributed across any number of devices or systems.
[0141] The processing system 800 includes a central processing unit (CPU) 802, which in some examples may be a multi-core CPU. Instructions executed at the CPU 802 may be loaded, for example, from a program memory associated with the CPU 802 or may be loaded from a memory partition (e.g., a partition of memory 824) .
[0142] The processing system 800 also includes additional processing components tailored to specific functions, such as a graphics processing unit (GPU) 804, a digital signal processor (DSP) 806, a neural processing unit (NPU) 808, a multimedia component 810 (e.g., a multimedia processing unit) , and a wireless connectivity component 812.
[0143] An NPU, such as NPU 808, is generally a specialized circuit configured for implementing the control and arithmetic logic for executing machine learning algorithms, such as algorithms for processing artificial neural networks (ANNs) , deep neural networks (DNNs) , random forests (RFs) , and the like. An NPU may sometimes alternatively be referred to as a neural signal processor (NSP) , tensor processing unit (TPU) , neural network processor (NNP) , intelligence processing unit (IPU) , vision processing unit (VPU) , or graph processing unit.
[0144] NPUs, such as the NPU 808, are configured to accelerate the performance of common machine learning tasks, such as image classification, machine translation, object detection, and various other predictive models. In some examples, a plurality of NPUs may be instantiated on a single chip, such as a system on a chip (SoC) , while in other examples the NPUs may be part of a dedicated neural-network accelerator.
[0145] NPUs may be optimized for training or inference, or in some cases configured to balance performance between both. For NPUs that are capable of performing both training and inference, the two tasks may still generally be performed independently.
[0146] NPUs designed to accelerate training are generally configured to accelerate the optimization of new models, which is a highly compute-intensive operation that involves inputting an existing dataset (often labeled or tagged) , iterating over the dataset, and then adjusting model parameters, such as weights and biases, in order to improve model performance. Generally, optimizing based on a wrong prediction involves propagating back through the layers of the model and determining gradients to reduce the prediction error.
[0147] NPUs designed to accelerate inference are generally configured to operate on complete models. Such NPUs may thus be configured to input a new piece of data and rapidly process this piece of data through an already trained model to generate a model output (e.g., an inference) .
[0148] In some implementations, the NPU 808 is a part of one or more of the CPU 802, the GPU 804, and / or the DSP 806.
[0149] In some examples, the wireless connectivity component 812 may include subcomponents, for example, for third generation (3G) connectivity, fourth generation (4G) connectivity (e.g., 4G Long-Term Evolution (LTE) ) , fifth generation connectivity (e.g., 5G or New Radio (NR) ) , Wi-Fi connectivity, Bluetooth connectivity, and / or other wireless data transmission standards. The wireless connectivity component 812 is further coupled to one or more antennas 814.
[0150] The processing system 800 may also include one or more sensor processing units 816 associated with any manner of sensor, one or more image signal processors (ISPs) 818 associated with any manner of image sensor, and / or a navigation processor 820, which may include satellite-based positioning system components (e.g., GPS or GLONASS) , as well as inertial positioning system components.
[0151] The processing system 800 may also include one or more input and / or output devices 822, such as screens, touch-sensitive surfaces (including touch-sensitive displays) , physical buttons, speakers, microphones, and the like.
[0152] In some examples, one or more of the processors of the processing system 800 may be based on an ARM or RISC-V instruction set.
[0153] The processing system 800 also includes the memory 824, which is representative of one or more static and / or dynamic memories, such as a dynamic random access memory, a flash-based static memory, and the like. In this example, the memory 824 includes computer-executable components, which may be executed by one or more of the aforementioned processors of the processing system 800.
[0154] In particular, in this example, the memory 824 includes a decomposition component 824A, a multiplication component 824B, a dequantization component 824C, and an aggregation component 824D. The memory 824 further includes model parameters 824E for one or more models (e.g., quantized machine learning model 145 of FIG. 1, which includes quantized parameter sub-tensors 135 of FIG. 1) . Although not included in the illustrated example, in some aspects the memory 824 may also include other data, such as input data (e.g., to be used as input for the model (s) ) . Though depicted as discrete components for conceptual clarity in FIG. 8, the illustrated components (and others not depicted) may be collectively or individually implemented in various aspects.
[0155] The processing system 800 further comprises a decomposition circuit 826, a multiplication circuit 827, a dequantization circuit 828, and an aggregation circuit 829. The depicted circuits, and others not depicted, may be configured to perform various aspects of the techniques described herein.
[0156] For example, the decomposition component 824A and / or the decomposition circuit 826 (which may correspond to the decomposition component 210 of FIG. 2) may be used to decompose input tensors using outlier indices, as discussed above. For example, the decomposition component 824A and / or the decomposition circuit 826 may generate input sub-tensors based on the outlier indices (e.g., with a first sub-tensor that includes input elements corresponding to the outlier indices, and a second sub-tensor that includes input elements corresponding to the remaining indices or values) .
[0157] The multiplication component 824B and / or the multiplication circuit 827 (which may correspond to the multiplication component 220 of FIG. 2) may be used to multiply input sub-tensors with (quantized) parameter sub-tensors, as discussed above. For example, the multiplication component 824B and / or the multiplication circuit 827 may perform matrix multiplication between each input sub-tensor and the corresponding (quantized) parameter sub-tensor to generate a corresponding output sub-tensor.
[0158] The dequantization component 824C and / or the dequantization circuit 828 (which may correspond to the dequantization component 230 of FIG. 2) may be used to dequantize output sub-tensors, as discussed above. For example, the dequantization component 824C and / or the dequantization circuit 828 may use the quantization parameters which were used to quantize each given quantized parameter sub-tensor to dequantize the corresponding output sub-tensor.
[0159] The aggregation component 824D and / or the aggregation circuit 829 (which may correspond to the aggregation component 240 of FIG. 2) may be used to aggregate dequantized output sub-tensors, as discussed above. For example, the aggregation component 824D and / or the aggregation circuit 829 may aggregate the output sub-tensors by performing element-wise summation to generate an overall output tensor for the operation.
[0160] Though depicted as separate components and circuits for clarity in FIG. 8, the decomposition circuit 826, the multiplication circuit 827, the dequantization circuit 828, and the aggregation circuit 829 may collectively or individually be implemented in other processing devices of the processing system 800, such as within the CPU 802, the GPU 804, the DSP 806, the NPU 808, and the like.
[0161] Generally, the processing system 800 and / or components thereof may be configured to perform the methods described herein.
[0162] Notably, in other aspects, elements of the processing system 800 may be omitted, such as where the processing system 800 is a server computer or the like. For example, the multimedia component 810, the wireless connectivity component 812, the sensor processing units 816, the ISPs 818, and / or the navigation processor 820 may be omitted in other aspects. Further, aspects of the processing system 800 may be distributed between multiple devices.
[0163] Example Clauses
[0164] Implementation examples are described in the following numbered clauses:
[0165] Clause 1: A method, comprising: accessing a parameter tensor for a machine learning model; identifying a set of rows, in the parameter tensor, that each include one or more outlier values; decomposing the parameter tensor into a first parameter sub-tensor corresponding to the set of rows and a second parameter sub-tensor corresponding to at least one remaining row in the parameter tensor; quantizing the first parameter sub-tensor according to a first quantization scheme; quantizing the second parameter sub-tensor according to a second quantization scheme; and generating a quantized version of the machine learning model comprising the quantized first and second parameter sub-tensors.
[0166] Clause 2: A method according to Clause 1, wherein: the first quantization scheme comprises a first quantized bitwidth, and the second quantization scheme comprises a second quantized bitwidth smaller than the first quantized bitwidth.
[0167] Clause 3: A method according to any of Clauses 1-2, further comprising identifying the one or more outlier values comprising: determining one or more outlier criteria; and evaluating each respective value in the parameter tensor using the one or more outlier criteria.
[0168] Clause 4: A method according to Clause 3, wherein the one or more outlier criteria comprise a magnitude threshold.
[0169] Clause 5: A method according to any of Clauses 1-4, further comprising generating a set of outlier indices comprising a respective index of each respective row in the set of rows, wherein the set of outlier indices is used during inferencing to decompose input tensors.
[0170] Clause 6: A method according to Clause 5, wherein the inferencing comprises: accessing an input tensor; decomposing the input tensor into a first input sub-tensor having columns corresponding to the set of outlier indices and a second input sub-tensor corresponding to at least one remaining column in the input tensor; generating a first output sub-tensor based on multiplying the first input sub-tensor with the first parameter sub-tensor; and generating a second output sub-tensor based on multiplying the second input sub-tensor with the second parameter sub-tensor.
[0171] Clause 7: A method according to any of Clauses 5-6, wherein the inferencing further comprises: dequantizing the first and second output sub-tensors; and generating an output tensor by element-wise summing the first and second dequantized output sub-tensors.
[0172] Clause 8: A method according to any of Clauses 1-7, wherein the parameter tensor comprises weights for a matrix multiplication operation.
[0173] Clause 9: A method according to Clause 8, wherein the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.
[0174] Clause 10: A method, comprising: accessing an input tensor for a layer of a machine learning model; decomposing the input tensor into a first input sub-tensor corresponding to a set of outlier indices and a second input sub-tensor corresponding to at least one remaining element in the input tensor; generating a first output sub-tensor based on multiplying the first input sub-tensor with a first parameter sub-tensor; generating a second output sub-tensor based on multiplying the second input sub-tensor with a second parameter sub-tensor; and generating an output tensor for the layer of the machine learning model based on the first and second output sub-tensors.
[0175] Clause 11: A method according to Clause 10, wherein generating the output tensor comprises: dequantizing the first and second output sub-tensors; and element-wise summing the first and second dequantized output sub-tensors.
[0176] Clause 12: A method according to any of Clauses 10-11, wherein: the first parameter sub-tensor is quantized according to a first quantization scheme, and the second parameter sub-tensor is quantized according to a second quantization scheme.
[0177] Clause 13: A method according to Clause 12, wherein: the first quantization scheme comprises a first quantized bitwidth, and the second quantization scheme comprises a second quantized bitwidth larger than the first quantized bitwidth.
[0178] Clause 14: A method according to any of Clauses 10-13, wherein the set of outlier indices indicate a set of rows, in a nonquantized parameter tensor for the layer of the machine learning model, that each included one or more outlier values.
[0179] Clause 15: A method according to any of Clauses 10-14, wherein the first and second parameter sub-tensors comprise weights for a matrix multiplication operation.
[0180] Clause 16: A method according to Clause 15, wherein the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.
[0181] Clause 17: A processing system comprising: a memory comprising computer-executable instructions; and one or more processors configured to execute the computer-executable instructions and cause the processing system to perform a method in accordance with any of Clauses 1-16.
[0182] Clause 18: A processing system comprising means for performing a method in accordance with any of Clauses 1-16.
[0183] Clause 19: A non-transitory computer-readable medium comprising computer-executable instructions that, when executed by one or more processors of a processing system, cause the processing system to perform a method in accordance with any of Clauses 1-16.
[0184] Clause 20: A non-transitory computer-readable medium encoding logic that, when executed by a processing system, causes the processing system to perform a method in accordance with any of Clauses 1-16.
[0185] Clause 21: An apparatus comprising logic circuitry configured to perform a method in accordance with any of Clauses 1-16.
[0186] Clause 22: A computer program product embodied on a computer-readable storage medium comprising code for performing a method in accordance with any of Clauses 1-16.
[0187] Additional Considerations
[0188] The preceding description is provided to enable any person skilled in the art to practice the various aspects described herein. The examples discussed herein are not limiting of the scope, applicability, or aspects set forth in the claims. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects. For example, changes may be made in the function and arrangement of elements discussed without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For instance, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Also, features described with respect to some examples may be combined in some other examples. For example, an apparatus may be implemented or a method may be practiced using any number of the aspects set forth herein. In addition, the scope of the disclosure is intended to cover such an apparatus or method that is practiced using other structure, functionality, or structure and functionality in addition to, or other than, the various aspects of the disclosure set forth herein. It should be understood that any aspect of the disclosure disclosed herein may be embodied by one or more elements of a claim.
[0189] As used herein, the word “exemplary” means “serving as an example, instance, or illustration. ” Any aspect described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects.
[0190] As used herein, a phrase referring to “at least one of” a list of items refers to any combination of those items, including single members. As an example, “at least one of: a, b, or c” is intended to cover a, b, c, a-b, a-c, b-c, and a-b-c, as well as any combination with multiples of the same element (e.g., a-a, a-a-a, a-a-b, a-a-c, a-b-b, a-c-c, b-b, b-b-b, b-b-c, c-c, and c-c-c or any other ordering of a, b, and c) .
[0191] As used herein, the term “determining” encompasses a wide variety of actions. For example, “determining” may include calculating, computing, processing, deriving, investigating, looking up (e.g., looking up in a table, a database or another data structure) , ascertaining, and the like. Also, “determining” may include receiving (e.g., receiving information) , accessing (e.g., accessing data in a memory) , and the like. Also, “determining” may include resolving, selecting, choosing, establishing, and the like.
[0192] The methods disclosed herein comprise one or more steps or actions for achieving the methods. The method steps and / or actions may be interchanged with one another without departing from the scope of the claims. In other words, unless a specific order of steps or actions is specified, the order and / or use of specific steps and / or actions may be modified without departing from the scope of the claims. Further, the various operations of methods described above may be performed by any suitable means capable of performing the corresponding functions. The means may include various hardware and / or software component (s) and / or module (s) , including, but not limited to a circuit, an application specific integrated circuit (ASIC) , or processor. Generally, where there are operations illustrated in figures, those operations may have corresponding counterpart means-plus-function components with similar numbering.
[0193] The following claims are not intended to be limited to the aspects shown herein, but are to be accorded the full scope consistent with the language of the claims. Within a claim, reference to an element in the singular is not intended to mean “one and only one” unless specifically so stated, but rather “one or more. ” Unless specifically stated otherwise, the term “some” refers to one or more. No claim element is to be construed under the provisions of 35 U.S.C. § 112 (f) unless the element is expressly recited using the phrase “means for” or, in the case of a method claim, the element is recited using the phrase “step for. ” All structural and functional equivalents to the elements of the various aspects described throughout this disclosure that are known or later come to be known to those of ordinary skill in the art are expressly incorporated herein by reference and are intended to be encompassed by the claims. Moreover, nothing disclosed herein is intended to be dedicated to the public regardless of whether such disclosure is explicitly recited in the claims.
Claims
1.A processing system comprising:one or more memories comprising processor-executable instructions; andone or more processors configured to execute the processor-executable instructions and cause the processing system to:access a parameter tensor for a machine learning model;identify a set of rows, in the parameter tensor, that each include one or more outlier values;decompose the parameter tensor into a first parameter sub-tensor corresponding to the set of rows and a second parameter sub-tensor corresponding to at least one remaining row in the parameter tensor;quantize the first parameter sub-tensor according to a first quantization scheme;quantize the second parameter sub-tensor according to a second quantization scheme; andgenerate a quantized version of the machine learning model comprising the quantized first and second parameter sub-tensors.2.The processing system of claim 1, wherein:the first quantization scheme comprises a first quantized bitwidth, andthe second quantization scheme comprises a second quantized bitwidth smaller than the first quantized bitwidth.3.The processing system of claim 1, wherein the one or more processors are configured to further execute the processor-executable instructions to cause the processing system to identify the one or more outlier values, wherein, to identify the one or more outlier values, the one or more processors are configured to execute the processor-executable instructions to cause the processing system to:determine one or more outlier criteria; andevaluate each respective value in the parameter tensor using the one or more outlier criteria.4.The processing system of claim 3, wherein the one or more outlier criteria comprise a magnitude threshold.5.The processing system of claim 1, wherein, the one or more processors are configured to further execute the processor-executable instructions to cause the processing system to generate a set of outlier indices comprising a respective index of each respective row in the set of rows, wherein the set of outlier indices is used during inferencing to decompose input tensors.6.The processing system of claim 5, wherein, to inference, one or more second processors of an inferencing system are configured to execute second processor-executable instructions to cause the inferencing system to:access an input tensor;decompose the input tensor into a first input sub-tensor having columns corresponding to the set of outlier indices and a second input sub-tensor corresponding to at least one remaining column in the input tensor;generate a first output sub-tensor based on multiplying the first input sub-tensor with the first parameter sub-tensor; andgenerate a second output sub-tensor based on multiplying the second input sub-tensor with the second parameter sub-tensor.7.The processing system of claim 6, wherein, to inference, the one or more second processors of the inferencing system are configured to execute the second processor-executable instructions to cause the inferencing system to:dequantize the first and second output sub-tensors; andgenerate an output tensor by element-wise summing the first and second dequantized output sub-tensors.8.The processing system of claim 1, wherein the parameter tensor comprises weights for a matrix multiplication operation.9.The processing system of claim 8, wherein the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.10.A processing system comprising:one or more memories comprising processor-executable instructions; andone or more processors configured to execute the processor-executable instructions and cause the processing system to:access an input tensor for a layer of a machine learning model;decompose the input tensor into a first input sub-tensor corresponding to a set of outlier indices and a second input sub-tensor corresponding to at least one remaining element in the input tensor;generate a first output sub-tensor based on multiplying the first input sub-tensor with a first parameter sub-tensor;generate a second output sub-tensor based on multiplying the second input sub-tensor with a second parameter sub-tensor; andgenerate an output tensor for the layer of the machine learning model based on the first and second output sub-tensors.11.The processing system of claim 10, wherein, to generate the output tensor comprises, the one or more processors are configured to further execute the processor-executable instructions to cause the processing system to:dequantize the first and second output sub-tensors; andelement-wise sum the first and second dequantized output sub-tensors.12.The processing system of claim 10, wherein:the first parameter sub-tensor is quantized according to a first quantization scheme, andthe second parameter sub-tensor is quantized according to a second quantization scheme.13.The processing system of claim 12, wherein:the first quantization scheme comprises a first quantized bitwidth, andthe second quantization scheme comprises a second quantized bitwidth larger than the first quantized bitwidth.14.The processing system of claim 10, wherein the set of outlier indices indicates a set of rows, in a nonquantized parameter tensor for the layer of the machine learning model, that each included one or more outlier values.15.The processing system of claim 10, wherein the first and second parameter sub-tensors comprise weights for a matrix multiplication operation.16.The processing system of claim 15, wherein the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.17.A processor-implemented method, comprising:accessing a parameter tensor for a machine learning model;identifying a set of rows, in the parameter tensor, that each include one or more outlier values;decomposing the parameter tensor into a first parameter sub-tensor corresponding to the set of rows and a second parameter sub-tensor corresponding to at least one remaining row in the parameter tensor;quantizing the first parameter sub-tensor according to a first quantization scheme;quantizing the second parameter sub-tensor according to a second quantization scheme; andgenerating a quantized version of the machine learning model comprising the quantized first and second parameter sub-tensors.18.The processor-implemented method of claim 17, wherein:the first quantization scheme comprises a first quantized bitwidth, andthe second quantization scheme comprises a second quantized bitwidth smaller than the first quantized bitwidth.19.The processor-implemented method of claim 17, further comprising identifying the one or more outlier values, comprising:determining one or more outlier criteria; andevaluating each respective value in the parameter tensor using the one or more outlier criteria.20.The processor-implemented method of claim 19, wherein the one or more outlier criteria comprise a magnitude threshold.21.The processor-implemented method of claim 17, further comprising generating a set of outlier indices comprising a respective index of each respective row in the set of rows, wherein the set of outlier indices is used during inferencing to decompose input tensors.22.The processor-implemented method of claim 21, wherein the inferencing comprises:accessing an input tensor;decomposing the input tensor into a first input sub-tensor having columns corresponding to the set of outlier indices and a second input sub-tensor corresponding to at least one remaining column in the input tensor;generating a first output sub-tensor based on multiplying the first input sub-tensor with the first parameter sub-tensor; andgenerating a second output sub-tensor based on multiplying the second input sub-tensor with the second parameter sub-tensor.23.The processor-implemented method of claim 22, wherein the inferencing further comprises:dequantizing the first and second output sub-tensors; andgenerating an output tensor by element-wise summing the first and second dequantized output sub-tensors.24.The processor-implemented method of claim 17, wherein the parameter tensor comprises weights for a matrix multiplication operation.25.The processor-implemented method of claim 24, wherein the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.26.A processor-implemented method, comprising:accessing an input tensor for a layer of a machine learning model;decomposing the input tensor into a first input sub-tensor corresponding to a set of outlier indices and a second input sub-tensor corresponding to at least one remaining element in the input tensor;generating a first output sub-tensor based on multiplying the first input sub-tensor with a first parameter sub-tensor;generating a second output sub-tensor based on multiplying the second input sub-tensor with a second parameter sub-tensor; andgenerating an output tensor for the layer of the machine learning model based on the first and second output sub-tensors.27.The processor-implemented method of claim 26, wherein generating the output tensor comprises:dequantizing the first and second output sub-tensors; andelement-wise summing the first and second dequantized output sub-tensors.28.The processor-implemented method of claim 26, wherein:the first parameter sub-tensor is quantized according to a first quantization scheme, andthe second parameter sub-tensor is quantized according to a second quantization scheme.29.The processor-implemented method of claim 28, wherein:the first quantization scheme comprises a first quantized bitwidth, andthe second quantization scheme comprises a second quantized bitwidth larger than the first quantized bitwidth.30.The processor-implemented method of claim 26, wherein the set of outlier indices indicate a set of rows, in a nonquantized parameter tensor for the layer of the machine learning model, that each included one or more outlier values.31.The processor-implemented method of claim 26, wherein the first and second parameter sub-tensors comprise weights for a matrix multiplication operation.32.The processor-implemented method of claim 31, wherein the matrix multiplication operation is performed as part of at least one of: a feedforward operation of the machine learning model, or an attention operation of the machine learning model.