Complex number encoding for enhanced quantization accuracy
By encoding model parameters as complex numbers with optimized bitwidth allocation, the method addresses quantization errors in machine learning models, achieving improved accuracy and reduced size on resource-constrained devices.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- QUALCOMM INC
- Filing Date
- 2024-11-07
- Publication Date
- 2026-05-15
AI Technical Summary
Existing machine learning model quantization techniques introduce significant error due to approximating high-precision parameters with lower-precision values, particularly affecting models deployed on resource-constrained devices, and conventional methods to mitigate this error often result in substantial computational overhead.
Encoding model parameters as complex numbers, utilizing magnitude and phase representations, and applying optimized bitwidth allocation to minimize quantization noise, thereby improving model accuracy and reducing model size without increasing computational resources.
The proposed method reduces quantization noise and maintains or enhances model performance by encoding parameters as complex numbers, allowing for smaller yet accurate models on resource-constrained devices.
Smart Images

Figure CN2024130423_15052026_PF_FP_ABST
Abstract
Description
COMPLEX NUMBER ENCODING FOR ENHANCED QUANTIZATION ACCURACY
[0001] INTRODUCTION
[0002] Aspects of the present disclosure relate to machine learning.
[0003] A wide variety of machine learning architectures have recently been used to perform innumerable tasks with high accuracy and reliability. For example, computer vision models have been used to perform tasks such as object detection and distance prediction. As another example, language models (e.g., large language models (LLMs) ) have been used to understand and generate textual output in a human-like fashion, such as for use in chat bots. Similar architectures have been developed for other tasks (e.g., including large vision models (LVMs) , large multimodal models (LMMs) , and the like) . However, many existing model architectures are large (e.g., having thousands, millions, or even billions of parameters) . In addition to the vast computational resources used to train such models, runtime use of such large models also incurs substantial computational expense (e.g., substantial memory overhead due to the large number of parameters) .
[0004] Some conventional approaches to improve accessibility to machine learning (e.g., on edge devices with limited compute) include model quantization. Though quantization can reduce the model size substantially, quantization also introduces inherent error due to the fact that high-precision model parameters are approximated using lower-precision values.
[0005] BRIEF SUMMARY
[0006] Certain aspects of the present disclosure provide a processor-implemented method, comprising: accessing a first set of quantized encoded parameters for a machine learning model; dequantizing the first set of quantized encoded parameters to generate a first set of encoded parameters, wherein the first set of encoded parameters comprises a first magnitude and a first phase of a first complex number; generating, based on the first magnitude and the first phase, a first decoded parameter and a second decoded parameter of the machine learning model; and generating an output of the machine learning model based on an input to the machine learning model and the first and second decoded parameters.
[0007] Certain aspects of the present disclosure provide a processor-implemented method, comprising: accessing a first set of parameters, comprising a first parameter and a second parameter, for a machine learning model; generating, based on the first and second parameters, a first set of encoded parameters comprising a first magnitude and a first phase of a first complex number; quantizing the first set of encoded parameters to generate a first set of quantized encoded parameters; and storing the quantized first set of encoded parameters for subsequent operation of the machine learning model.
[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 example features of certain aspects of the present disclosure and are therefore not to be considered limiting of the scope of this disclosure.
[0011] FIG. 1 depicts an example system for enhanced quantization using complex number encodings, according to some aspects of the present disclosure.
[0012] FIG. 2 depicts an example workflow for generating quantized encoded parameters for machine learning, according to some aspects of the present disclosure.
[0013] FIG. 3 depicts an example workflow for dequantizing and decoding parameters for machine learning, according to some aspects of the present disclosure.
[0014] FIG. 4 is a flow diagram depicting an example method for generating quantized encoded parameters for machine learning, according to some aspects of the present disclosure.
[0015] FIG. 5 is a flow diagram depicting an example method for determining quantization bitwidths for encoding machine learning models, according to some aspects of the present disclosure.
[0016] FIG. 6 is a flow diagram depicting an example method for dequantizing and decoding parameters for machine learning, according to some aspects of the present disclosure.
[0017] FIG. 7 is a flow diagram depicting an example method for determining quantization bitwidths for decoding machine learning models, according to some aspects of the present disclosure.
[0018] FIG. 8 is a flow diagram depicting an example method for machine learning model encoding and quantization, according to some aspects of the present disclosure.
[0019] FIG. 9 is a flow diagram depicting an example method for machine learning model dequantization and decoding, according to some aspects of the present disclosure.
[0020] FIG. 10 depicts an example processing system configured to perform various aspects of the present disclosure.
[0021] 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
[0022] Aspects of the present disclosure provide apparatuses, methods, processing systems, and non-transitory computer-readable mediums for providing improved machine learning. Specifically, in some aspects of the present disclosure, techniques for improved model quantization using complex number encoding are presented.
[0023] Increasingly, quantization has been used as a valuable technique to reduce model size, latency, and power consumption for machine learning models. For example, these improvements are particularly useful for on-device deployment of models (such as neural networks) . That is, when machine learning models are used on relatively constrained devices (e.g., devices with limited computational resources such as memory and / or limited power, such as due to being powered by battery) , such as edge devices, user equipment (UE) , smartphones, laptops, and the like, reducing the size and expense of such models is particularly valuable (e.g., enabling such models to be deployed on devices that otherwise could not host the models) .
[0024] Generally, quantization involves approximating an original (full-precision) value using a value that can be encoded using fewer bits. For example, a model having parameters stored as sixteen-bit floating-point values may be quantized by approximating each weight using a four-bit integer. As another example, a model that represents activations (e.g., intermediate or internal values generated as input data is passed through the model) using sixteen-bit floating-point values may be quantized to represent this intermediate data using eight bits. That is, as used herein, quantizing a given operation or component of a machine learning model may include quantizing the parameters (e.g., reducing the bitwidth used to store the parameters of the operation) , quantizing the activations (e.g., reducing the bitwidth used to store the input and / or output of the operation) , or quantizing both the parameters and the activations.
[0025] Quantization introduces inherent error in model output, as approximating full-precision values using fewer bits introduces noise into the data. Generally, quantizing to smaller bitwidths (e.g., four bits) results in significant compute savings, but introduces more error than using larger bitwidths (e.g., eight bits) . For example, many machine learning models have parameters that are distributed in a similar fashion to a normal distribution, but with a relatively long tail (e.g., outlier values) . These outliers are difficult to effectively represent in quantized form (e.g., because the outliers dominate the range of the quantization, resulting in significant granularity error) . Some approaches involve removing such outliers to reduce the effective range of the quantization, but this outlier removal can also introduce substantial error.
[0026] In some aspects of the present disclosure, parameters having real values (e.g., real numbers) can be converted into complex values (e.g., including imaginary numbers) . For example, given two parameters having real values a and b, a single complex number a+bi can be defined, where i denotes the imaginary portion of the complex number. In some aspects, a complex number may be represented by the magnitude (also referred to in some aspects as the “amplitude” or “radius” ) and phase (also referred to in some aspects as the “angle” ) of the number. That is, the complex number may be effectively defined using polar coordinates on a complex plane, where the magnitude indicates the length of the vector in the complex plane and the phase indicates the angle between the positive real axis and the vector. That is, a pair of parameters having real values can be encoded as a magnitude and phase of a complex number, in some aspects.
[0027] As discussed in more detail below, in some aspects, this encoding as phase and magnitude is better suited for quantization (e.g., resulting in reduced quantization error) , as compared to the original real values. For example, complex number phases are in a range [-π, π] , and are often close to a fully uniform normal distribution. Further, given real values a and b, the magnitude of the corresponding complex number may be defined as (e.g., an aggregate value representing both real numbers) , such that the range of the magnitudes is roughly half the range of the original real values, and a large portion of the magnitudes tends to be close to zero. These complex number representations can then be effectively quantized with reduced error.
[0028] For example, using four-bit integer quantization of real parameter values, each parameter is approximated to one of sixteen values (as a four-bit integer can have sixteen discrete values) . Using complex number encodings, the phase and magnitude may each be represented using four bits, resulting in two hundred fifty-six discrete values (e.g., sixteen times sixteen) that the parameters can have. That is, quantizing real values to four bits involves representing each parameter with one of sixteen values, while quantizing the encoded parameters allows two parameters to be collectively represented using one of two hundred fifty-six values. This introduces substantially more granularity to the quantized values without introducing any additional bitwidth overhead (e.g., two real parameters are still represented using eight bits-four for the magnitude, and four for the phase) .
[0029] Further, as discussed in more detail below, in some aspects additional dimensionality may be introduced beyond two. That is, rather than a two-dimensional approach where two real value parameters are encoded using a single complex number (with a magnitude and a phase) , more than two real value parameters may be similarly encoded. For example, in a three-dimensional approach, three real values x, y, and z may be encoded as a magnitude r and two phases α and β, as discussed in more detail below. Similarly, in a four-dimensional approach, four real values x, y, z, and t may be encoded as a magnitude r and three phases α, β, and δ, as discussed in more detail below. Generally, the encoding and quantization described in the present disclosure can be readily extended to any desired dimensionality. That is, any set of N real-value parameters may be mapped to one N-dimensional complex number having a magnitude and N-1 phases.
[0030] In this way, by first encoding the parameters using complex numbers and then quantizing the encoded values, machine learning models may be quantized with substantially less quantization noise, as compared to some conventional quantization approaches. This can enable significantly improved model performance (e.g., accuracy) at the same quantization bitwidth, and / or comparable model performance at substantially reduced quantization bitwidths. That is, using certain aspects of the present disclosure, a quantized machine learning model may be the same size but substantially more accurate as compared to a conventionally quantized model, or may be similarly accurate but substantially smaller in size (e.g., a smaller memory footprint) as compared to a conventionally quantized model.
[0031] Example System for Enhanced Quantization Using Complex Number Encodings
[0032] FIG. 1 depicts an example system 100 for enhanced quantization using complex number encodings, according to some aspects of the present disclosure.
[0033] In the illustrated example, a machine learning model 105 is accessed by a quantization system 110 to generate a quantized machine learning model 125. As used herein, “accessing” data may generally include receiving, retrieving, generating, collecting, obtaining, requesting, or otherwise gaining access to the data. For example, the quantization system 110 may receive the machine learning model 105 from another system or component (e.g., a training server) , or the quantization system 110 may train the machine learning model 105 locally. Although depicted as a discrete system for conceptual clarity, in some aspects, the quantization system 110 may be implemented using any combination of hardware and software and across any number of systems or components.
[0034] The machine learning model 105 is generally representative of a trained model (e.g., a model comprising a set of parameters, such as weights, biases, and the like, having values that were learned during training of the machine learning model 105) . Generally, the machine learning model 105 may use any architecture, including a neural network, a diffusion model, a transformer-based model, and the like, depending on the particular implementation. The quantized machine learning model 125 is generally representative of the machine learning model 105 with the parameters of the model encoded and quantized, as discussed above and in more detail below.
[0035] In the illustrated example, the quantization system 110 includes an encoding component 115 and a quantization component 120. Although depicted as discrete components for conceptual clarity, in some aspects, the operations of the depicted components (and others not illustrated) may be combined or distributed across any number of components, and may generally be implemented using hardware, software, or a combination of hardware and software.
[0036] In some aspects, the encoding component 115 may be used to encode the parameters of the machine learning model 105 using complex numbers, as discussed above. For example, the encoding component 115 may select a group of parameters (e.g., a pair of parameters in a two-dimensional encoding, three parameters for a three-dimensional encoding, and the like) from the machine learning model 105 and encode the group using one or more complex numbers (e.g., using a magnitude and one or more phases) , as discussed in more detail below. This encoding may be performed for any arbitrary group of parameters (e.g., the parameters in a given group need not have any relationship or association in the model architecture) . In this way, the encoding component 115 can encode the parameters of the model using a set of complex numbers.
[0037] In some aspects, the quantization component 120 may then be used to quantize the encoded parameters. For example, in some aspects, the quantization component 120 may quantize each encoded parameter to a designated bitwidth (e.g., four bits) , as discussed above. In some aspects, rather than using an equal bitwidth encoding (where all encoded parameters are quantized to the same bitwidth, such as four-bit integer) , the quantization component 120 may use a different bitwidth allocation depending on the signal-to-quantization-noise ratio (SQNR) introduced by various allocations.
[0038] In some aspects, the quantization component 120 may use a designated number of bits to represent each complex number. For example, to match four-bit integer quantization of real values, the quantization component 120 may allocate four bits for each parameter. That is, for a group of parameters, the quantization component 120 may allocate four bits per parameter in the group to be used to quantize the resulting encoded parameters (e.g., allowing a total of eight bits for a complex number having a magnitude and a single phase, twelve bits for a complex number having a magnitude and two phases, and so on) .
[0039] In some aspects, rather than allocating an equal number of bits to each encoded parameter (e.g., four bits for the magnitude and four bits for each phase) , the quantization component 120 may allocate a different number of bits (e.g., based on testing and experimentation regarding the impact on SQNR of various allocations) . For example, in some aspects, the magnitude value may be quantized using relatively more bits (e.g., five, six, or seven bits) while the phase (s) are quantized using relatively fewer bits (e.g., two or three bits) . As one example, given a magnitude and two phases, the quantization component 120 my quantize the magnitude to six bits, the first phase to four bits, and the second phase to two bits. In some aspects, as discussed in more detail below, the second and subsequent phases (in a three-dimensional or more encoding) may be associated with or defined by fewer parameters of the group of real value parameters (as compared to the earlier phase (s) ) . The magnitude may be defined based on all parameters in the group. Therefore, allocating additional bits to the magnitude and / or earlier phases and fewer bits to the subsequent phases may improve SQNR, as the more impactful encoded parameters are quantized to higher bitwidths.
[0040] In some aspects, in addition to or instead of using a fixed or static bit allocation scheme, the quantization component 120 may generate dynamic bitwidth allocations for each set of encoded parameters, as discussed in more detail below.
[0041] As illustrated, once each group of encoded parameters is quantized, the quantization system 110 can output or provide the quantized machine learning model 125. In the illustrated example, the quantized machine learning model 125 is accessed by a machine learning system 130. Although depicted as a discrete system for conceptual clarity, in some aspects, the machine learning system 130 may be implemented using any combination of hardware and software and across any number of systems or components. For example, in some aspects, the quantization system 110 and the machine learning system 130 may be implemented as a single system (which may or may not be the same system that trains the model, and / or may or may not be the same system that uses the quantized model for runtime inferencing or output generation) .
[0042] In the illustrated example, the machine learning system 130 includes a dequantization component 135, a decoding component 140, and an inferencing component 145. Although depicted as discrete components for conceptual clarity, in some aspects, the operations of the depicted components (and others not illustrated) may be combined or distributed across any number of components, and may generally be implemented using hardware, software, or a combination of hardware and software.
[0043] Generally, the dequantization component 135 may be used to dequantize the quantized encoded parameters of the quantized machine learning model 125 (e.g., to generate encoded parameters) during runtime. For example, while processing data (e.g., the input 150) using the quantized machine learning model 125, the dequantization component 135 may dynamically dequantize the parameters of the model as these parameters are used (e.g., for each layer as the input 150 passes through the model) . In some aspects, as discussed above, the dequantization component 135 may dequantize the parameters based on a known (e.g., static or fixed) bitwidth allocation. That is, the dequantization component 135 may know the allocation of bits used by the quantization component 120, allowing the dequantization component 135 to accurately dequantize each component of each group of encoded parameters (e.g., the magnitude and phase (s) of each) . In some aspects, as discussed in more detail below, the dequantization component 135 may dynamically determine or infer the bitwidth allocations.
[0044] In the illustrated example, the decoding component 140 may be used to decode the encoded parameters (after being dequantized by the dequantization component 135) . For example, the decoding component 140 may convert or transform each set of encoded parameters (e.g., a magnitude and one or more phases for a complex number) to a corresponding set or group of real values (e.g., two parameters for a two-dimensional encoding, three parameters for a three-dimensional encoding, and the like) , as discussed in more detail below.
[0045] As illustrated, the inferencing component 145 may then use the dequantized and decoded parameters to process the input 150 (e.g., using matrix multiplication or other machine learning operations, as defined by the architecture of the quantized machine learning model 125) . In this way, the machine learning system 130 may maintain a relatively small quantized machine learning model 125 (e.g., with a relatively small memory footprint) , dynamically dequantizing and decoding parameters as these parameters are used to process the input 150. As illustrated, the output of the final component (e.g., the last layer) of the quantized machine learning model 125 can then be provided as output 155 of the machine learning model. For example, the machine learning system 130 may output the output 155 to an entity (e.g., a user, system, or component) that provided the input 150 and / or requested the output 155, and / or to one or more downstream components or systems, depending on the particular implementation.
[0046] In various aspects, the generated output 155 may be used in any suitable task, such as (without limitation) text generation (e.g., use in chat bots) , language processing, image classification, object detection, and the like.
[0047] In these ways, the quantization system 110 can effectively generate an improved quantized machine learning model 125 that has reduced quantization noise, and the machine learning system 130 can efficiently dequantize and decode the quantized model to generate model output 155 using fewer computational resources and / or improved accuracy, as compared to some conventional approaches.
[0048] Example Workflow for Generating Quantized Encoded Parameters for Machine Learning
[0049] FIG. 2 depicts an example workflow 200 for generating quantized encoded parameters for machine learning, according to some aspects of the present disclosure. In some aspects, the workflow 200 may be performed by a quantization system, such as the quantization system 110 of FIG. 1.
[0050] In the illustrated workflow 200, a set of parameters 205A-N (collectively, parameters 205) are accessed by the encoding component 115. In some aspects, as discussed above, the parameters 205 may be referred to as a set or group of parameters that are to be encoded jointly using a single complex number (which may have any dimensionality) . In some aspects, as discussed above, the dimensionality of the complex number may match the size of the set of parameters 205 (e.g., where two parameters 205 are encoded using a two-dimensional complex number, three parameters 205 are encoded using a three-dimensional complex number, and so on) . In the illustrated example, each set of parameters 205 may include at least two real values: a first parameter 205A and a second parameter 205B. Each set of parameters 205 may optionally include additional parameters (e.g., the parameter 205N) depending on the particular implementation. As discussed above, each set of parameters 205 may generally be defined using any technique or operation, including randomly or arbitrarily. That is, the particular way in which the parameters 205 are allocated to groups may have no association as to how the parameters are related (or not related) in the model architecture.
[0051] As discussed above, the encoding component 115 may then encode the set of parameters 205 to a complex number having a magnitude 210 and at least one phase 215A-N (collectively, phases 215) . In some aspects, the magnitude 210 and phase (s) 215 may collectively be referred to as “encoded parameters. ” In some aspects, as discussed above, a single complex number may be referred to as having a magnitude and multiple phases (e.g., the magnitude 210 and the phases 215A and 215N) . In some aspects, the encoded parameters may instead be conceptualized as a set of complex numbers having a shared magnitude (e.g., a first complex number having the magnitude 210 and a phase 215A, and a second complex number having the same magnitude 210 and a phase 215N) .
[0052] Generally, the encoding component 115 may use a variety of techniques to generate the encoded parameters. For example, in some aspects, the magnitude 210 of the set of parameters 205 may be defined using Equation 1 below, where r is the magnitude, N is the size of the set of parameters 205, and ni is the i-th parameter of the set of parameters 205.
[0053] For example, if the set of parameters 205 includes two parameters (e.g., the parameter 205A represented as x and the parameter 205B represented as y) , the magnitude 210 may be defined as As another example, if the set of parameters 205 further includes a third parameter 205N (represented as z) , the magnitude 210 may be defined as As yet another example, if the set of parameters 205 further includes a fourth parameter (represented as t) , the magnitude 210 may be defined as
[0054] In some aspects, the encoding component 115 may generate the phase (s) 215 based at least in part on the generated magnitude 210 for the set of parameters 205. For example, in some aspects, if a two-dimensional encoding is used, the encoding component 115 may generate a single phase 215A using Equation 2 and / or 3 below, where α is the phase 215A, arccos is the inverse cosine (also referred to as arccosine or cos-1) trigonometric function, arcsin is the inverse sine (also referred to as arcsine or sin-1) trigonometric function, x is the parameter 205A, y is the parameter 205B, and r is the magnitude 210. α=arccos (x / r) (2) α=arcsin (y / r) (3)
[0055] Though Equations 2 and 3 use arccosine and arcsine to process the first and second parameters 205A and 205B, respectively, the encoding component 115 may generally use either inverse trigonometric function in conjunction with either of the parameters 205A and 205B to generate the phase 215A.
[0056] As another example, in some aspects, if a three-dimensional encoding is used, the encoding component 115 may generate a first phase 215A using Equation 4 below and a second phase 215N using Equation 5 and / or Equation 6 below, where α is the first phase 215A, β is the second phase 215N, arccos is the inverse cosine (also referred to as arccosine) trigonometric function, arcsin is the inverse sine (also referred to as arcsine) trigonometric function, x is the parameter 205A, y is the parameter 205B, z is the parameter 205N, and r is the magnitude 210. α=arcsin (z / r) (4) β=arcsin (y / r*cos (α) ) (5) β=arccos (x / r*cos (α) ) (6)
[0057] Though Equations 4, 5 and 6 use specific trigonometric functions to generate the phases 215A-N (e.g., using arcsine to generate the phase 215A) , the encoding component 115 may generally use any combination of trigonometric functions in conjunction with the parameters 205 to generate each of the phases 215A-N.
[0058] As yet another example, in some aspects, if a four-dimensional encoding is used, the encoding component 115 may generate a first phase 215 using Equation 4 above, a second phase 215 using Equation 5 and / or Equation 6 above, and a third phase 215 using Equation 7 and / or Equation 8 below, where δ is the fourth phase 215, and t is the fourth parameter 205. δ=arccos (x / r*cos (α) *cos (β) ) (7) δ=arcsin (y / r*cos (α) *cos (β) ) (8)
[0059] Though Equations 7 and 8 use specific trigonometric functions to generate third the phases 215 (e.g., using arcsine in conjunction with the parameter y and arccosine in conjunction with the parameter x) , the encoding component 115 may generally use any combination of trigonometric functions in conjunction with the parameters 205 to generate each of the phases 215.
[0060] In the illustrated example, the encoded parameters (e.g., the magnitude 210 and the phase (s) 215) are then accessed by the quantization component 120. The quantization component 120 quantizes the encoded parameters to generate the quantized encoded parameters 220 (e.g., parameters of the quantized machine learning model 125 of FIG. 1) . In some aspects, as discussed above, the quantization component 120 may quantize the encoded parameters to fixed or static bitwidths (e.g., defined as hyperparameters) , such as four bits for each encoded parameter, or a different number of bits for each parameter (e.g., with more bits for the magnitude 210 than the phase (s) 215) .
[0061] In some aspects, the quantization component 120 may use a dynamic phase bit allocation operation to dynamically determine the number of bits to allocate to each quantized phase 215. For example, in some aspects, the quantization component 120 may first determine or select a set of complex numbers (e.g., multiple sets of encoded parameters, each corresponding to a set of real value parameters 205) as a dynamic phase bit group, where phases 215 of the complex numbers in the dynamic phase bit group can be dynamically assigned differing bitwidths for quantization. In some aspects, each dynamic phase bit group may generally be defined using any technique or operation, including randomly or arbitrarily. That is, the particular way in which the complex numbers are allocated to groups may have no association as to how the complex numbers and / or corresponding parameters are related (or not related) in the model architecture. Generally, the size of each dynamic phase bit group may also vary (e.g., the number of complex numbers in each group may be defined as a hyperparameter) .
[0062] In some aspects, the quantization component 120 may determine the overall bit budget for the group of encoded parameters (e.g., the number of bits to be used to quantize the encoded parameters) . For example, if the desired number of bits per parameter is defined as a hyperparameter B (e.g., four bits per parameter 205) , the number of bits allocated to each set of encoded parameters may be defined as B*N, where N is the number of parameters 205 in the group. Further, if S complex numbers (e.g., S sets of encoded parameters, each having a respective magnitude and one or more phases) are included in the dynamic phase quantization group, the quantization component 120 may determine that a total of M=B*N*S bits are available for allocation among the encoded parameters in the group.
[0063] In some aspects, the quantization component 120 may allocate a fixed bitwidth (e.g., defined as a hyperparameter) to each magnitude 210 in the dynamic phase bit group. For example, the quantization component 120 may allocate A bits to each of the magnitudes 210, resulting in a total of S*A bits (of M bits total) being allocated. The quantization component 120 may then perform an optimization operation to allocate the remaining M-S*A bits to the phase (s) of each complex number in the group.
[0064] In some aspects, to perform this optimization, the quantization component 120 may generate a quantization loss vector indicating the expected or predicted quantization error introduced for each candidate bitwidth of a set of K bitwidths. For example, the gain achieved by increasing the bitwidth by one bit may be defined as Gk=Ek-Ek+1, where Gk is the k-th element of the quantization loss vector G and Ek is the expected error corresponding to a bitwidth of k. In some aspects, Ek is defined based on average Euclidean distance using Equation 9 below:
[0065] For example, in some aspects, for K=5 (e.g., for five bitwidths {0, 1, 2, 3, 4, 5} ) , the quantization component 120 may generate a quantization loss vector G having a length of five. In some aspects, as the phases can generally be assumed to follow a uniform distribution, the quantization loss vector may be pre-computed offline. That is, the quantization loss vector may not depend on the particular values of any of the encoded parameters, and may therefore be pre-computed and saved for use during any subsequent dynamic phase bit allocation and / or dequantization, as discussed below.
[0066] In some aspects, given the quantization loss vector G and the set of magnitudes 210 in the dynamic phase bit group (represented as a vector V having a length of S) , the quantization component 120 can compute a Kronecker product by multiplying the vector G with the vector V to generate a gain matrix Q=kron (V, G) .
[0067] In some aspects, the quantization component 120 may then sort or order the elements in Q by magnitude (e.g., generating an ordered sequence of elements in the gain matrix) , and may begin allocating bits to the phases 215 (from the M-S*A bits remaining for the group) based on the ordering.
[0068] For example, suppose S=3 (e.g., each dynamic phase bit group has three complex numbers) , N=2 (e.g., two-dimensional encoding is used) , B=4 (e.g., the quantization component 120 seeks to allocate an average of four bits for each parameter 205 represented by the group) , and A=4 (e.g., each magnitude is allocated a fixed bitwidth of four bits) . In some aspects, the total bit budget for the group is 3*2*4=24 bits. As 4*3=12 bits are allocated to the three magnitudes (four for each) , twelve bits remain to be allocated among the three phases (one phase for each complex number in the group) .
[0069] Suppose further that the quantization loss vector (which may be precomputed offline) is G= (0.3, 0.2, 0.15, 0.12) and the magnitude vector V= (7, 6.5, 5) . The gain matrix Q may then be defined as below, where the elements in the first row correspond to the first magnitude in the vector V (e.g., the magnitude with a value of 7) , the elements in the second row correspond to the second magnitude in the vector V (e.g., with a value of 6.5) , and the elements in the third row correspond to the third magnitude in the vector V (e.g., with a value of 5) .
[0070] In this example, the ordered set of elements from the gain matrix Q is then defined as {2.1, 1.95, 1.5, 1.4, 1.3, 1.05, 1.0, 0.975, 0.84, 0.78, 0.75, 0.60} . In some aspects, the quantization component 120 may initially allocate a single bit to each of the three phases 215. The quantization component 120 may then use the ordered set of elements to allocate the remaining nine bits. For example, the quantization component 120 may allocate one bit to the first complex number because the largest value in the gain matrix is 2.1 (corresponding to the magnitude 7, which corresponds to the first complex number) , one bit to the second complex number (for the element having a value of 1.95) , one bit to the third complex number (for the element having a value of 1.5) , a second bit to the first complex number (for the element having a value of 1.4) , and so on.
[0071] In this example, after allocating all available bits, the quantization component 120 will have allocated a total of five bits to the phase of the first complex number, four bits to the phase of the second complex number, and three bits to the phase of the third complex number. The quantization component 120 may then quantize the magnitudes 210 and phases 215 to the allocated or assigned bitwidths. This process can be performed separately (e.g., sequentially or in parallel) for each dynamic phase bit group.
[0072] As discussed in more detail below, the above process can be readily reversed to determine the dynamic bitwidths and dequantize the encoded parameters. In the illustrated example, the quantized encoded parameters 220 can then be provided for runtime use.
[0073] Example Workflow for Dequantizing and Decoding Parameters for Machine Learning
[0074] FIG. 3 depicts an example workflow 300 for dequantizing and decoding parameters for machine learning, according to some aspects of the present disclosure. In some aspects, the workflow 300 may be performed by a machine learning system, such as the machine learning system 130 of FIG. 1. In some aspects, the workflow 300 generally corresponds to the inverse of the workflow 200.
[0075] In the illustrated example, the quantized encoded parameters 220 are first accessed by the dequantization component 135. The dequantization component 135 dequantizes the quantized encoded parameters to generate a set of encoded parameters (e.g., a magnitude 210 and a set of one or more phases 215) , as discussed above. In some aspects, if the quantization bitwidth of each parameter is known (e.g., if a fixed or static allocation is used) , the dequantization component 135 may use this known allocation to extract the relevant set of bits for each encoded parameter and dequantize the encoded parameters accordingly.
[0076] In some aspects, if a dynamic allocation is used, the dequantization component 135 may first determine or infer the bit allocations as discussed above. For example, as the number of bits used to quantize each magnitude in the dynamic phase bit group may be fixed (e.g., A=4) , the dequantization component 135 may readily dequantize the magnitudes to generate the vector V. Further, as discussed above, the quantization loss vector G may be computed offline and saved (e.g., provided by the quantization system, or computed by the machine learning system) . Therefore, the dequantization component 135 may generate the gain matrix Q as the Kronecker product of V and G as discussed above, and may then allocate or assign bits to each phase based on the ordering of the elements in the matrix Q. In this way, the dequantization component 135 may determine the bit allocation for each phase in the group. Using this determined allocation, the dequantization component 135 can then extract and dequantize each phase 215.
[0077] In some aspects, as discussed above, the workflow 300 may use any number of phases 215 for each complex sample, depending on the particular implementation (e.g., as indicated by the quantization system) . As illustrated, the magnitude 210 and phase (s) 215 are then accessed by the decoding component 140, which decodes the encoded parameters to generate the parameters 205A-N.
[0078] Generally, the decoding component 140 may use a variety of techniques to decode the parameters 205. For example, in some aspects, if a two-dimensional encoding is used (with a magnitude 210 and a single phase 215A) , the decoding component 140 may use Equations 10 and 11 below, where x is the first parameter (e.g., the parameter 205A) , y is the second parameter (e.g., the parameter 205B) , r is the magnitude 210, and α is the phase 215A. In some aspects, the Equations 10 and 11 may be derived from the Equations 2 and 3, respectively (or vice versa) . x=r*cos (α) (10) y=r*sin (α) (11)
[0079] Though Equations 10 and 11 use specific trigonometric functions to generate the parameters 205A-B (e.g., using cosine to generate the parameter 205A and sine to generate the parameter 205B) , the decoding component 140 may generally use any combination of trigonometric functions to generate each of the parameters 205.
[0080] As another example, in some aspects, if a three-dimensional encoding is used (with a magnitude 210 and two phases 215A and 215N) , the decoding component 140 may use Equations 12, 13, and 14 below, where x is the first parameter (e.g., the parameter 205A) , y is the second parameter (e.g., the parameter 205B) , z is the third parameter 205N, r is the magnitude 210, α is the first phase 215A, and β is the second phase 215N. In some aspects, the Equations 12 and 13 may be derived from the Equations 5 and 6, respectively (or vice versa) , and the Equation 14 may derived from the Equation 4 (or vice versa) . x=r*cos (α) *cos (β) (12) y=r*cos (α) *sin (β) (13) z=r*sin (α) (14)
[0081] Though Equations 12, 13, and 14 use specific combinations of trigonometric functions to generate the parameters 205A-N, the decoding component 140 may generally use any combination of trigonometric functions to generate each of the parameters 205.
[0082] As yet another example, in some aspects, if a four-dimensional encoding is used (with a magnitude 210 and three phase 215) , the decoding component 140 may use Equations 15, 16, 17, and 18 below, where x is the first parameter (e.g., the parameter 205A) , y is the second parameter (e.g., the parameter 205B) , z is the third parameter 205N, t is the fourth parameter, r is the magnitude 210, α is the first phase 215A, β is the second phase 215N, and δ is the third phase. In some aspects, the Equations 15 and 16 may be derived from the Equations 7 and 8, respectively (or vice versa) . x=r*cos (α) *cos (β) *cos (δ) (15) y=r*cos (α) *cos (β) *sin (δ) (16) z=r*cos (α) *sin (β) (17) t=r*sin (α) (18)
[0083] Though Equations 15, 16, 17, and 18 use specific combinations of trigonometric functions to generate the parameters 205, the decoding component 140 may generally use any combination of trigonometric functions to generate each of the parameters 205.
[0084] In the illustrated workflow 300, the decoded parameters 205 may then be used to process data using the machine learning model (e.g., to process the input 150 of FIG. 1) in order to generate model output (e.g., the output 155 of FIG. 1) . As discussed above, the use of complex number encodings combined with quantization can substantially improve the granularity of the quantized encoded parameters 220, resulting in reduced quantization loss and improved model performance without sacrificing model size.
[0085] Example Method for Generating Quantized Encoded Parameters for Machine Learning
[0086] FIG. 4 is a flow diagram depicting an example method 400 for generating quantized encoded parameters for machine learning, according to some aspects of the present disclosure. In some aspects, the method 400 is performed by a quantization system, such as the quantization system 110 of FIG. 1. In some aspects, the method 400 provides additional detail for the workflow 200 of FIG. 2.
[0087] At block 405, the quantization system accesses a set of model parameters (e.g., the parameters of the machine learning model 105 of FIG. 1 and / or the parameters 205 of FIG. 2) . As discussed above, the model parameters may generally correspond to trained parameters having values learned during a training phase for the machine learning model. In some aspects, these parameters comprise or correspond to real values with a relatively high precision (e.g., encoded in sixteen-bit floating-point format) .
[0088] At block 410, the quantization system selects a subset of model parameters (also referred to in some aspects as a set of parameters and / or a group of parameters) from the model (e.g., the set of parameters 205 of FIG. 2) . In some aspects, as discussed above, the quantization system may use a variety of operations to select the parameters, including random or pseudo-random selection. The selected set of parameters may be encoded as a corresponding complex number, as discussed above. Generally, the number of parameters selected at block 410 may depend on the particular encoding scheme used. For example, as discussed above, the quantization system may select pairs of parameters in a two-dimensional encoding scheme, three parameters per group in a three-dimensional scheme, and so on.
[0089] At block 415, the quantization system generates a complex number comprising a set of encoded values (e.g., the encoded parameters discussed above, such as the magnitude 210 and one or more phases 215 of FIG. 2) based on the selected set of model parameters. Generally, the particular operations used to generate the encoded values may vary depending on the particular implementation and / or encoding scheme used. For example, if two-dimensional encodings are used, the quantization system may use the Equations 1, 2, and / or 3 to generate a magnitude and a phase. As another example, if three-dimensional encodings are used, the quantization system may use the Equations 1, 4, 5, and / or 6 to generate a magnitude and two phases. If four-dimensional encodings are used, the quantization system may use the Equations 1, 4, 5, 6, 7, and / or 8 to generate a magnitude and three phases.
[0090] At block 420, the quantization system determines whether there are any additional set (s) of model parameters remaining to be encoded. For example, the quantization system may determine whether all parameters in the machine learning model have been transformed to complex values, and / or whether a sufficient number of parameters remain to form a full encoding group (e.g., whether at least three parameters remain for a three-dimensional implementation, at least two parameters remain for a two-dimensional implementation, and the like) .
[0091] If one or more set (s) of parameters remain, the method 400 returns to block 410. Although the illustrated example depicts a sequential process (e.g., encoding each set of parameters in sequence) for conceptual clarity, in some aspects, some or all of the parameters may be encoded entirely or partially in parallel. If all parameters have been encoded, the method 400 continues to block 425. At block 425, the quantization system determines the bitwidth (s) that should be used to quantize each of the encoded values. For example, as discussed above, the quantization system may use a fixed allocation, such as four bits for each encoded parameter, or six bits for the magnitudes and three bits each phase. In some aspects, as discussed above, the quantization system may dynamically allocate bitwidths for each phase parameter (e.g., using the gain matrix Q) . One example technique for dynamic bitwidth allocation is discussed in more detail below with reference to FIG. 5.
[0092] At block 430, the quantization system quantizes the encoded model parameters according to the determined bitwidth allocations, as discussed above (e.g., to generate the quantized encoded parameters 220 of FIG. 2) . In this way, as discussed above, the quantization system may allow the parameters of the machine learning model to be represented in a compact and efficient format (e.g., a small memory footprint, such as equivalent or comparable to a four-bit integer quantization of real values) while reducing quantization noise and maintaining model performance (as compared to conventionally quantized models of similar size) .
[0093] Example Method for Determining Quantization Bitwidths for Encoding Machine Learning Models
[0094] FIG. 5 is a flow diagram depicting an example method 500 for determining quantization bitwidths for encoding machine learning models, according to some aspects of the present disclosure. In some aspects, the method 500 is performed by a quantization system, such as the quantization system 110 of FIG. 1. In some aspects, the method 500 provides additional detail for block 425 of FIG. 4.
[0095] At block 505, the quantization system selects a dynamic phase bit group. In some aspects, as discussed above, the quantization system may use a variety of operations to select the complex numbers included in the dynamic phase bit group, including random or pseudo-random selection. The selected set of complex numbers may each be represented as a respective set of encoded parameters, as discussed above. Generally, the number of complex samples selected at block 505 may depend on the particular quantization scheme used. For example, as discussed above, the quantization system may select S samples to be dynamically quantized together.
[0096] At block 510, the quantization system allocates bits for the magnitude values (e.g., the magnitudes 210 of FIG. 2) included in the dynamic phase bit group. For example, as discussed above, each magnitude in the vector V may be allocated a fixed or predefined bitwidth, such as four bits.
[0097] At block 515, the quantization system generates or accesses a quantization loss vector (e.g., G) . In some aspects, as discussed above, the quantization loss vector may be generated offline (by the quantization system or by another system) and may then be used (or reused) for each dynamic phase bit group.
[0098] At block 520, the quantization system generates a gain matrix Q based on the quantization loss vector G and the vector V of magnitude values, such as by Kronecker multiplying the vectors V and G.
[0099] At block 525, the quantization system generates an ordered list of elements from the gain matrix (e.g., based on the magnitude of each element in decreasing order) . In some aspects, as discussed above, the quantization system may initially allocate a defined minimum number of bits to each phase or complex number (e.g., at least one bit for each phase) . Remaining bits may be allocated based on the ordered list.
[0100] At block 530, the quantization system determines whether at least one additional bit remains in the budget for allocation. For example, as discussed above, the quantization system may determine that M total bits are available to quantize the S complex numbers, and that A*N bits have already been used to quantize the magnitudes (as well as S or more bits set aside to establish the minimum bitwidth of each phase, in some aspects) . The quantization system may then determine the number of bits that remain to be allocated.
[0101] If at least one bit remains to be allocated, the method 500 continues to block 535, where the quantization system allocates one additional bit to the bitwidth of a given phase value (from the dynamic phase bit group) based on the ordered list. For example, as discussed above, the quantization system may allocate one bit to the phase that corresponds to the highest value in the ordered list. The quantization system may then remove this element from the list and decrement the number of available bits, and the method 500 may return to block 530.
[0102] If, at block 530, the quantization system determines that all available bits have been allocated, the method 500 terminates at block 540. As discussed above, the quantization system can then quantize the magnitudes and / or phases the group based on the dynamically determined bitwidth allocations. Although the illustrated example depicts a sequential process (e.g., allocating individual bits in sequence) for conceptual clarity, in some aspects, some or all of the bits may be allocated in groups and / or entirely or partially in parallel.
[0103] Example Method for Dequantizing and Decoding Parameters for Machine Learning
[0104] FIG. 6 is a flow diagram depicting an example method 600 for dequantizing and decoding parameters for machine learning, according to some aspects of the present disclosure. In some aspects, the method 600 is performed by a machine learning system, such as the machine learning system 130 of FIG. 1. In some aspects, the method 600 provides additional detail for the workflow 300 of FIG. 3.
[0105] At block 605, the machine learning system accesses a set of quantized encoded model parameters (e.g., the quantized machine learning model 125 of FIG. 1 and / or the quantized encoded parameters 220 of FIG. 2) . As discussed above, the quantized encoded model parameters may generally correspond to trained parameters having values learned during a training phase for a machine learning model. In some aspects, these quantized encoded model parameters correspond to or comprise quantized complex values in a relatively smaller bitwidth, as compared to full-precision bitwidths used to train the model.
[0106] At block 610, the machine learning system determines the bitwidth (s) that were used to quantize each of the quantized encoded values. For example, as discussed above, if the quantization system uses a fixed allocation (such as four bits for each encoded parameter) , the machine learning system may determine this fixed assignment. In some aspects, as discussed above, the quantization system may dynamically allocate bitwidths for each phase parameter. In such cases, the machine learning system may use a similar technique to determine the dynamic bitwidths at runtime. One example technique for determining the dynamic bitwidth allocation is discussed in more detail below with reference to FIG. 7.
[0107] At block 615, the machine learning system extracts and dequantizes the quantized encoded model parameters (to generate a set of encoded parameters, such as magnitudes 210 and phases 215 of FIG. 3) according to the determined bitwidth allocations, as discussed above.
[0108] At block 620, the machine learning system selects a subset of the encoded model parameters (also referred to in some aspects as a set of encoded parameters and / or a group of encoded parameters) from the encoded parameters (e.g., a magnitude 210 and phase (s) 215 of FIG. 3 corresponding to a single complex number or sample) . The selected set of encoded parameters may be encoded as a corresponding complex number, as discussed above. Generally, the number of phase (s) included in the sample may depend on the particular encoding scheme used. For example, as discussed above, the set of encoded parameters may include one magnitude and one phase in a two-dimensional encoding scheme, one magnitude and two phases in a three-dimensional scheme, and so on.
[0109] At block 625, the machine learning system generates decoded model parameters (e.g., the parameters 205 of FIG. 3) based on the selected set of encoded model parameters (e.g., the selected complex number) . Generally, the particular operations used to decode the values may vary depending on the particular implementation and / or encoding scheme used. For example, if two-dimensional encodings are used, the machine learning system may use the Equations 10 and / or 11 to generate two real value parameters. As another example, if three-dimensional encodings are used, the machine learning system may use the Equations 12, 13, and / or 14 to generate three real value parameters. If four-dimensional encodings are used, the machine learning system may use the Equations 15, 16, 17, and / or 18 to generate four real value parameters.
[0110] At block 630, the machine learning system determines whether there are any additional set (s) of encoded model parameters remaining to be decoded. For example, the machine learning system may determine whether all parameters of the current model component (e.g., the layer or block currently being used to process the input data) have been decoded. If one or more set (s) of encoded parameters remain, the method 600 returns to block 620. If all parameters for the current black have been decoded, the method 600 continues to block 635. Although the illustrated example depicts a sequential process (e.g., decoding each set of encoded parameters in sequence) for conceptual clarity, in some aspects, some or all of the parameters may be decoded entirely or partially in parallel.
[0111] At block 635, the machine learning system generates model output based on the decoded model parameters. Although the illustrated example depicts generation of model output at block 635, in some aspects, the machine learning system may use the decoded parameters to generate the output of a given component or block of the model (e.g., the output of a transformer or layer of a network) . The decoded parameters may then be discarded, and the machine learning system may proceed to dequantize and decode the parameters of the next component of the model. The output generated at block 635 may then be used as input to this next block, and so on until all such components have been used and a final model output (e.g., the output 155 of FIG. 1) is generated.
[0112] In various aspects, the generated model output may be used in any suitable task, such as (without limitation) text generation (e.g., use in chat bots) , language processing, image classification, object detection, and the like.
[0113] In this way, as discussed above, the machine learning system may effectively generate high accuracy outputs (e.g., with reduced quantization error) while maintaining the parameters of the machine learning model in a compact and efficient format (e.g., relying on a small memory footprint and other computational resources, as compared to conventional approaches) .
[0114] Example Method for Determining Quantization Bitwidths for Decoding Machine Learning Models
[0115] FIG. 7 is a flow diagram depicting an example method 700 for determining quantization bitwidths for decoding machine learning models, according to some aspects of the present disclosure. In some aspects, the method 700 is performed by a machine learning system, such as the machine learning system 130 of FIG. 1. In some aspects, the method 700 provides additional detail for block 610 of FIG. 6.
[0116] At block 705, the machine learning system accesses a quantization loss vector (e.g., G) . In some aspects, as discussed above, the quantization loss vector may be generated offline (by the machine learning system, the quantization system, or by another system) and may then be used (or reused) during runtime use of the model.
[0117] At block 710, the machine learning system dequantizes the magnitude values of a given dynamic phase bit group. For example, as discussed above, the magnitudes may be quantized using a known (e.g., fixed) bitwidth, allowing the machine learning system to readily extract and dequantize these magnitudes to generate a magnitude vector V.
[0118] At block 715, the machine learning system generates a gain matrix (e.g., Q) based on the quantization loss vector G and the vector V of magnitude values, such as by Kronecker multiplying the vectors V and G, as discussed above.
[0119] At block 720, the machine learning system generates an ordered list of elements from the gain matrix (e.g., based on the magnitude of each element in decreasing order) , as discussed above. In some aspects, as discussed above, if the quantization system initially allocated a defined minimum number of bits to each phase or complex number (e.g., at least one bit for each phase) , the machine learning system may begin the bit allocation determination by assigning this determined number of bits to each phase or number.
[0120] At block 725, the machine learning system determines whether at least one bit remains to be allocated. For example, the machine learning system may know (e.g., as a hyperparameter) the total number of bits (e.g., M) used to quantize each dynamic phase group, and / or may know the number of remaining bits (e.g., after the bits allocated to the magnitudes are accounted for) . If at least one bit remains to be allocated, the method 700 continues to block 730, where the machine learning system allocates one additional bit to the bitwidth of a given phase value (from the dynamic phase bit group) based on the ordered list. For example, as discussed above, the machine learning system may allocate one bit to the phase that corresponds to the highest value in the ordered list. The machine learning system may then remove this element from the list and decrement the number of available bits, and the method 700 may return to block 725.
[0121] If, at block 725, the machine learning system determines that all available bits have been allocated, the method 700 terminates at block 735. As discussed above, the machine learning system can then dequantize the phases of the group based on the dynamically determined bitwidth allocations. Although the illustrated example depicts a sequential process (e.g., allocating individual bits in sequence) for conceptual clarity, in some aspects, some or all of the bits may be allocated in groups and / or entirely or partially in parallel.
[0122] Example Method for Machine Learning Model Encoding and Quantization
[0123] FIG. 8 is a flow diagram depicting an example method 800 for machine learning model encoding and quantization, according to some aspects of the present disclosure. In some aspects, the method 800 is performed by a quantization system, such as the quantization system 110 of FIG. 1 and / or the quantization system discussed above with reference to FIGS. 2, 4, and / or 5.
[0124] At block 805, a first set of parameters (e.g., the parameters 205 of FIG. 2) , comprising a first parameter and a second parameter, for a machine learning model (e.g., the machine learning model 105 of FIG. 1) is accessed.
[0125] At block 810, based on the first and second parameters, a first set of encoded parameters comprising a first magnitude (e.g., the magnitude 210 of FIG. 2) and a first phase (e.g., the phase 210A of FIG. 2) of a first complex number is generated.
[0126] At block 815, the first set of encoded parameters is quantized to generate a first set of quantized encoded parameters (e.g., the quantized encoded parameters 220 of FIG. 2) .
[0127] At block 820, the quantized first set of encoded parameters is stored for subsequent operation of the machine learning model.
[0128] In some aspects, generating the first set of encoded parameters comprises generating the first magnitude based on the first and second parameters and generating the first phase based on the first magnitude and the first parameter using an inverse trigonometric function.
[0129] In some aspects, generating the first phase comprises dividing the first parameter by the first magnitude to generate an intermediate value and applying the inverse trigonometric function to the intermediate value to generate the first phase.
[0130] In some aspects, the first complex number further comprises a second phase (e.g., the phase 215N of FIG. 2) . In some aspects, generating the first set of encoded parameters comprises generating the second phase based on the first magnitude, the first phase, and a third parameter of the first set of parameters for the machine learning model. In some aspects, the first magnitude is based on the first, second, and third parameters.
[0131] In some aspects, the first complex number further comprises a third phase. In some aspects, generating the first set of encoded parameters further comprises generating the third phase based on the first magnitude, the first phase, the second phase, and a fourth parameter of the first set of parameters for the machine learning model. In some aspects, the first magnitude is based on the first, second, third, and fourth parameters.
[0132] In some aspects, quantizing the first set of encoded parameters comprises quantizing the first phase to a first bitwidth and quantizing the second phase to a second bitwidth less than the first bitwidth.
[0133] In some aspects, the method 800 further includes quantizing a second set of encoded parameters to generate a second set of quantized encoded parameters, where the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number, the first and second complex numbers are part of a first dynamic phase bit group, the first and second magnitudes are each quantized to a fixed bitwidth, the first phase is quantized to a first dynamic bitwidth, and the second phase is quantized to a second dynamic bitwidth.
[0134] In some aspects, the method 800 further includes determining the first and second dynamic bitwidths based at least in part on the first and second magnitudes.
[0135] Example Method for Machine Learning Model Decoding and Dequantization
[0136] FIG. 9 is a flow diagram depicting an example method 900 for machine learning model decoding and dequantization, according to some aspects of the present disclosure. In some aspects, the method 900 is performed by a machine learning system, such as the machine learning system 130 of FIG. 1 and / or the machine learning system discussed above with reference to FIGS. 3, 6, and / or 7.
[0137] At block 905, a first set of quantized encoded parameters (e.g., the quantized machine learning model 125 of FIG. 1 and / or the quantized encoded parameters 220 of FIG. 3) for a machine learning model is accessed.
[0138] At block 910, the first set of quantized encoded parameters is dequantized to generate a first set of encoded parameters (e.g., the magnitude 210 and / or phase (s) 215 of FIG. 3) , wherein the first set of encoded parameters comprises a first magnitude (e.g., the magnitude 210 of FIG. 3) and a first phase (e.g., the phase 215A of FIG. 3) of a first complex number.
[0139] At block 915, based on the first magnitude and the first phase, a first decoded parameter (e.g., the parameter 205A of FIG. 3) and a second decoded parameter (e.g., the parameter 205B of FIG. 3) of the machine learning model are generated.
[0140] At block 920, an output of the machine learning model (e.g., the output 155 of FIG. 1) is generated based on an input to the machine learning model (e.g., the input 150 of FIG. 1) and the first and second decoded parameters.
[0141] In various aspects, the generated output of the machine learning model may be used in any suitable task, such as (without limitation) text generation (e.g., use in chat bots) , language processing, image classification, object detection, and the like.
[0142] In some aspects, generating the first and second decoded parameters includes generating the first decoded parameter based on the first magnitude and the first phase using a first trigonometric function and generating the second decoded parameter based on the first magnitude and the first phase using a second trigonometric function.
[0143] In some aspects, generating the first decoded parameter includes applying the first trigonometric function to the first phase to generate a first intermediate value and multiplying the first intermediate value by the first magnitude to generate the first decoded parameter.
[0144] In some aspects, the first set of encoded parameters further includes a second phase (e.g., the phase 215N of FIG. 3) of the first complex number. In some aspects, the method 900 further includes generating, based on the first magnitude, the first phase, and the second phase, a third decoded parameter (e.g., the parameter 205N of FIG. 3) of the machine learning model, where generating the first decoded parameter is further based on the second phase, and where generating the output of the machine learning model is further based on the third decoded parameter.
[0145] In some aspects, the first set of encoded parameters further includes a third phase of the first complex number. In some aspects, the method 900 further includes generating, based on the first magnitude, the first phase, the second phase, and the third phase, a fourth decoded parameter of the machine learning model, where generating the third decoded parameter is further based on the third phase, and where generating the output of the machine learning model is further based on the fourth decoded parameter.
[0146] In some aspects, in the first set of quantized encoded parameters, the first phase is quantized to a first bitwidth and the second phase is quantized to a second bitwidth less than the first bitwidth.
[0147] In some aspects, the method 900 further includes dequantizing a second set of quantized encoded parameters to generate a second set of encoded parameters, where the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number, the first and second complex numbers are part of a first dynamic phase bit group, in the first and second sets of quantized encoded parameters, the first and second magnitudes are each quantized to a fixed bitwidth, and dequantizing the first and second sets of quantized encoded parameters includes determining a first dynamic bitwidth for the first phase and a second dynamic bitwidth for the second phase.
[0148] In some aspects, the first and second dynamic bitwidths are determined based at least in part on the first and second magnitudes.
[0149] Example Processing System for Improved Quantization
[0150] FIG. 10 depicts an example processing system 1000 configured to perform various aspects of the present disclosure, including, for example, the techniques and methods described with respect to FIGS. 1-9. In some aspects, the processing system 1000 may correspond to a quantization system (e.g., the quantization system 110 of FIG. 1 and / or the quantization systems discussed above with reference to FIGS. 2, 4, 5, and / or 8) , and / or to a machine learning system (e.g., the machine learning system 130 of FIG. 1 and / or the machine learning system discussed above with reference to FIGS. 3, 6, 7, and / or 9) . Although depicted as a single system for conceptual clarity, in some aspects, as discussed above, the components described below with respect to the processing system 1000 may be distributed across any number of devices or systems.
[0151] The processing system 1000 includes a central processing unit (CPU) 1002, which in some examples may be a multi-core CPU. Instructions executed at the CPU 1002 may be loaded, for example, from a program memory associated with the CPU 1002 or may be loaded from a memory partition (e.g., a partition of a memory 1024) .
[0152] The processing system 1000 also includes additional processing components tailored to specific functions, such as a graphics processing unit (GPU) 1004, a digital signal processor (DSP) 1006, a neural processing unit (NPU) 1008, a multimedia component 1010 (e.g., a multimedia processing unit) , and a wireless connectivity component 1012.
[0153] An NPU, such as the NPU 1008, 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.
[0154] NPUs, such as the NPU 1008, 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.
[0155] 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.
[0156] 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.
[0157] 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) . In some implementations, the NPU 1008 is a part of one or more of the CPU 1002, the GPU 1004, and / or the DSP 1006.
[0158] In some examples, the wireless connectivity component 1012 may include subcomponents, for example, for third generation (3G) connectivity, fourth generation (4G) connectivity (e.g., Long-Term Evolution (LTE) ) , fifth generation (5G) connectivity (e.g., New Radio (NR) ) , Wi-Fi connectivity, Bluetooth connectivity, and other wireless data transmission standards. The wireless connectivity component 1012 is further coupled to one or more antennas 1014.
[0159] The processing system 1000 may also include one or more sensor processing units 1016 associated with any manner of sensor, one or more image signal processors (ISPs) 1018 associated with any manner of image sensor, and / or a navigation processor 1020, which may include satellite-based positioning system components (e.g., GPS or GLONASS) as well as inertial positioning system components.
[0160] The processing system 1000 may also include one or more input and / or output devices 1022, such as screens, touch-sensitive surfaces (including touch-sensitive displays) , physical buttons, speakers, microphones, and the like.
[0161] In some examples, one or more of the processors of the processing system 1000 may be based on an ARM or RISC-V instruction set.
[0162] The processing system 1000 also includes a memory 1024, 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 1024 includes computer-executable components, which may be executed by one or more of the aforementioned processors of the processing system 1000.
[0163] In particular, in this example, the memory 1024 includes an encoding component 1024A, a quantization component 1024B, a dequantization component 1024C, a decoding component 1024D, and an inferencing component 1024E. Although not depicted in the illustrated example, the memory 1024 may also include other components, such as a training component to train machine learning models. Though depicted as discrete components for conceptual clarity in FIG. 10, the illustrated components (and others not depicted) may be collectively or individually implemented in various aspects.
[0164] Further, although not depicted in the illustrated example, the memory 1024 may also include other data such as training data, calibration data, and the like.
[0165] The processing system 1000 further comprises an encoding circuit 1026, a quantization circuit 1027, a dequantization circuit 1028, a decoding circuit 1029, and an inferencing circuit 1030. The depicted circuits, and others not depicted (such as an inferencing circuit) , may be configured to perform various aspects of the techniques described herein.
[0166] For example, the encoding component 1024A and / or the encoding circuit 1026 (which may correspond to the encoding component 115 of FIGS. 1-2) may be used to encode model parameters (e.g., the parameters 205 of FIG. 2) using complex numbers, as discussed above. For example, the encoding component 1024A and / or the encoding circuit 1026 may transform each set of parameters into a corresponding magnitude and one or more phase (s) .
[0167] The quantization component 1024B and / or the quantization circuit 1027 (which may correspond to the quantization component 120 of FIGS. 1 and / or 2) may be used to quantize encoded model parameters, as discussed above. For example, the quantization component 1024B and / or the quantization circuit 1027 may determine quantization bitwidth allocations and quantize each component of the encoded model parameters accordingly.
[0168] The dequantization component 1024C and / or the dequantization circuit 1028 (which may correspond to the dequantization component 135 of FIGS. 1 and / or 3) may be used to dequantize the quantized and encoded model parameters, as discussed above. For example, the dequantization component 1024C and / or the dequantization circuit 1028 may determine the bitwidth (s) used to quantize each component of each complex number, and may then dequantize the values to generate encoded model parameters.
[0169] The decoding component 1024D and / or the decoding circuit 1029 (which may correspond to the decoding component 140 of FIGS. 1 and / or 3) may be used to generate decoded parameters (e.g., the parameters 205 of FIG. 3) , as discussed above. For example, the decoding component 1024D and / or the decoding circuit 1029 may convert the complex numbers (e.g., magnitudes and phases) to a set of corresponding real values, as discussed above.
[0170] The inferencing component 1024E and / or the inferencing circuit 1030 (which may correspond to the inferencing component 145 of FIG. 1) may be used to generate machine learning model outputs, as discussed above. For example, the inferencing component 1024E and / or the inferencing circuit 1030 may process input data using the dequantized and decoded model parameters to generate the output, as discussed above.
[0171] Though depicted as separate components and circuits for clarity in FIG. 10, the encoding circuit 1026, the quantization circuit 1027, the dequantization circuit 1028, the decoding circuit 1029, and the inferencing circuit 1030 may collectively or individually be implemented in other processing devices of the processing system 1000, such as within the CPU 1002, the GPU 1004, the DSP 1006, the NPU 1008, and the like.
[0172] Generally, the processing system 1000 and / or components thereof may be configured to perform the methods described herein.
[0173] Notably, in other aspects, aspects of the processing system 1000 may be omitted, such as where the processing system 1000 is a server computer or the like. For example, the multimedia component 1010, the wireless connectivity component 1012, the sensor processing units 1016, the ISPs 1018, and / or the navigation processor 1020 may be omitted in other aspects. Further, aspects of the processing system 1000 may be distributed between multiple devices.
[0174] Example Clauses
[0175] Implementation examples are described in the following numbered clauses:
[0176] Clause 1: A method, comprising: accessing a first set of quantized encoded parameters for a machine learning model; dequantizing the first set of quantized encoded parameters to generate a first set of encoded parameters, wherein the first set of encoded parameters comprises a first magnitude and a first phase of a first complex number; generating, based on the first magnitude and the first phase, a first decoded parameter and a second decoded parameter of the machine learning model; and generating an output of the machine learning model based on an input to the machine learning model and the first and second decoded parameters.
[0177] Clause 2: A method according to Clause 1, wherein generating the first and second decoded parameters comprises: generating the first decoded parameter based on the first magnitude and the first phase using a first trigonometric function; an generating the second decoded parameter based on the first magnitude and the first phase using a second trigonometric function.
[0178] Clause 3: A method according to Clause 2, wherein generating the first decoded parameter comprises: applying the first trigonometric function to the first phase to generate a first intermediate value; and multiplying the first intermediate value by the first magnitude to generate the first decoded parameter.
[0179] Clause 4: A method according to any of Clauses 1-3, wherein the first set of encoded parameters further comprises a second phase of the first complex number, the method further comprising generating, based on the first magnitude, the first phase, and the second phase, a third decoded parameter of the machine learning model, wherein generating the first decoded parameter is further based on the second phase, and wherein generating the output of the machine learning model is further based on the third decoded parameter.
[0180] Clause 5: A method according to Clause 4, wherein the first set of encoded parameters further comprises a third phase of the first complex number, the method further comprising generating, based on the first magnitude, the first phase, the second phase, and the third phase, a fourth decoded parameter of the machine learning model, wherein generating the third decoded parameter is further based on the third phase, and wherein generating the output of the machine learning model is further based on the fourth decoded parameter.
[0181] Clause 6: A method according to any of Clauses 4-5, wherein, in the first set of quantized encoded parameters: the first phase is quantized to a first bitwidth, and the second phase is quantized to a second bitwidth less than the first bitwidth.
[0182] Clause 7: A method according to any of Clauses 1-6, further comprising dequantizing a second set of quantized encoded parameters to generate a second set of encoded parameters, wherein: the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number, the first and second complex numbers are part of a first dynamic phase bit group, in the first and second sets of quantized encoded parameters, the first and second magnitudes are each quantized to a fixed bitwidth, and dequantizing the first and second sets of quantized encoded parameters comprises determining a first dynamic bitwidth for the first phase and a second dynamic bitwidth for the second phase.
[0183] Clause 8: A method according to Clause 7, wherein the first and second dynamic bitwidths are determined based at least in part on the first and second magnitudes.
[0184] Clause 9: A method, comprising: accessing a first set of parameters, comprising a first parameter and a second parameter, for a machine learning model; generating, based on the first and second parameters, a first set of encoded parameters comprising a first magnitude and a first phase of a first complex number; quantizing the first set of encoded parameters to generate a first set of quantized encoded parameters; and storing the quantized first set of encoded parameters for subsequent operation of the machine learning model.
[0185] Clause 10: A method according to Clause 9, wherein generating the first set of encoded parameters comprises: generating the first magnitude based on the first and second parameters; and generating the first phase based on the first magnitude and the first parameter using an inverse trigonometric function.
[0186] Clause 11: A method according to Clause 10, wherein generating the first phase comprises: dividing the first parameter by the first magnitude to generate an intermediate value; and applying the inverse trigonometric function to the intermediate value to generate the first phase.
[0187] Clause 12: A method according to any of Clauses 9-11, wherein: the first complex number further comprises a second phase; generating the first set of encoded parameters comprises generating the second phase based on the first magnitude, the first phase, and a third parameter of the first set of parameters for the machine learning model; and the first magnitude is based on the first, second, and third parameters.
[0188] Clause 13: A method according to Clause 12, wherein: the first complex number further comprises a third phase; generating the first set of encoded parameters further comprises generating the third phase based on the first magnitude, the first phase, the second phase, and a fourth parameter of the first set of parameters for the machine learning model; and the first magnitude is based on the first, second, third, and fourth parameters.
[0189] Clause 14: A method according to any of Clauses 12-13, wherein quantizing the first set of encoded parameters comprises: quantizing the first phase to a first bitwidth, and quantizing the second phase to a second bitwidth less than the first bitwidth
[0190] Clause 15: A method according to any of Clauses 9-14, further comprising quantizing a second set of encoded parameters to generate a second set of quantized encoded parameters, wherein: the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number, the first and second complex numbers are part of a first dynamic phase bit group, the first and second magnitudes are each quantized to a fixed bitwidth, the first phase is quantized to a first dynamic bitwidth, and the second phase is quantized to a second dynamic bitwidth.
[0191] Clause 16: A method according to Clause 15, further comprising determining the first and second dynamic bitwidths based at least in part on the first and second magnitudes.
[0192] Clause 17: A processing system comprising: a memory comprising processor-executable instructions; and one or more processors coupled to the one or more memories and configured to execute the processor-executable instructions and cause the processing system to perform a method in accordance with any of Clauses 1-16.
[0193] Clause 18: A processing system comprising means for performing a method in accordance with any of Clauses 1-16.
[0194] 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.
[0195] Clause 20: 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.
[0196] Additional Considerations
[0197] 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.
[0198] 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.
[0199] 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) .
[0200] 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.
[0201] 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.
[0202] 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 coupled to the one or more memories and configured to execute the processor-executable instructions and cause the processing system to:access a first set of quantized encoded parameters for a machine learning model;dequantize the first set of quantized encoded parameters to generate a first set of encoded parameters, wherein the first set of encoded parameters comprises a first magnitude and a first phase of a first complex number;generate, based on the first magnitude and the first phase, a first decoded parameter and a second decoded parameter of the machine learning model; andgenerate an output of the machine learning model based on an input to the machine learning model and the first and second decoded parameters.2.The processing system of claim 1, wherein, to generate the first and second decoded parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to:generate the first decoded parameter based on the first magnitude and the first phase using a first trigonometric function; andgenerate the second decoded parameter based on the first magnitude and the first phase using a second trigonometric function.3.The processing system of claim 2, wherein, to generate the first decoded parameter, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to:apply the first trigonometric function to the first phase to generate a first intermediate value; andmultiply the first intermediate value by the first magnitude to generate the first decoded parameter.4.The processing system of claim 1, wherein:the first set of encoded parameters further comprises a second phase of the first complex number,the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to generate, based on the first magnitude, the first phase, and the second phase, a third decoded parameter of the machine learning model,the first decoded parameter is generated further based on the second phase, andthe output of the machine learning model is generated further based on the third decoded parameter.5.The processing system of claim 4, wherein:the first set of encoded parameters further comprises a third phase of the first complex number,the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to generate, based on the first magnitude, the first phase, the second phase, and the third phase, a fourth decoded parameter of the machine learning model,the third decoded parameter is generated further based on the third phase, andthe output of the machine learning model is generated further based on the fourth decoded parameter.6.The processing system of claim 4, wherein, in the first set of quantized encoded parameters:the first phase is quantized to a first bitwidth, andthe second phase is quantized to a second bitwidth less than the first bitwidth.7.The processing system of claim 1, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to dequantize a second set of quantized encoded parameters to generate a second set of encoded parameters, wherein:the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number,the first and second complex numbers are part of a first dynamic phase bit group,in the first and second sets of quantized encoded parameters, the first and second magnitudes are each quantized to a fixed bitwidth, andto dequantize the first and second sets of quantized encoded parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to determine a first dynamic bitwidth for the first phase and a second dynamic bitwidth for the second phase.8.The processing system of claim 7, wherein the first and second dynamic bitwidths are determined based at least in part on the first and second magnitudes.9.A processing system comprising:one or more memories comprising processor-executable instructions; andone or more processors coupled to the one or more memories and configured to execute the processor-executable instructions and cause the processing system to:access a first set of parameters, comprising a first parameter and a second parameter, for a machine learning model;generate, based on the first and second parameters, a first set of encoded parameters comprising a first magnitude and a first phase of a first complex number;quantize the first set of encoded parameters to generate a first set of quantized encoded parameters; andstore the quantized first set of encoded parameters for subsequent operation of the machine learning model.10.The processing system of claim 9, wherein, to generate the first set of encoded parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to:generate the first magnitude based on the first and second parameters; andgenerate the first phase based on the first magnitude and the first parameter using an inverse trigonometric function.11.The processing system of claim 10, wherein, to generate the first phase, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to:divide the first parameter by the first magnitude to generate an intermediate value; andapply the inverse trigonometric function to the intermediate value to generate the first phase.12.The processing system of claim 9, wherein:the first complex number further comprises a second phase;to generate the first set of encoded parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to generate the second phase based on the first magnitude, the first phase, and a third parameter of the first set of parameters for the machine learning model; andthe first magnitude is based on the first, second, and third parameters.13.The processing system of claim 12, wherein:the first complex number further comprises a third phase;to generate the first set of encoded parameters, the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to generate the third phase based on the first magnitude, the first phase, the second phase, and a fourth parameter of the first set of parameters for the machine learning model; andthe first magnitude is based on the first, second, third, and fourth parameters.14.The processing system of claim 12, wherein, to quantize the first set of encoded parameters, the one or more processors are configured to execute the processor-executable instructions and cause the processing system to:quantize the first phase to a first bitwidth, andquantize the second phase to a second bitwidth less than the first bitwidth.15.The processing system of claim 9, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to quantize a second set of encoded parameters to generate a second set of quantized encoded parameters, wherein:the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number,the first and second complex numbers are part of a first dynamic phase bit group,the first and second magnitudes are each quantized to a fixed bitwidth,the first phase is quantized to a first dynamic bitwidth, andthe second phase is quantized to a second dynamic bitwidth.16.The processing system of claim 15, wherein the one or more processors are configured to execute the processor-executable instructions and further cause the processing system to determine the first and second dynamic bitwidths based at least in part on the first and second magnitudes.17.A processor-implemented method of machine learning, comprising:accessing a first set of quantized encoded parameters for a machine learning model;dequantizing the first set of quantized encoded parameters to generate a first set of encoded parameters, wherein the first set of encoded parameters comprises a first magnitude and a first phase of a first complex number;generating, based on the first magnitude and the first phase, a first decoded parameter and a second decoded parameter of the machine learning model; andgenerating an output of the machine learning model based on an input to the machine learning model and the first and second decoded parameters.18.The processor-implemented method of claim 17, wherein generating the first and second decoded parameters comprises:generating the first decoded parameter based on the first magnitude and the first phase using a first trigonometric function; andgenerating the second decoded parameter based on the first magnitude and the first phase using a second trigonometric function.19.The processor-implemented method of claim 18, wherein generating the first decoded parameter comprises:applying the first trigonometric function to the first phase to generate a first intermediate value; andmultiplying the first intermediate value by the first magnitude to generate the first decoded parameter.20.The processor-implemented method of claim 17, wherein the first set of encoded parameters further comprises a second phase of the first complex number, the method further comprising generating, based on the first magnitude, the first phase, and the second phase, a third decoded parameter of the machine learning model, wherein generating the first decoded parameter is further based on the second phase, and wherein generating the output of the machine learning model is further based on the third decoded parameter.21.The processor-implemented method of claim 20, wherein, in the first set of quantized encoded parameters:the first phase is quantized to a first bitwidth, andthe second phase is quantized to a second bitwidth less than the first bitwidth.22.The processor-implemented method of claim 17, further comprising dequantizing a second set of quantized encoded parameters to generate a second set of encoded parameters, wherein:the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number,the first and second complex numbers are part of a first dynamic phase bit group,in the first and second sets of quantized encoded parameters, the first and second magnitudes are each quantized to a fixed bitwidth, anddequantizing the first and second sets of quantized encoded parameters comprises determining a first dynamic bitwidth for the first phase and a second dynamic bitwidth for the second phase.23.The processor-implemented method of claim 22, wherein the first and second dynamic bitwidths are determined based at least in part on the first and second magnitudes.24.A processor-implemented method of machine learning, comprising:accessing a first set of parameters, comprising a first parameter and a second parameter, for a machine learning model;generating, based on the first and second parameters, a first set of encoded parameters comprising a first magnitude and a first phase of a first complex number;quantizing the first set of encoded parameters to generate a first set of quantized encoded parameters; andstoring the quantized first set of encoded parameters for subsequent operation of the machine learning model.25.The processor-implemented method of claim 24, wherein generating the first set of encoded parameters comprises:generating the first magnitude based on the first and second parameters; andgenerating the first phase based on the first magnitude and the first parameter using an inverse trigonometric function.26.The processor-implemented method of claim 25, wherein generating the first phase comprises:dividing the first parameter by the first magnitude to generate an intermediate value; andapplying the inverse trigonometric function to the intermediate value to generate the first phase.27.The processor-implemented method of claim 24, wherein:the first complex number further comprises a second phase;generating the first set of encoded parameters comprises generating the second phase based on the first magnitude, the first phase, and a third parameter of the first set of parameters for the machine learning model; andthe first magnitude is based on the first, second, and third parameters.28.The processor-implemented method of claim 27, wherein quantizing the first set of encoded parameters comprises:quantizing the first phase to a first bitwidth, andquantizing the second phase to a second bitwidth less than the first bitwidth.29.The processor-implemented method of claim 24, further comprising quantizing a second set of encoded parameters to generate a second set of quantized encoded parameters, wherein:the second set of encoded parameters comprises a second magnitude and a second phase of a second complex number,the first and second complex numbers are part of a first dynamic phase bit group,the first and second magnitudes are each quantized to a fixed bitwidth,the first phase is quantized to a first dynamic bitwidth, andthe second phase is quantized to a second dynamic bitwidth.30.The processor-implemented method of claim 29, further comprising determining the first and second dynamic bitwidths based at least in part on the first and second magnitudes.