Machine learning model quantization
The integrated use of PTQ and QAT in machine learning model quantization for video delivery systems addresses the dual challenges of throughput and quality, resulting in a cost-effective and efficient video quality enhancement system.
Patent Information
- Application Number
- PCT/CN2024/135150
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-22
- Filing Date
- 2024-11-28
- Publication Date
- 2025-08-28
AI Technical Summary
Existing machine learning models for video delivery systems face challenges in meeting both throughput and quality requirements due to the high cost and inefficiency of floating point operations, with quantization techniques like post training quantization (PTQ) and quantization aware training (QAT) often failing to satisfy both targets simultaneously.
An integrated machine learning model quantization approach that combines PTQ and QAT to generate refined quantized models, allowing for partially quantized layers with both CPU and AI accelerators, optimizing throughput and quality simultaneously.
The integrated quantization technique achieves a cost-effective and efficient video quality enhancement system that meets throughput and quality requirements, reducing total cost of ownership and maintenance complexity.
Smart Images

Figure CN2024135150_28082025_PF_FP_ABST
Abstract
Description
MACHINE LEARNING MODEL QUANTIZATIONRELATED APPLICATION
[0001] This patent claims the benefit of and priority to International Patent Application No. PCT / CN2024 / 078086, which was filed on February 22, 2024. International Patent Application No. PCT / CN2024 / 078086 is hereby incorporated herein by reference in its entirety.BACKGROUND
[0002] Machine learning model quantization involves quantizing a floating point machine learning model, which is implemented based on floating point operations and values, to determine a quantized machine learning model, which is implemented based on fixed point operations and values. In some scenarios, model quantization yields quantization parameters to enable quantization of the layer weights of the machine learning model, quantization of the tensors values input to the respective layers of the machine learning model, etc. Several algorithms have been developed to perform machine learning model quantization. One such algorithm is post training quantization, which involves quantizing the floating point machine learning model after the model has been trained. Another such algorithm is quantization aware training, which involves quantizing the floating point machine learning model during model training.BRIEF DESCRIPTION OF THE DRAWINGS
[0003] FIG. 1 is a block diagram of an example video delivery system in which an example video quality enhancement system implements one or more machine learning models to process video.
[0004] FIG. 2 is a block diagram of the video quality enhancement system of FIG. 1.
[0005] FIG. 3 is a block diagram of an example model quantization system implemented in accordance with teachings of this disclosure.
[0006] FIG. 4 illustrates an example model quantization procedure implemented by the model quantization system of FIG. 3.
[0007] FIG. 5 illustrates example observer operations included in the model quantization procedure of FIG. 4.
[0008] FIG. 6 illustrates an example quantization aware training procedure included in the model quantization procedure of FIG. 4.
[0009] FIG. 7 illustrates example quantization operations included in the model quantization procedure of FIG. 4.
[0010] FIG. 8 is a flowchart representative of example machine readable instructions and / or example operations that may be executed, instantiated, and / or performed by example programmable circuitry to implement the model quantization system of FIG. 3.
[0011] FIG. 9 illustrates example performance results achieved by an example machine learning model quantized by the model quantization system of FIG. 3.
[0012] FIG. 10 is a block diagram of an example processing platform including programmable circuitry structured to execute, instantiate, and / or perform the example machine readable instructions and / or perform the example operations of FIG. 8 to implement the model quantization system of FIG. 3.
[0013] FIG. 11 is a block diagram of an example implementation of the programmable circuitry of FIG. 10.
[0014] FIG. 12 is a block diagram of another example implementation of the programmable circuitry of FIG. 10.
[0015] FIG. 13 is a block diagram of an example software / firmware / instructions distribution platform (e.g., one or more servers) to distribute software, instructions, and / or firmware (e.g., corresponding to the example machine readable instructions of FIG. 8) to client devices associated with end users and / or consumers (e.g., for license, sale, and / or use) , retailers (e.g., for sale, re-sale, license, and / or sub-license) , and / or original equipment manufacturers (OEMs) (e.g., for inclusion in products to be distributed to, for example, retailers and / or to other end users such as direct buy customers) .
[0016] In general, the same reference numbers will be used throughout the drawing (s) and accompanying written description to refer to the same or like parts. The figures are not necessarily to scale.DETAILED DESCRIPTION
[0017] Video delivery systems may employ machine learning models to enhance video delivered to downstream devices, processes, etc. Such machine learning models may be floating point machine learning models that are implemented with floating point operations that operate on floating point values to achieve one or more video quality targets. However, floating point machine learning models may be costly to implement due to the complexity of the floating point operations and / or unable to meet one or more video throughput targets due to the time (e.g., clock cycles) involved in performing the floating point operations.
[0018] As a result, machine learning model quantization may be employed to quantize a floating point machine learning model to yield a corresponding quantized machine learning model, also referred to herein as a fixed point machine learning model, that is implemented with fixed point operations that operate on fixed point values. Such quantized machine learning models may meet the video throughput target (s) because fixed point operations may involve less processing time (e.g., clock cycles) than floating point operations. However, some such quantized machine learning models may still be too costly to implement and / or unable to the video quality target (s) due to the lower fixed point precision of the quantized models.
[0019] In contrast, example integrated machine learning model quantization techniques disclosed herein integrate multiple model quantization procedures in manners that are able to output quantized machine learning models that meet video throughput target (s) and video quality target (s) , and that are able to be implemented cost effectively. For example, some integrated machine learning model quantization techniques integrate post training quantization with quantization aware training to determine a quantized machine learning model corresponding to a trained floating point machine learning model. In some such examples, a post training quantization procedure is utilized to determine an initial quantized machine learning model that meets one or more video throughput targets. That initial quantized machine learning model is used to initialize or seed a quantization aware training procedure. The quantization aware training procedure then retrains the initial quantized machine learning model to determine a refined quantized machine learning model that meets one or more video quality targets. The refined quantized machine learning model is then stored and / or output to a target platform, such as a compute device, cloud server, etc., that is to execute or otherwise implement the machine learning model.
[0020] Also, some example integrated machine learning model quantization techniques disclosed herein may store and / or output multiple refined quantized models for a given input floating point machine learning model. Such examples permit selection among the multiple refined quantized models based on their different respective characteristics, such as their respective quality results, throughput result, etc. Furthermore, some example integrated machine learning model quantization techniques disclosed herein determine quantized machine learning models in which a subset of one or more layers of the input floating point machine learning model are quantized, with any remaining layer or layers of the input floating point machine learning model remaining unquantized. Such partially quantized machine learning models, which integrate one or more quantized, or fixed point, layers with one or more unquantized, or floating point, layers may achieve improved quality over fully quantized machine learning models, while still achieving one or more throughput targets.
[0021] Turning to the figures, a block diagram of an example video delivery system 100 in which an example video quality enhancement system 105 implements one or more machine learning models to process video is illustrated in FIG. 1. The video quality enhancement system 105 is a component of video delivery pipelines implemented by systems, such as the video delivery system 100, that deliver video for live-streaming, digital television (TV) , etc. The video delivery system 100 of the illustrated example includes an example video capture system 110 to capture or otherwise receive input video, an example video pre-processing system 115 to pre-process the captured video, and an example video encoder system 120 to encode the captured video.
[0022] The video delivery system 100 of FIG. 1 also performs many operations before the encoded video reaches viewers. For example, the video delivery system 100 includes an example video editing system 125 to perform video editing and other video processing, and an example re-encoding system 130 to re-encode the edited video for downstream delivery. These operations can add noise and other artifacts, which can degrade video quality. Transmission noise can further degrade video quality.
[0023] Furthermore, the video delivery system 100 of the illustrated example includes an example video post-processing system 135 that includes an example video watermarking system 140 to add audio and / or video watermarks to the video, an example content audition system 145 to perform content auditing to add data to identify potentially sensitive material conveyed by the video, and an example transcoding system 150 to transcode the video to support different resolutions for different types of downstream media devices (e.g., such as 1080p, 4K, etc. ) . In the illustrated example, the video quality enhancement system 105 operates to remove video artifacts and / or noises and determines the final video quality to be provided to viewers. In some examples, the video quality enhancement system 105 is implemented in an example cloud platform 155.
[0024] The video delivery system 100 also includes an example content delivery network (CDN) system 158 to deliver the video to one or more example downstream media devices 160. In some examples, the CDN system 158 is implemented by the cloud platform 155. In the illustrated example, at least one of the media devices 160 includes an example video decoding system 165 to decode the encoded video, and an example rendering and playback system 170 to render and playback, or otherwise present, display, etc., the decoded video.
[0025] A block diagram of the example video quality enhancement system 105 of FIG. 1 is illustrated in FIG. 2. The example video quality enhancement system 105 of FIG. 2 includes example video decoder circuitry 205, example video quality enhancement circuitry 210 and example video encoder circuitry 215. The video decoder circuitry 205 decodes an example encoded video bitstream 220, which may be encoded in H. 264 or some other encoding format, to obtain decoded video data, such as decoded video data in RGB format, YUV format, etc. The video quality enhancement circuitry 210 implements one or more machine learning models, such as one or more neural networks, convolutional neural networks (CNNs) , generative adversarial networks (GANs) , etc., one or more deep learning (DL) models / networks, etc., and / or any combination thereof, to perform video denoising, artifact removal, super resolution conversion, etc. and / or any combination thereof. For example, the video quality enhancement circuitry 210 may implement an enhanced super-resolution generative adversarial network (ESRGAN) , a Real-ESRGAN, etc. The video encoder circuitry 215 re-encodes the enhanced video data output from the video quality enhancement circuitry 210 to determine an example enhanced video stream 225.
[0026] Unlike video surveillance and similar systems, video delivery systems may have higher requirements for video quality, compression ratios (e.g., throughput) , or both. Thus, video quality enhancement systems, such as the video quality enhancement system 105, included in video delivery systems, such as the video system 100, may rely on advanced video encoding and decoding techniques that are not available in off-the-shelf hardware accelerators, such as graphics processing units (GPUs) and application specific integrated circuits (ASICs) . Thus, in some examples, the video decoder circuitry 205 and the video encoder circuitry 215 are implemented with one or more central processing units (CPUs) that perform the advanced video encoding and decoding techniques, whereas the video quality enhancement circuitry 210 is implemented with one or more discrete artificial intelligence (AI) accelerators included in one or more graphics processing units (GPUs. ) .
[0027] However, such an example implementation of the video quality enhancement system 105 of FIG. 2 can have two potential issues. First, such an implementation can be associated with higher total cost of ownership (TCO) . This is because the implementation utilizes both GPUs and CPUs, which can lead to higher capital and operation spending. For example, purchasing both GPUs and CPUs can lead to higher costs to build the video quality enhancement system 105, while managing and maintaining a heterogeneous system introduces more system complexity and associated operation costs.
[0028] Second, such an example implementation of the video quality enhancement system 105 may have low system efficiency. Although more money may be spent on purchasing and maintaining such an implementation of the video quality enhancement system 105, there is not much performance benefit. This is because the video pipeline is sequentially frame-by-frame and, thus, performance is decoder and encoder bound. As such, improving video quality enhancement model throughput may not translate into a lower end-to-end latency and higher throughput, because both are bounded by encoder and decoder latency (which is approximately 25 frames per second (fps) for broadcast video.
[0029] To overcome such potential issues and achieve a cost-effective and efficient system for video delivery, example techniques disclosed herein enable the video quality enhancement circuitry 210 to also implemented with one or more CPUs to result in a converged CPU-only system. In such an example implementation, the video quality enhancement circuitry 210 can be implemented with CPU integrated AI accelerators, such as, but not limited to, Advanced Matrix eXtensions (AMX) .
[0030] A challenge is to develop a CPU converged video quality enhancement system 105 that can meet video encoder and decoder throughput requirements, such as 25 fps operation. One example approach is to use post training quantization (PTQ) to quantize a machine learning (ML) model, which is to be implemented by the video quality enhancement circuitry 210, from a higher floating point precision, such as 16-bit brain floating point (BF16) precision, to lower integer precision, such as 8-bit integer (INT8) precision. However, using that approach may not meet target video requirements. For example, with a fully quantized ML model obtained via PTQ, the video quality enhancement system 105 may achieve 27 fps in an example video delivery scenario, which meets the 25 fps throughput requirements. However, the resulting enhanced video may exhibit quality issues, such as in high-brightness areas, which may result in quality requirements not being met. To improve quality, a partially quantized ML model obtained via PTQ can be used instead, with some layers remaining in the higher, unquantized floating precision (e.g., BF16) . But such a partially quantized ML model may achieve only 22 fps in this example scenario, which does not meet the 25 fps throughput requirement. Thus, in some examples, PTQ may be unable to satisfy both the throughput and the quality requirements at the same time.
[0031] Another example approach is to use quantization aware training (QAT) to quantize an ML model, which is to be implemented by the video quality enhancement circuitry 210, from the higher floating point precision, such as BF16 precision, to lower integer precision, such as INT8 precision. However, using this approach may also not meet target video requirements. For example, QAT may be able to generate a fully-quantized model which can meet throughput requirements with better image quality than PTQ. However, in an example video delivery scenario, the quality of displayed text may be not pass subjective evaluation. Thus, like PTQ, in some examples, QAT may be unable to satisfy both the throughput and the quality requirements at the same time.
[0032] FIG. 3 is a block diagram of an example model quantization system 300 implemented in accordance with teachings of this disclosure to quantize an ML model, such as an ML model implemented by the video quality enhancement circuitry 210 described above. The model quantization system 300 of FIG. 3 may be instantiated (e.g., creating an instance of, bring into being for any length of time, materialize, implement, etc. ) by programmable circuitry such as a Central Processor Unit (CPU) executing first instructions. Additionally or alternatively, the model quantization system 300 of FIG. 3 may be instantiated (e.g., creating an instance of, bring into being for any length of time, materialize, implement, etc. ) by (i) an Application Specific Integrated Circuit (ASIC) and / or (ii) a Field Programmable Gate Array (FPGA) structured and / or configured in response to execution of second instructions to perform operations corresponding to the first instructions. It should be understood that some or all of the circuitry of FIG. 3 may, thus, be instantiated at the same or different times. Some or all of the circuitry of FIG. 3 may be instantiated, for example, in one or more threads executing concurrently on hardware and / or in series on hardware. Moreover, in some examples, some or all of the circuitry of FIG. 3 may be implemented by microprocessor circuitry executing instructions and / or FPGA circuitry performing operations to implement one or more virtual machines and / or containers.
[0033] As described above, ML models quantized based on PAT alone or QAT alone may be unable to meet both video throughput and video quality requirement at the same time. As a result, such quantized ML models may raise a roadblock to building a CPU converged video quality enhancement system 105. In contrast, the model quantization system 300 implements an integrated ML model quantization solution that integrates PTQ and QAT to achieve quantized ML models that are able to meet video throughput and video quality requirement at the same time. For example, the model quantization system 300 utilizes PTQ to perform initial model quantization, followed by QAT to perform quantized model fine tuning to generate a quantized ML model that meets both throughput and quality requirements efficiently. The quantized ML model generated by the model quantization system 300 supports building a CPU converged video quality enhancement system 105 with lower TCO and maintenance complexity.
[0034] Turning to FIG. 3, the example model quantization system 300 includes example post training quantization (PTQ) circuitry 305, example quantization aware training (QAT) circuitry 310, and example iteration controller circuitry 315. The model quantization system 300 of the illustrated example also includes example trained model stored 320, example calibration data storage 325 and example quantized model storage 330. The trained model storage 320, the calibration data storage 325 and / or the quantized model storage 330 can be implemented by any number (s) and or type (s) of memories, storage devices, etc., such as the local memory 1013, the volatile memory 1014, and / or the mass storage discs or devices 1028, etc., described in further detail below.
[0035] The trained model storage 320 stores one or more trained floating point ML models that is / are to be quantized by the model quantization system 300. For example, the trained floating point ML model (s) stored in the trained model storage 320 can include one or more floating point neural networks, CNNs, GANs, etc., one or more DL models / networks, one or more ESRGANs, one or more Real-ESRGANs, etc., and / or any combination thereof, that have already been trained based on one or more training procedures. In some examples, the trained floating point ML model (s) are stored in the trained model storage 320 as data files, data structures, etc., that include data representative of the layers, weights, biases, and / or other parameters that make up the trained floating point ML model (s) .
[0036] The calibration data storage 325 stores one or more calibration datasets to be used by the model quantization system 300 to quantize the trained floating point ML model (s) stored in the trained model storage 320. In some examples, a calibration data set includes a set of image pairs (e.g., M image pairs) , with a given image pair including one low-quality low-resolution image and one high-quality high-resolution image that is a counterpart to that low-quality low-resolution image.
[0037] The quantized model storage 330 stores quantized ML model (s) determined by the model quantization system 300 for respective floating point ML models obtained from the trained model storage 320. For example, the quantized ML model (s) stored in the quantized model storage 330 can include one or more quantized neural networks, CNNs, GANs, etc., one or more DL models / networks, one or more ESRGANs, one or more Real-ESRGANs, etc., and / or any combination thereof. In some examples, the quantized ML model (s) are stored in the quantized model storage 330 as data files, data structures, etc., that include data representative of the layers, weights, biases, and / or other parameters that make up the quantized ML model (s) .
[0038] FIG. 4 illustrates an example model quantization procedure 400 implemented by the model quantization system 300 of FIG. 3. In the example model quantization procedure 400, the iteration controller circuitry 315 invokes the PTQ circuitry 305 to perform an example PTQ procedure 405. At a high-level, the PTQ procedure 405 performed by the PTQ circuitry 305 includes retrieving an example trained floating point ML model 410 from trained model storage 320 and / or via other interface circuitry, such as interface circuitry that communicated with one or more networks. The PTQ procedure 405 then performs any appropriate PTQ algorithm on the trained floating point ML model 410 using an example calibration dataset 415 from the calibration data storage 325 to determine an example initial quantized ML model 420.
[0039] For example, the PTQ procedure 405 implemented by the PTQ circuitry 305 may insert observer operations in the trained floating point ML model 410 to record quantization statistics that are used to determine quantization parameters to quantize one or more layers of the trained floating point ML model 410. FIG. 5 illustrates example observer operations 500 included in the model quantization procedure 400 of FIG. 4. In the illustrated example, for a given quantizable operator (e.g. convolution, deconvolution etc. ) at a given layer of the trained floating point ML model 410, such as an example quantizable operation 505, the PTQ procedure 405 inserts example observer operations 510, 515 and 520 to observe an example weight 525 and example data 530 and 535 associated with the quantizable operation 505 as the quantizable operation 505 processes the calibration dataset 415. In the illustrated example, the observer operations 510, 515 and 520 record quantization statistics, such as minimum values of the weight 525 and the data 530 and 535, maximum values of the weight 525 and the data 530 and 535, histograms of the weight 525 and the data 530 and 535, etc. The PTQ procedure 405 uses the quantization statistics for the weight 525 to determine quantization parameters to quantize the weight 525 to determine a corresponding quantized weight for the initial quantized ML model 420. The PTQ procedure 405 also uses the quantization statistics for the data 530 and 535 to determine quantization parameters to be used to quantize the corresponding tensor data in the initial quantized ML model 420.
[0040] Returning to FIG. 4, in the example model quantization procedure 400, the iteration controller circuitry 315 next invokes the QAT circuitry 310 to perform an example QAT procedure 425. At a high-level, the QAT procedure 425 performed by the QAT circuitry 310 includes accessing the initial quantized ML model 420 determined by the PTQ procedure 405 performed by the PTQ circuitry 305. The QAT procedure 425 then performs any appropriate QAT algorithm on the initial quantized ML model 420 using the example calibration dataset 415 from the calibration data storage 325 to determine an example refined quantized ML model 430. In some examples, the QAT procedure 425 stores the refined quantized ML model 430 in the quantized model storage 330. In some examples, the QAT procedure 425 additionally or alternatively provides, downloads or otherwise uses the refined quantized ML model 430 to configure the video quality enhancement circuitry 210.
[0041] FIG. 6 illustrates example operation 600 of the QAT procedure 425 included in the model quantization procedure 400 of FIG. 4. In the illustrated example, the QAT procedure 425 uses the initial quantized ML model 420 to initialize an example QAT model 605. The QAT procedure 425 then iteratively retrains the QAT model 605 to determine the refined quantized ML model 430. For example, the QAT procedure 425 uses the example quantization operations 705-715 illustrated in FIG. 7 to iteratively update the quantization parameters used to quantize the weights and data of the QAT model 605.
[0042] Returning to FIG. 6, for a given retraining iteration, the QAT procedure 425 selects an example low-quality low-resolution input image 610 from the calibration dataset 415 and processes the input image 610 with the current version of the QAT model 605 to determine an example output image 615. The QAT procedure 425 also processes the input image 610 with the original trained floating point ML model 410 to determine an example reference image 620. The QAT procedure 425 further selects an example high-quality high -resolution image 625 from the calibration dataset 415, which is the counterpart of the low-quality low-resolution input image 610, to be an example ground truth image 625 for his iteration. The QAT procedure 425 then processes the output image 615, the reference image 620 and the ground truth image 625 with an example loss function 630 to update the quantization parameters used to quantize the weights and data of the QAT model 605.
[0043] Returning to FIGS. 3 and 4, in some examples, the model quantization system 300 performs integrated ML quantization as follows. In some examples, the iteration controller circuitry 315 obtains example input parameters, also referred to as initialization parameters, that include (i) the float point ML model 410 to be quantized, represented by the term model, (ii) the calibration dataset 415 from the calibration data storage 325, (iii) a target throughput, represented by the term FPSt, (iv) a target quality, such as such as a target structural similarity index measure, represented by the term SSIMt, a target peak signal-to-noise ratio, represented by the term PSNRt, a target mean squared error, represented by the term MSEt. etc., and (v) a maximum number of successful trials to be performed, represented by the term max_good_trials. In some examples, the output of the model quantization system 300 is one or more quantized ML models 430 corresponding to the float point ML model 410, which are stored to the quantized model storage 330 and / or provided, downloaded, or otherwise used to configure the video quality enhancement circuitry 210.
[0044] In some examples, the iteration controller circuitry 315 selects which one or more, or all, or the layers of floating point ML model 410 are to be quantized. For example, the iteration controller circuitry 315 may initialize a quantizable layers list or other data structure, represented by the term q_layers, to be q_layers = [1, 1, 1, 1, …, 1] , which means all layers of the float point ML model 410 are to be quantized. In this example, the list q_layers includes a number of entries corresponding to the number of layers of the float point ML model 410, and for a given entry, a first value (e.g., “1” ) indicates that the layer corresponding to that entry is to be quantized, and a second value (e.g., “0” ) indicates that the layer corresponding to that entry is to remain unquantized (e.g., to remain as floating point) .
[0045] Next, the iteration controller circuitry 315 invokes the PTQ circuitry 305 and the QAT circuitry 310 to perform successive process iterations of the model quantization procedure 400 to quantize the float point ML model 410. For example, for a given process iteration, the iteration controller circuitry 315 invokes the PTQ circuitry 305 to perform the PTQ procedure 405 to quantize the q_layers of the floating point ML model 410 by (i) inferencing at least a portion of the calibration dataset 415 using the trained floating point ML model 410, (ii) collecting quantization statistics for the selected q_layers of the floating point ML model 410 from inferencing the dataset, (iii) using the collected quantization statistics to determine and apply the weight and data quantization parameters for the respective layers. For example, for each quantizable layer specified in q_layers, the PTQ procedure 405 performed by the PTQ circuitry 305 collects that layer’s weight quantization parameters in the form of the following weight zero_point and scale parameters: Equation 1 zeropointw= -round (scalew*min (W) -128) Equation 2
[0046] In Equations 1 and 2, max (W) refers to the maximum observed weight value, min(W) refers to the minimum observed weight value, and max (255) assumes that the model is to quantized to an INT8 representation, and 255 is the range represented by an 8-bit integer. The PTQ procedure 405 performed by the PTQ circuitry 305 then quantizes the layer’s weights as follows: Equation 3
[0047] The quantization parameters of Equation 1 and Equation 2, and the associated quantization operation of Equation 3, can be performed across all weights of the layer, or per channel for the layer.
[0048] For each quantizable layer specified in q_layers, the PTQ procedure 405 performed by the PTQ circuitry 305 also collects that layer’s input tensor quantization parameters in the form of the following tensor zero_point and scale parameters: Equation 4 zeropointx= -round (scalex*min (X) -128) Equation 5
[0049] The PTQ procedure 405 performed by the PTQ circuitry 305 then uses generated quantization parameters (e.g., scales and zero-points) to generate the initial quantized model 420, represented by the term modelQ.
[0050] Next, the iteration controller circuitry 315 randomly selects one or more data such as a set of images (e.g., K images) , from the calibrate dataset 415 and uses the selected data (e.g., images) to benchmark the throughput of the modelQ. If the benchmarked throughput satisfies (e.g., is equal to or greater than) the target throughput FPSt threshold, iteration controller circuitry 315 continues the current process iterations. Otherwise, the iteration controller circuitry 315 stops the model quantization procedure 400 being performed by the model quantization system 300.
[0051] Next, the iteration controller circuitry 315 invokes the QAT circuitry 310 and uses the quantization parameters (e.g., scales and zero-points) of modelQ to initialize the QAT procedure 425 performed by the QAT circuitry 310. The QAT procedure 425 then uses the calibration dataset 415 to finetune the modelq, as described above, to determine the refined quantized ML model 430.
[0052] Next, the iteration controller circuitry 315 determines one or more quality metrics (e.g., SSIM, PSNR, MSE, etc. ) for the refined quantized ML model 430 based on inferencing a hold-out subset of the calibration dataset 415 using the refined quantized ML model 430. Take MSE as an example. If N is the total number of pixels in an image, pi is the ith pixel intensity of the model output image, and gi is the ith pixel intensity of the ground-truth image, then the iteration controller circuitry 315 can calculate MSE as: Equation 6
[0053] If the quality metric (s) (e.g., SSIM, PSNR, MSE, etc. ) of the refined quantized ML model 430 satisfy (e.g., are greater than or equal to, or less than or equal to, etc., depending on the metric) the quality target threshold (s) (e.g., SSIMt, PSNRt, MSEt, etc. ) , then the iteration controller circuitry 315 outputs and / or saves the refined quantized ML model 430 in the quantized model storage 330 and increments the number of successful trials, represented by the term good_trials (e.g., such that good_trials = good_trials + 1) .
[0054] Next, if good_trials < max_good_trials and sum (q_layers) > 0, then the iteration controller circuitry 315 sets the last non-zero element of the q_layers list to 0 (to cause that additional layer of the ML model to remain unquantized in the next processing iteration) , and restarts a next iteration of the model quantization procedure 400. Otherwise, the iteration controller circuitry 315 ends the model quantization procedure 400.
[0055] Based on the foregoing description, in some examples, the PTQ circuitry 305 of the model quantization system 300 quantizes at least one layer of a trained machine learning model to determine a first (e.g., initial) quantized machine learning model, with the at least one layer of the first quantized machine learning model associated with first quantization parameters (e.g., initial zero_point and scale parameters) . In some such examples, the QAT circuitry 310 of the model quantization system 300 retrains the first quantized machine learning model to determine a second (e.g., refined) quantized machine learning model, with the at least one layer of the second quantized machine learning model associated with second quantization parameters (e.g., refined zero_point and scale parameters) . In some such examples, the iteration controller circuitry 315 of the model quantization system 300 outputs and / or stores the second quantized machine learning model.
[0056] In some examples, the PTQ circuitry 305 quantizes the at least one layer of the trained machine learning model based on a PTQ algorithm, and the QAT circuitry 310 retrains the first quantized machine learning model based on a quantization aware training algorithm. In some examples, the QAT circuitry 310 initializes the QAT algorithm based on the first quantization parameters.
[0057] In some examples, the iteration controller circuitry 315 selects the at least one layer of the trained machine learning model by selecting a subset of initial layers of the machine learning model. In some such examples, unselected one or more layers of the trained machine learning model are not to be quantized. In some such examples, the trained machine learning model is associated with a first floating point precision, the selected subset of the initial layers of the second quantized machine learning model are associated with a first fixed point precision, and the unselected one or more layers of the second quantized machine learning model are associated with the first floating point precision.
[0058] In some such examples, the subset of initial layers is a first subset of initial layers, and the iteration controller circuitry 315 selects a second subset of the initial layers of the trained machine learning model after a quality metric associated with the second quantized machine learning model satisfies a quality target. In some such examples, the second subset of the initial layers includes fewer layers than the first subset of the initial layers. In some such examples, the PTQ circuitry 305 quantizes the second subset of the initial layers of the trained machine learning model to determine a third quantized machine learning model, with unselected ones of the initial layers of the trained machine learning model not to be quantized. In some such examples, the QAT circuitry 310 retrains the third quantized machine learning model to determine a fourth quantized machine learning model after the third quantized machine learning model satisfies a throughput target. In some such examples, the iteration controller circuitry 315 outputs and / or stores the fourth quantized machine learning model after a quality metric associated with the fourth quantized machine learning model satisfies the quality target.
[0059] In some examples, determination of the second quantized machine learning model is associated with a first process iteration, determination of the fourth quantized machine learning model is associated with a second process iteration, and the iteration controller circuitry 315 causes a third process iteration to be performed to determine another quantized machine learning model after a determination that the second subset of the initial layers includes at least one layer and a threshold number of process iterations have not been performed.
[0060] In some examples, the model quantization system 300 includes means for performing a PTQ procedure. For example, the means for performing a PTQ procedure may be implemented by the PTQ circuitry 305. In some examples, the PTQ circuitry 305 may be instantiated by programmable circuitry such as the example programmable circuitry 1012 of FIG. 10. For instance, the PTQ circuitry 305 may be instantiated by the example microprocessor 1100 of FIG. 11 executing machine executable instructions such as those implemented by at least block 815 of FIG. 8. In some examples, the PTQ circuitry 305 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1200 of FIG. 12 configured and / or structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the PTQ circuitry 305 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the PTQ circuitry 305 may be implemented by at least one or more hardware circuits (e.g., processor circuitry, discrete and / or integrated analog and / or digital circuitry, an FPGA, an ASIC, an XPU, a comparator, an operational-amplifier (op-amp) , a logic circuit, etc. ) configured and / or structured to execute some or all of the machine readable instructions and / or to perform some or all of the operations corresponding to the machine readable instructions without executing software or firmware, but other structures are likewise appropriate.
[0061] In some examples, the model quantization system 300 includes means for performing a QAT procedure. For example, the means for performing a QAT procedure may be implemented by the QAT circuitry 310. In some examples, the QAT circuitry 310 may be instantiated by programmable circuitry such as the example programmable circuitry 1012 of FIG. 10. For instance, the QAT circuitry 310 may be instantiated by the example microprocessor 1100 of FIG. 11 executing machine executable instructions such as those implemented by at least block 825 of FIG. 8. In some examples, the QAT circuitry 310 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1200 of FIG. 12 configured and / or structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the QAT circuitry 310 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the QAT circuitry 310 may be implemented by at least one or more hardware circuits (e.g., processor circuitry, discrete and / or integrated analog and / or digital circuitry, an FPGA, an ASIC, an XPU, a comparator, an operational-amplifier (op-amp) , a logic circuit, etc. ) configured and / or structured to execute some or all of the machine readable instructions and / or to perform some or all of the operations corresponding to the machine readable instructions without executing software or firmware, but other structures are likewise appropriate.
[0062] In some examples, the model quantization system 300 includes means for controlling an integrated ML model quantization procedure. For example, the means for controlling an integrated ML model quantization procedure may be implemented by the iteration controller circuitry 315. In some examples, the iteration controller circuitry 315 may be instantiated by programmable circuitry such as the example programmable circuitry 1012 of FIG. 10. For instance, the iteration controller circuitry 315 may be instantiated by the example microprocessor 1100 of FIG. 11 executing machine executable instructions such as those implemented by at least blocks 805, 810, 820, 830, 835 and / or 840 of FIG. 8. In some examples, the iteration controller circuitry 315 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1200 of FIG. 12 configured and / or structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the iteration controller circuitry 315 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the iteration controller circuitry 315 may be implemented by at least one or more hardware circuits (e.g., processor circuitry, discrete and / or integrated analog and / or digital circuitry, an FPGA, an ASIC, an XPU, a comparator, an operational-amplifier (op-amp) , a logic circuit, etc. ) configured and / or structured to execute some or all of the machine readable instructions and / or to perform some or all of the operations corresponding to the machine readable instructions without executing software or firmware, but other structures are likewise appropriate.
[0063] While an example manner of implementing the model quantization system 300 is illustrated in FIG. 3, one or more of the elements, processes, and / or devices illustrated in FIG. 3 may be combined, divided, re-arranged, omitted, eliminated, and / or implemented in any other way. Further, the example PTQ circuitry 305, the example QAT circuitry 310, the example iteration controller circuitry 315, and / or, more generally, the example model quantization system 300 of FIG. 3, may be implemented by hardware alone or by hardware in combination with software and / or firmware. Thus, for example, any of the example PTQ circuitry 305, the example QAT circuitry 310, the example iteration controller circuitry 315, and / or, more generally, the example model quantization system 300, could be implemented by programmable circuitry in combination with machine readable instructions (e.g., firmware or software) , processor circuitry, analog circuit (s) , digital circuit (s) , logic circuit (s) , programmable processor (s) , programmable microcontroller (s) , graphics processing unit (s) (GPU (s) ) , digital signal processor (s) (DSP (s) ) , ASIC (s) , programmable logic device (s) (PLD (s) ) , and / or field programmable logic device (s) (FPLD (s) ) such as FPGAs. Further still, the example model quantization system 300 of FIG. 3 may include one or more elements, processes, and / or devices in addition to, or instead of, those illustrated in FIG. 3, and / or may include more than one of any or all of the illustrated elements, processes and devices.
[0064] A flowchart representative of example machine readable instructions, which may be executed by programmable circuitry to implement and / or instantiate the model quantization system 300 of FIG. 3 and / or representative of example operations which may be performed by programmable circuitry to implement and / or instantiate the model quantization system 300 of FIG. 3, is shown in FIG. 8. The machine readable instructions may be one or more executable programs or portion (s) of one or more executable programs for execution by programmable circuitry such as the programmable circuitry 1012 shown in the example processor platform 1000 discussed below in connection with FIG. 10 and / or may be one or more function (s) or portion (s) of functions to be performed by the example programmable circuitry (e.g., an FPGA) discussed below in connection with FIGS. 11 and / or 12. In some examples, the machine readable instructions cause an operation, a task, etc., to be carried out and / or performed in an automated manner in the real world. As used herein, “automated” means without human involvement.
[0065] The program may be embodied in instructions (e.g., software and / or firmware) stored on one or more non-transitory computer readable and / or machine readable storage medium such as cache memory, a magnetic-storage device or disk (e.g., a floppy disk, a Hard Disk Drive (HDD) , etc. ) , an optical-storage device or disk (e.g., a Blu-ray disk, a Compact Disk (CD) , a Digital Versatile Disk (DVD) , etc. ) , a Redundant Array of Independent Disks (RAID) , a register, ROM, a solid-state drive (SSD) , SSD memory, non-volatile memory (e.g., electrically erasable programmable read-only memory (EEPROM) , flash memory, etc. ) , volatile memory (e.g., Random Access Memory (RAM) of any type, etc. ) , and / or any other storage device or storage disk. The instructions of the non-transitory computer readable and / or machine readable medium may program and / or be executed by programmable circuitry located in one or more hardware devices, but the entire program and / or parts thereof could alternatively be executed and / or instantiated by one or more hardware devices other than the programmable circuitry and / or embodied in dedicated hardware. The machine readable instructions may be distributed across multiple hardware devices and / or executed by two or more hardware devices (e.g., a server and a client hardware device) . For example, the client hardware device may be implemented by an endpoint client hardware device (e.g., a hardware device associated with a human and / or machine user) or an intermediate client hardware device gateway (e.g., a radio access network (RAN) ) that may facilitate communication between a server and an endpoint client hardware device. Similarly, the non-transitory computer readable storage medium may include one or more mediums. Further, although the example program is described with reference to the flowchart illustrated in FIG. 8, many other methods of implementing the example model quantization system 300 may alternatively be used. For example, the order of execution of the blocks of the flowchart may be changed, and / or some of the blocks described may be changed, eliminated, or combined. Additionally or alternatively, any or all of the blocks of the flow chart may be implemented by one or more hardware circuits (e.g., processor circuitry, discrete and / or integrated analog and / or digital circuitry, an FPGA, an ASIC, a comparator, an operational-amplifier (op-amp) , a logic circuit, etc. ) structured to perform the corresponding operation without executing software or firmware. The programmable circuitry may be distributed in different network locations and / or local to one or more hardware devices (e.g., a single-core processor (e.g., a single core CPU) , a multi-core processor (e.g., a multi-core CPU, an XPU, etc. ) ) . For example, the programmable circuitry may be a CPU and / or an FPGA located in the same package (e.g., the same integrated circuit (IC) package or in two or more separate housings) , one or more processors in a single machine, multiple processors distributed across multiple servers of a server rack, multiple processors distributed across one or more server racks, etc., and / or any combination (s) thereof.
[0066] The machine readable instructions described herein may be stored in one or more of a compressed format, an encrypted format, a fragmented format, a compiled format, an executable format, a packaged format, etc. Machine readable instructions as described herein may be stored as data (e.g., computer-readable data, machine-readable data, one or more bits (e.g., one or more computer-readable bits, one or more machine-readable bits, etc. ) , a bitstream (e.g., a computer-readable bitstream, a machine-readable bitstream, etc. ) , etc. ) or a data structure (e.g., as portion (s) of instructions, code, representations of code, etc. ) that may be utilized to create, manufacture, and / or produce machine executable instructions. For example, the machine readable instructions may be fragmented and stored on one or more storage devices, disks and / or computing devices (e.g., servers) located at the same or different locations of a network or collection of networks (e.g., in the cloud, in edge devices, etc. ) . The machine readable instructions may require one or more of installation, modification, adaptation, updating, combining, supplementing, configuring, decryption, decompression, unpacking, distribution, reassignment, compilation, etc., in order to make them directly readable, interpretable, and / or executable by a computing device and / or other machine. For example, the machine readable instructions may be stored in multiple parts, which are individually compressed, encrypted, and / or stored on separate computing devices, wherein the parts when decrypted, decompressed, and / or combined form a set of computer-executable and / or machine executable instructions that implement one or more functions and / or operations that may together form a program such as that described herein.
[0067] In another example, the machine readable instructions may be stored in a state in which they may be read by programmable circuitry, but require addition of a library (e.g., a dynamic link library (DLL) ) , a software development kit (SDK) , an application programming interface (API) , etc., in order to execute the machine-readable instructions on a particular computing device or other device. In another example, the machine readable instructions may need to be configured (e.g., settings stored, data input, network addresses recorded, etc. ) before the machine readable instructions and / or the corresponding program (s) can be executed in whole or in part. Thus, machine readable, computer readable and / or machine readable media, as used herein, may include instructions and / or program (s) regardless of the particular format or state of the machine readable instructions and / or program (s) .
[0068] The machine readable instructions described herein can be represented by any past, present, or future instruction language, scripting language, programming language, etc. For example, the machine readable instructions may be represented using any of the following languages: C, C++, Java, C#, Perl, Python, JavaScript, HyperText Markup Language (HTML) , Structured Query Language (SQL) , Swift, etc.
[0069] As mentioned above, the example operations of FIG. 8 may be implemented using executable instructions (e.g., computer readable and / or machine readable instructions) stored on one or more non-transitory computer readable and / or machine readable media. As used herein, the terms non-transitory computer readable medium, non-transitory computer readable storage medium, non-transitory machine readable medium, and / or non-transitory machine readable storage medium are expressly defined to include any type of computer readable storage device and / or storage disk and to exclude propagating signals and to exclude transmission media. Examples of such non-transitory computer readable medium, non-transitory computer readable storage medium, non-transitory machine readable medium, and / or non-transitory machine readable storage medium include optical storage devices, magnetic storage devices, an HDD, a flash memory, a read-only memory (ROM) , a CD, a DVD, a cache, a RAM of any type, a register, and / or any other storage device or storage disk in which information is stored for any duration (e.g., for extended time periods, permanently, for brief instances, for temporarily buffering, and / or for caching of the information) . As used herein, the terms “non-transitory computer readable storage device” and “non-transitory machine readable storage device” are defined to include any physical (mechanical, magnetic and / or electrical) hardware to retain information for a time period, but to exclude propagating signals and to exclude transmission media. Examples of non-transitory computer readable storage devices and / or non-transitory machine readable storage devices include random access memory of any type, read only memory of any type, solid state memory, flash memory, optical discs, magnetic disks, disk drives, and / or redundant array of independent disks (RAID) systems. As used herein, the term “device” refers to physical structure such as mechanical and / or electrical equipment, hardware, and / or circuitry that may or may not be configured by computer readable instructions, machine readable instructions, etc., and / or manufactured to execute computer-readable instructions, machine-readable instructions, etc.
[0070] FIG. 8 is a flowchart representative of example machine readable instructions and / or example operations 800 that may be executed, instantiated, and / or performed by programmable circuitry to implement the example model quantization system 300 of FIG. 3. The example machine-readable instructions and / or the example operations 800 of FIG. 8 begin at block 805, at which the iteration controller circuitry 315 initializes the model quantization process 400 to be performed by the model quantization system 300, as described above. At block 810, the iteration controller circuitry 315 selects one or more layers of a trained ML model to quantize in the current iteration of the model quantization process 400, as described above. At block 815, the PTQ circuitry 305 quantizes the selected layer (s) of the trained ML model based on a PTQ algorithm to determine an initial quantized ML model for the current process iteration, as described above.
[0071] At block 820, the iteration controller circuitry 315 determines whether the initial quantized ML model satisfies a throughput target, as described above. If the throughput target is not satisfied (corresponding to the NO output of block 820) , the machine-readable instructions and / or the example operations 800 end. However, if the throughput target is satisfied (corresponding to the YES output of block 820) , at block 825, the QAT circuitry 310 retrains the initial quantized ML model based on a QAT algorithm to determine a refined quantized ML model for the current process iteration, as described above.
[0072] At block 830, the iteration controller circuitry 315 determines whether the refined quantized ML model satisfies one or more quality targets, as described above. If the quality target (s) is (are) not satisfied (corresponding to the NO output of block 830) , the machine-readable instructions and / or the example operations 800 end. However, if the quality target (s) is (are) satisfied (corresponding to the YES output of block 830) , at block 835, the iteration controller circuitry 315 outputs and / or stores the refined quantized ML model, as described above.
[0073] At block 840, the iteration controller circuitry 315 determines whether a threshold number of process iterations have been performed, as described above. If the threshold number of process iterations have been performed (corresponding to the YES output of block 840) , the machine-readable instructions and / or the example operations 800 end. However, if the threshold number of process iterations have not been performed (corresponding to the NO output of block 840) , processing returns to block 810 and blocks subsequent thereto at which the iteration controller circuitry 315 causes another iteration of the model quantization process 400 to be performed with fewer layers of the trained ML model to be quantized, as described above.
[0074] FIG. 9 illustrates example performance results 900 achieved by an example machine learning model quantized by the model quantization system 300 of FIG. 3. In the illustrated example, the columns labeled FP32: SSIM and FP32: PSNR provide SSIM and PSNR quality results for a floating point machine learning model. In the illustrated example, the columns labeled QAT: SSIM and QAT: PSNR illustrate SSIM and PSNR quality results for the machine learning model quantized using just a QAT algorithm. In the illustrated example, the columns labeled PTQ+QAT: SSIM and PTQ+QAT: PSNR illustrate SSIM and PSNR quality results for the machine learning model quantized using the integrated ML quantization procedure 400 implemented by the model quantization system 300. As can be seen from the performance results 900, the integrated ML quantization procedure 400 implemented by the model quantization system 300 achieves improved performance over the using just the QAT algorithm.
[0075] Although the example model quantization system 300 of FIG. 3 has been described in the context of quantizing one or more ML models for use in a video quality enhancement system 105, the model quantization system 300 is not limited thereto. The model quantization system 300 and associated procedures described herein can be used to quantize any ML model capable of being quantized with PTQ, QAT or other quantization algorithms. Furthermore, in some examples, the PTQ circuitry 305 of the model quantization system 300 can be adapted to implement one or more quantization procedures in addition to or as an alternative to PTQ, and / or the QAT circuitry 310 of the model quantization system 300 can be adapted to implement one or more quantization procedures in addition to or as an alternative to QAT.
[0076] FIG. 10 is a block diagram of an example programmable circuitry platform 1000 structured to execute and / or instantiate the example machine-readable instructions and / or the example operations of FIG. 8 to implement the model quantization system 300 of FIG. 3. The programmable circuitry platform 1000 can be, for example, a server, a personal computer, a workstation, a self-learning machine (e.g., a neural network) , a mobile device (e.g., a cell phone, a smart phone, a tablet such as an iPadTM) , a personal digital assistant (PDA) , an Internet appliance, a DVD player, a CD player, a digital video recorder, a Blu-ray player, a gaming console, a personal video recorder, a set top box, a headset (e.g., an augmented reality (AR) headset, a virtual reality (VR) headset, etc. ) or other wearable device, or any other type of computing and / or electronic device.
[0077] The programmable circuitry platform 1000 of the illustrated example includes programmable circuitry 1012. The programmable circuitry 1012 of the illustrated example is hardware. For example, the programmable circuitry 1012 can be implemented by one or more integrated circuits, logic circuits, FPGAs, microprocessors, CPUs, GPUs, DSPs, and / or microcontrollers from any desired family or manufacturer. The programmable circuitry 1012 may be implemented by one or more semiconductor based (e.g., silicon based) devices. In this example, the programmable circuitry 1012 implements example PTQ circuitry 305, the example QAT circuitry 310, the example iteration controller circuitry 315, and / or, more generally, the example model quantization system 300.
[0078] The programmable circuitry 1012 of the illustrated example includes a local memory 1013 (e.g., a cache, registers, etc. ) . The programmable circuitry 1012 of the illustrated example is in communication with main memory 1014, 1016, which includes a volatile memory 1014 and a non-volatile memory 1016, by a bus 1018. The volatile memory 1014 may be implemented by Synchronous Dynamic Random Access Memory (SDRAM) , Dynamic Random Access Memory (DRAM) , Dynamic Random Access Memory and / or any other type of RAM device. The non-volatile memory 1016 may be implemented by flash memory and / or any other desired type of memory device. Access to the main memory 1014, 1016 of the illustrated example is controlled by a memory controller 1017. In some examples, the memory controller 1017 may be implemented by one or more integrated circuits, logic circuits, microcontrollers from any desired family or manufacturer, or any other type of circuitry to manage the flow of data going to and from the main memory 1014, 1016.
[0079] The programmable circuitry platform 1000 of the illustrated example also includes interface circuitry 1020. The interface circuitry 1020 may be implemented by hardware in accordance with any type of interface standard, such as an Ethernet interface, a universal serial bus (USB) interface, a interface, a near field communication (NFC) interface, a Peripheral Component Interconnect (PCI) interface, and / or a Peripheral Component Interconnect Express (PCIe) interface.
[0080] In the illustrated example, one or more input devices 1022 are connected to the interface circuitry 1020. The input device (s) 1022 permit (s) a user (e.g., a human user, a machine user, etc. ) to enter data and / or commands into the programmable circuitry 1012. The input device (s) 1022 can be implemented by, for example, an audio sensor, a microphone, a camera (still or video) , a keyboard, a button, a mouse, a touchscreen, a trackpad, a trackball, an isopoint device, and / or a voice recognition system.
[0081] One or more output devices 1024 are also connected to the interface circuitry 1020 of the illustrated example. The output device (s) 1024 can be implemented, for example, by display devices (e.g., a light emitting diode (LED) , an organic light emitting diode (OLED) , a liquid crystal display (LCD) , a cathode ray tube (CRT) display, an in-place switching (IPS) display, a touchscreen, etc. ) , a tactile output device, a printer, and / or speaker. The interface circuitry 1020 of the illustrated example, thus, typically includes a graphics driver card, a graphics driver chip, and / or graphics processor circuitry such as a GPU.
[0082] The interface circuitry 1020 of the illustrated example also includes a communication device such as a transmitter, a receiver, a transceiver, a modem, a residential gateway, a wireless access point, and / or a network interface to facilitate exchange of data with external machines (e.g., computing devices of any kind) by a network 1026. The communication can be by, for example, an Ethernet connection, a digital subscriber line (DSL) connection, a telephone line connection, a coaxial cable system, a satellite system, a beyond-line-of-sight wireless system, a line-of-sight wireless system, a cellular telephone system, an optical connection, etc.
[0083] The programmable circuitry platform 1000 of the illustrated example also includes one or more mass storage discs or devices 1028 to store firmware, software, and / or data. Examples of such mass storage discs or devices 1028 include magnetic storage devices (e.g., floppy disk, drives, HDDs, etc. ) , optical storage devices (e.g., Blu-ray disks, CDs, DVDs, etc. ) , RAID systems, and / or solid-state storage discs or devices such as flash memory devices and / or SSDs.
[0084] The machine readable instructions 1032, which may be implemented by the machine readable instructions of FIG. 8, may be stored in the mass storage device 1028, in the volatile memory 1014, in the non-volatile memory 1016, and / or on at least one non-transitory computer readable storage medium such as a CD or DVD which may be removable.
[0085] FIG. 11 is a block diagram of an example implementation of the programmable circuitry 1012 of FIG. 10. In this example, the programmable circuitry 1012 of FIG. 10 is implemented by a microprocessor 1100. For example, the microprocessor 1100 may be a general-purpose microprocessor (e.g., general-purpose microprocessor circuitry) . The microprocessor 1100 executes some or all of the machine-readable instructions of the flowchart of FIG. 8 to effectively instantiate the circuitry of FIG. 3 as logic circuits to perform operations corresponding to those machine readable instructions. In some such examples, the circuitry of FIG. 3 is instantiated by the hardware circuits of the microprocessor 1100 in combination with the machine-readable instructions. For example, the microprocessor 1100 may be implemented by multi-core hardware circuitry such as a CPU, a DSP, a GPU, an XPU, etc. Although it may include any number of example cores 1102 (e.g., 1 core) , the microprocessor 1100 of this example is a multi-core semiconductor device including N cores. The cores 1102 of the microprocessor 1100 may operate independently or may cooperate to execute machine readable instructions. For example, machine code corresponding to a firmware program, an embedded software program, or a software program may be executed by one of the cores 1102 or may be executed by multiple ones of the cores 1102 at the same or different times. In some examples, the machine code corresponding to the firmware program, the embedded software program, or the software program is split into threads and executed in parallel by two or more of the cores 1102. The software program may correspond to a portion or all of the machine readable instructions and / or operations represented by the flowchart of FIG. 8.
[0086] The cores 1102 may communicate by a first example bus 1104. In some examples, the first bus 1104 may be implemented by a communication bus to effectuate communication associated with one (s) of the cores 1102. For example, the first bus 1104 may be implemented by at least one of an Inter-Integrated Circuit (I2C) bus, a Serial Peripheral Interface (SPI) bus, a PCI bus, or a PCIe bus. Additionally or alternatively, the first bus 1104 may be implemented by any other type of computing or electrical bus. The cores 1102 may obtain data, instructions, and / or signals from one or more external devices by example interface circuitry 1106. The cores 1102 may output data, instructions, and / or signals to the one or more external devices by the interface circuitry 1106. Although the cores 1102 of this example include example local memory 1120 (e.g., Level 1 (L1) cache that may be split into an L1 data cache and an L1 instruction cache) , the microprocessor 1100 also includes example shared memory 1110 that may be shared by the cores (e.g., Level 2 (L2 cache) ) for high-speed access to data and / or instructions. Data and / or instructions may be transferred (e.g., shared) by writing to and / or reading from the shared memory 1110. The local memory 1120 of each of the cores 1102 and the shared memory 1110 may be part of a hierarchy of storage devices including multiple levels of cache memory and the main memory (e.g., the main memory 1014, 1016 of FIG. 10) . Typically, higher levels of memory in the hierarchy exhibit lower access time and have smaller storage capacity than lower levels of memory. Changes in the various levels of the cache hierarchy are managed (e.g., coordinated) by a cache coherency policy.
[0087] Each core 1102 may be referred to as a CPU, DSP, GPU, etc., or any other type of hardware circuitry. Each core 1102 includes control unit circuitry 1114, arithmetic and logic (AL) circuitry (sometimes referred to as an ALU) 1116, a plurality of registers 1118, the local memory 1120, and a second example bus 1122. Other structures may be present. For example, each core 1102 may include vector unit circuitry, single instruction multiple data (SIMD) unit circuitry, load / store unit (LSU) circuitry, branch / jump unit circuitry, floating-point unit (FPU) circuitry, etc. The control unit circuitry 1114 includes semiconductor-based circuits structured to control (e.g., coordinate) data movement within the corresponding core 1102. The AL circuitry 1116 includes semiconductor-based circuits structured to perform one or more mathematic and / or logic operations on the data within the corresponding core 1102. The AL circuitry 1116 of some examples performs integer based operations. In other examples, the AL circuitry 1116 also performs floating-point operations. In yet other examples, the AL circuitry 1116 may include first AL circuitry that performs integer-based operations and second AL circuitry that performs floating-point operations. In some examples, the AL circuitry 1116 may be referred to as an Arithmetic Logic Unit (ALU) .
[0088] The registers 1118 are semiconductor-based structures to store data and / or instructions such as results of one or more of the operations performed by the AL circuitry 1116 of the corresponding core 1102. For example, the registers 1118 may include vector register (s) , SIMD register (s) , general-purpose register (s) , flag register (s) , segment register (s) , machine-specific register (s) , instruction pointer register (s) , control register (s) , debug register (s) , memory management register (s) , machine check register (s) , etc. The registers 1118 may be arranged in a bank as shown in FIG. 11. Alternatively, the registers 1118 may be organized in any other arrangement, format, or structure, such as by being distributed throughout the core 1102 to shorten access time. The second bus 1122 may be implemented by at least one of an I2C bus, a SPI bus, a PCI bus, or a PCIe bus.
[0089] Each core 1102 and / or, more generally, the microprocessor 1100 may include additional and / or alternate structures to those shown and described above. For example, one or more clock circuits, one or more power supplies, one or more power gates, one or more cache home agents (CHAs) , one or more converged / common mesh stops (CMSs) , one or more shifters (e.g., barrel shifter (s) ) and / or other circuitry may be present. The microprocessor 1100 is a semiconductor device fabricated to include many transistors interconnected to implement the structures described above in one or more integrated circuits (ICs) contained in one or more packages.
[0090] The microprocessor 1100 may include and / or cooperate with one or more accelerators (e.g., acceleration circuitry, hardware accelerators, etc. ) . In some examples, accelerators are implemented by logic circuitry to perform certain tasks more quickly and / or efficiently than can be done by a general-purpose processor. Examples of accelerators include ASICs and FPGAs such as those discussed herein. A GPU, DSP and / or other programmable device can also be an accelerator. Accelerators may be on-board the microprocessor 1100, in the same chip package as the microprocessor 1100 and / or in one or more separate packages from the microprocessor 1100.
[0091] FIG. 12 is a block diagram of another example implementation of the programmable circuitry 1012 of FIG. 10. In this example, the programmable circuitry 1012 is implemented by FPGA circuitry 1200. For example, the FPGA circuitry 1200 may be implemented by an FPGA. The FPGA circuitry 1200 can be used, for example, to perform operations that could otherwise be performed by the example microprocessor 1100 of FIG. 11 executing corresponding machine readable instructions. However, once configured, the FPGA circuitry 1200 instantiates the operations and / or functions corresponding to the machine readable instructions in hardware and, thus, can often execute the operations / functions faster than they could be performed by a general-purpose microprocessor executing the corresponding software.
[0092] More specifically, in contrast to the microprocessor 1100 of FIG. 11 described above (which is a general purpose device that may be programmed to execute some or all of the machine readable instructions represented by the flowchart of FIG. 8 but whose interconnections and logic circuitry are fixed once fabricated) , the FPGA circuitry 1200 of the example of FIG. 12 includes interconnections and logic circuitry that may be configured, structured, programmed, and / or interconnected in different ways after fabrication to instantiate, for example, some or all of the operations / functions corresponding to the machine readable instructions represented by the flowchart of FIG. 8. In particular, the FPGA circuitry 1200 may be thought of as an array of logic gates, interconnections, and switches. The switches can be programmed to change how the logic gates are interconnected by the interconnections, effectively forming one or more dedicated logic circuits (unless and until the FPGA circuitry 1200 is reprogrammed) . The configured logic circuits enable the logic gates to cooperate in different ways to perform different operations on data received by input circuitry. Those operations may correspond to some or all of the instructions (e.g., the software and / or firmware) represented by the flowchart of FIG. 8. As such, the FPGA circuitry 1200 may be configured and / or structured to effectively instantiate some or all of the operations / functions corresponding to the machine readable instructions of the flowchart of FIG. 8 as dedicated logic circuits to perform the operations / functions corresponding to those software instructions in a dedicated manner analogous to an ASIC. Therefore, the FPGA circuitry 1200 may perform the operations / functions corresponding to the some or all of the machine readable instructions of FIG. 8 faster than the general-purpose microprocessor can execute the same.
[0093] In the example of FIG. 12, the FPGA circuitry 1200 is configured and / or structured in response to being programmed (and / or reprogrammed one or more times) based on a binary file. In some examples, the binary file may be compiled and / or generated based on instructions in a hardware description language (HDL) such as Lucid, Very High Speed Integrated Circuits (VHSIC) Hardware Description Language (VHDL) , or Verilog. For example, a user (e.g., a human user, a machine user, etc. ) may write code or a program corresponding to one or more operations / functions in an HDL; the code / program may be translated into a low-level language as needed; and the code / program (e.g., the code / program in the low-level language) may be converted (e.g., by a compiler, a software application, etc. ) into the binary file. In some examples, the FPGA circuitry 1200 of FIG. 12 may access and / or load the binary file to cause the FPGA circuitry 1200 of FIG. 12 to be configured and / or structured to perform the one or more operations / functions. For example, the binary file may be implemented by a bit stream (e.g., one or more computer-readable bits, one or more machine-readable bits, etc. ) , data (e.g., computer-readable data, machine-readable data, etc. ) , and / or machine-readable instructions accessible to the FPGA circuitry 1200 of FIG. 12 to cause configuration and / or structuring of the FPGA circuitry 1200 of FIG. 12, or portion (s) thereof.
[0094] In some examples, the binary file is compiled, generated, transformed, and / or otherwise output from a uniform software platform utilized to program FPGAs. For example, the uniform software platform may translate first instructions (e.g., code or a program) that correspond to one or more operations / functions in a high-level language (e.g., C, C++, Python, etc. ) into second instructions that correspond to the one or more operations / functions in an HDL. In some such examples, the binary file is compiled, generated, and / or otherwise output from the uniform software platform based on the second instructions. In some examples, the FPGA circuitry 1200 of FIG. 12 may access and / or load the binary file to cause the FPGA circuitry 1200 of FIG. 12 to be configured and / or structured to perform the one or more operations / functions. For example, the binary file may be implemented by a bit stream (e.g., one or more computer-readable bits, one or more machine-readable bits, etc. ) , data (e.g., computer-readable data, machine-readable data, etc. ) , and / or machine-readable instructions accessible to the FPGA circuitry 1200 of FIG. 12 to cause configuration and / or structuring of the FPGA circuitry 1200 of FIG. 12, or portion (s) thereof.
[0095] The FPGA circuitry 1200 of FIG. 12, includes example input / output (I / O) circuitry 1202 to obtain and / or output data to / from example configuration circuitry 1204 and / or external hardware 1206. For example, the configuration circuitry 1204 may be implemented by interface circuitry that may obtain a binary file, which may be implemented by a bit stream, data, and / or machine-readable instructions, to configure the FPGA circuitry 1200, or portion (s) thereof. In some such examples, the configuration circuitry 1204 may obtain the binary file from a user, a machine (e.g., hardware circuitry (e.g., programmable or dedicated circuitry) that may implement an Artificial Intelligence / Machine Learning (AI / ML) model to generate the binary file) , etc., and / or any combination (s) thereof) . In some examples, the external hardware 1206 may be implemented by external hardware circuitry. For example, the external hardware 1206 may be implemented by the microprocessor 1100 of FIG. 11.
[0096] The FPGA circuitry 1200 also includes an array of example logic gate circuitry 1208, a plurality of example configurable interconnections 1210, and example storage circuitry 1212. The logic gate circuitry 1208 and the configurable interconnections 1210 are configurable to instantiate one or more operations / functions that may correspond to at least some of the machine readable instructions of FIG. 8 and / or other desired operations. The logic gate circuitry 1208 shown in FIG. 12 is fabricated in blocks or groups. Each block includes semiconductor-based electrical structures that may be configured into logic circuits. In some examples, the electrical structures include logic gates (e.g., And gates, Or gates, Nor gates, etc. ) that provide basic building blocks for logic circuits. Electrically controllable switches (e.g., transistors) are present within each of the logic gate circuitry 1208 to enable configuration of the electrical structures and / or the logic gates to form circuits to perform desired operations / functions. The logic gate circuitry 1208 may include other electrical structures such as look-up tables (LUTs) , registers (e.g., flip-flops or latches) , multiplexers, etc.
[0097] The configurable interconnections 1210 of the illustrated example are conductive pathways, traces, vias, or the like that may include electrically controllable switches (e.g., transistors) whose state can be changed by programming (e.g., using an HDL instruction language) to activate or deactivate one or more connections between one or more of the logic gate circuitry 1208 to program desired logic circuits.
[0098] The storage circuitry 1212 of the illustrated example is structured to store result (s) of the one or more of the operations performed by corresponding logic gates. The storage circuitry 1212 may be implemented by registers or the like. In the illustrated example, the storage circuitry 1212 is distributed amongst the logic gate circuitry 1208 to facilitate access and increase execution speed.
[0099] The example FPGA circuitry 1200 of FIG. 12 also includes example dedicated operations circuitry 1214. In this example, the dedicated operations circuitry 1214 includes special purpose circuitry 1216 that may be invoked to implement commonly used functions to avoid the need to program those functions in the field. Examples of such special purpose circuitry 1216 include memory (e.g., DRAM) controller circuitry, PCIe controller circuitry, clock circuitry, transceiver circuitry, memory, and multiplier-accumulator circuitry. Other types of special purpose circuitry may be present. In some examples, the FPGA circuitry 1200 may also include example general purpose programmable circuitry 1218 such as an example CPU 1220 and / or an example DSP 1222. Other general purpose programmable circuitry 1218 may additionally or alternatively be present such as a GPU, an XPU, etc., that can be programmed to perform other operations.
[0100] Although FIGS. 11 and 12 illustrate two example implementations of the programmable circuitry 1012 of FIG. 10, many other approaches are contemplated. For example, FPGA circuitry may include an on-board CPU, such as one or more of the example CPU 1220 of FIG. 11. Therefore, the programmable circuitry 1012 of FIG. 10 may additionally be implemented by combining at least the example microprocessor 1100 of FIG. 11 and the example FPGA circuitry 1200 of FIG. 12. In some such hybrid examples, one or more cores 1102 of FIG. 11 may execute a first portion of the machine readable instructions represented by the flowchart of FIG. 8 to perform first operation (s) / function (s) , the FPGA circuitry 1200 of FIG. 12 may be configured and / or structured to perform second operation (s) / function (s) corresponding to a second portion of the machine readable instructions represented by the flowchart of FIG. 8, and / or an ASIC may be configured and / or structured to perform third operation (s) / function (s) corresponding to a third portion of the machine readable instructions represented by the flowchart of FIG. 8.
[0101] It should be understood that some or all of the circuitry of FIG. 3 may, thus, be instantiated at the same or different times. For example, same and / or different portion (s) of the microprocessor 1100 of FIG. 11 may be programmed to execute portion (s) of machine-readable instructions at the same and / or different times. In some examples, same and / or different portion (s) of the FPGA circuitry 1200 of FIG. 12 may be configured and / or structured to perform operations / functions corresponding to portion (s) of machine-readable instructions at the same and / or different times.
[0102] In some examples, some or all of the circuitry of FIG. 3 may be instantiated, for example, in one or more threads executing concurrently and / or in series. For example, the microprocessor 1100 of FIG. 11 may execute machine readable instructions in one or more threads executing concurrently and / or in series. In some examples, the FPGA circuitry 1200 of FIG. 12 may be configured and / or structured to carry out operations / functions concurrently and / or in series. Moreover, in some examples, some or all of the circuitry of FIG. 3 may be implemented within one or more virtual machines and / or containers executing on the microprocessor 1100 of FIG. 11.
[0103] In some examples, the programmable circuitry 1012 of FIG. 10 may be in one or more packages. For example, the microprocessor 1100 of FIG. 11 and / or the FPGA circuitry 1200 of FIG. 12 may be in one or more packages. In some examples, an XPU may be implemented by the programmable circuitry 1012 of FIG. 10, which may be in one or more packages. For example, the XPU may include a CPU (e.g., the microprocessor 1100 of FIG. 11, the CPU 1220 of FIG. 12, etc. ) in one package, a DSP (e.g., the DSP 1222 of FIG. 12) in another package, a GPU in yet another package, and an FPGA (e.g., the FPGA circuitry 1200 of FIG. 12) in still yet another package.
[0104] A block diagram illustrating an example software distribution platform 1305 to distribute software such as the example machine readable instructions 1032 of FIG. 10 to other hardware devices (e.g., hardware devices owned and / or operated by third parties from the owner and / or operator of the software distribution platform) is illustrated in FIG. 13. The example software distribution platform 1305 may be implemented by any computer server, data facility, cloud service, etc., capable of storing and transmitting software to other computing devices. The third parties may be customers of the entity owning and / or operating the software distribution platform 1305. For example, the entity that owns and / or operates the software distribution platform 1305 may be a developer, a seller, and / or a licensor of software such as the example machine readable instructions 1032 of FIG. 10. The third parties may be consumers, users, retailers, OEMs, etc., who purchase and / or license the software for use and / or re-sale and / or sub-licensing. In the illustrated example, the software distribution platform 1305 includes one or more servers and one or more storage devices. The storage devices store the machine readable instructions 1032, which may correspond to the example machine readable instructions of FIG. 8, as described above. The one or more servers of the example software distribution platform 1305 are in communication with an example network 1310, which may correspond to any one or more of the Internet and / or any of the example networks described above. In some examples, the one or more servers are responsive to requests to transmit the software to a requesting party as part of a commercial transaction. Payment for the delivery, sale, and / or license of the software may be handled by the one or more servers of the software distribution platform and / or by a third party payment entity. The servers enable purchasers and / or licensors to download the machine readable instructions 1032 from the software distribution platform 1305. For example, the software, which may correspond to the example machine readable instructions of FIG. 8, may be downloaded to the example programmable circuitry platform 1000, which is to execute the machine readable instructions 1032 to implement the model quantization system 300. In some examples, one or more servers of the software distribution platform 1305 periodically offer, transmit, and / or force updates to the software (e.g., the example machine readable instructions 1032 of FIG. 10) to ensure improvements, patches, updates, etc., are distributed and applied to the software at the end user devices. Although referred to as software above, the distributed “software” could alternatively be firmware.
[0105] “Including” and “comprising” (and all forms and tenses thereof) are used herein to be open ended terms. Thus, whenever a claim employs any form of “include” or “comprise” (e.g., comprises, includes, comprising, including, having, etc. ) as a preamble or within a claim recitation of any kind, it is to be understood that additional elements, terms, etc., may be present without falling outside the scope of the corresponding claim or recitation. As used herein, when the phrase “at least” is used as the transition term in, for example, a preamble of a claim, it is open-ended in the same manner as the term “comprising” and “including” are open ended. The term “and / or” when used, for example, in a form such as A, B, and / or C refers to any combination or subset of A, B, C such as (1) A alone, (2) B alone, (3) C alone, (4) A with B, (5) A with C, (6) B with C, or (7) A with B and with C. As used herein in the context of describing structures, components, items, objects and / or things, the phrase “at least one of A and B” is intended to refer to implementations including any of (1) at least one A, (2) at least one B, or (3) at least one A and at least one B. Similarly, as used herein in the context of describing structures, components, items, objects and / or things, the phrase “at least one of A or B” is intended to refer to implementations including any of (1) at least one A, (2) at least one B, or (3) at least one A and at least one B. As used herein in the context of describing the performance or execution of processes, instructions, actions, activities, etc., the phrase “at least one of A and B” is intended to refer to implementations including any of (1) at least one A, (2) at least one B, or (3) at least one A and at least one B. Similarly, as used herein in the context of describing the performance or execution of processes, instructions, actions, activities, etc., the phrase “at least one of A or B” is intended to refer to implementations including any of (1) at least one A, (2) at least one B, or (3) at least one A and at least one B.
[0106] As used herein, singular references (e.g., “a” , “an” , “first” , “second” , etc. ) do not exclude a plurality. The term “a” or “an” object, as used herein, refers to one or more of that object. The terms “a” (or “an” ) , “one or more” , and “at least one” are used interchangeably herein. Furthermore, although individually listed, a plurality of means, elements, or actions may be implemented by, e.g., the same entity or object. Additionally, although individual features may be included in different examples or claims, these may possibly be combined, and the inclusion in different examples or claims does not imply that a combination of features is not feasible and / or advantageous.
[0107] As used in this patent, stating that any part (e.g., a layer, film, area, region, or plate) is in any way on (e.g., positioned on, located on, disposed on, or formed on, etc. ) another part, indicates that the referenced part is either in contact with the other part, or that the referenced part is above the other part with one or more intermediate part (s) located therebetween.
[0108] As used herein, connection references (e.g., attached, coupled, connected, and joined) may include intermediate members between the elements referenced by the connection reference and / or relative movement between those elements unless otherwise indicated. As such, connection references do not necessarily infer that two elements are directly connected and / or in fixed relation to each other. As used herein, stating that any part is in “contact” with another part is defined to mean that there is no intermediate part between the two parts.
[0109] Unless specifically stated otherwise, descriptors such as “first, ” “second, ” “third, ” etc., are used herein without imputing or otherwise indicating any meaning of priority, physical order, arrangement in a list, and / or ordering in any way, but are merely used as labels and / or arbitrary names to distinguish elements for ease of understanding the disclosed examples. In some examples, the descriptor “first” may be used to refer to an element in the detailed description, while the same element may be referred to in a claim with a different descriptor such as “second” or “third. ” In such instances, it should be understood that such descriptors are used merely for identifying those elements distinctly within the context of the discussion (e.g., within a claim) in which the elements might, for example, otherwise share a same name.
[0110] As used herein, “approximately” and “about” modify their subjects / values to recognize the potential presence of variations that occur in real world applications. For example, “approximately” and “about” may modify dimensions that may not be exact due to manufacturing tolerances and / or other real world imperfections as will be understood by persons of ordinary skill in the art. For example, “approximately” and “about” may indicate such dimensions may be within a tolerance range of + / -10%unless otherwise specified herein.
[0111] As used herein “substantially real time” refers to occurrence in a near instantaneous manner recognizing there may be real world delays for computing time, transmission, etc. Thus, unless otherwise specified, “substantially real time” refers to real time + 1 second.
[0112] As used herein, the phrase “in communication, ” including variations thereof, encompasses direct communication and / or indirect communication through one or more intermediary components, and does not require direct physical (e.g., wired) communication and / or constant communication, but rather additionally includes selective communication at periodic intervals, scheduled intervals, aperiodic intervals, and / or one-time events.
[0113] As used herein, “programmable circuitry” is defined to include (i) one or more special purpose electrical circuits (e.g., an application specific circuit (ASIC) ) structured to perform specific operation (s) and including one or more semiconductor-based logic devices (e.g., electrical hardware implemented by one or more transistors) , and / or (ii) one or more general purpose semiconductor-based electrical circuits programmable with instructions to perform specific functions (s) and / or operation (s) and including one or more semiconductor-based logic devices (e.g., electrical hardware implemented by one or more transistors) . Examples of programmable circuitry include programmable microprocessors such as Central Processor Units (CPUs) that may execute first instructions to perform one or more operations and / or functions, Field Programmable Gate Arrays (FPGAs) that may be programmed with second instructions to cause configuration and / or structuring of the FPGAs to instantiate one or more operations and / or functions corresponding to the first instructions, Graphics Processor Units (GPUs) that may execute first instructions to perform one or more operations and / or functions, Digital Signal Processors (DSPs) that may execute first instructions to perform one or more operations and / or functions, XPUs, Network Processing Units (NPUs) one or more microcontrollers that may execute first instructions to perform one or more operations and / or functions and / or integrated circuits such as Application Specific Integrated Circuits (ASICs) . For example, an XPU may be implemented by a heterogeneous computing system including multiple types of programmable circuitry (e.g., one or more FPGAs, one or more CPUs, one or more GPUs, one or more NPUs, one or more DSPs, etc., and / or any combination (s) thereof) , and orchestration technology (e.g., application programming interface (s) (API (s) ) that may assign computing task (s) to whichever one (s) of the multiple types of programmable circuitry is / are suited and available to perform the computing task (s) .
[0114] As used herein integrated circuit / circuitry is defined as one or more semiconductor packages containing one or more circuit elements such as transistors, capacitors, inductors, resistors, current paths, diodes, etc. For example an integrated circuit may be implemented as one or more of an ASIC, an FPGA, a chip, a microchip, programmable circuitry, a semiconductor substrate coupling multiple circuit elements, a system on chip (SoC) , etc.
[0115] From the foregoing, it will be appreciated that example systems, apparatus, articles of manufacture, and methods have been disclosed that perform integrated machine learning model quantization. Disclosed systems, apparatus, articles of manufacture, and methods improve the efficiency of using a computing device by integrating multiple ML model quantization procedures in manners that are able to output quantized machine learning models that meet video throughput target (s) and video quality target (s) , and that are able to be implemented on a CPU converged system. For example, disclosed integrated machine learning model quantization techniques are able to meet target quantitative and subjective image quality requirement in a cloud platform implementation while also meeting real-time target throughput requirements (e.g., >25 fps operation) . Disclosed systems, apparatus, articles of manufacture, and methods are accordingly directed to one or more improvement (s) in the operation of a machine such as a computer or other electronic and / or mechanical device.
[0116] Further examples and combinations thereof include the following. Example 1 includes at least one non-transitory computer readable medium comprising computer readable instructions to cause at least one processor circuit to at least for a layer of a plurality of layers of a trained machine learning model inference a dataset using the trained machine learning model, collect quantization statistics from inferencing the dataset, and quantize the layer of the trained machine learning model based on the collected quantization statistics, generate a first quantized machine learning model based on the quantized layer of the trained machine learning model, and retrain the first quantized machine learning model based on the dataset to generate a second quantized machine learning model.
[0117] Example 2 includes the at least one non-transitory computer readable medium of example 1, wherein the instructions are to cause one or more of the at least one processor circuit to quantize the layer of the trained machine learning model by generating a tensor quantization scale and a tensor quantization zero point based on the collected quantization statistics, and generating a weight quantization scale and a weight quantization zero point based on the collected quantization statistics.
[0118] Example 3 includes the at least one non-transitory computer readable medium of example 2, wherein the instructions are to cause one or more of the at least one processor circuit to select one or more data from the dataset, generate an output by inferencing the selected one or more data using the first quantized machine learning model, and compare the output with a threshold.
[0119] Example 4 includes the at least one non-transitory computer readable medium of example 3, wherein the instructions are to cause one or more of the at least one processor circuit to initialize an algorithm based on the tensor quantization scale, tensor quantization zero point, the weight quantization scale and the weight quantization zero point after a determination that the output satisfies the threshold, the first quantized machine learning model to be retrained based on the algorithm to generate the second quantized machine learning model.
[0120] Example 5 includes the at least one non-transitory computer readable medium of example 4, wherein the instructions are to cause one or more of the at least one processor circuit to select a hold-out subset of the dataset, generate a quality metric associated with inferencing the hold-out subset using the second quantized machine learning model, and compare the quality metric with a second threshold.
[0121] Example 6 includes the at least one non-transitory computer readable medium of example 5, wherein the instructions are to cause one or more of the at least one processor circuit to at least one of output or store the second quantized machine learning model after a determination that the quality metric satisfies the second threshold.
[0122] Example 7 includes the at least one non-transitory computer readable medium of example 6, wherein the instructions are to cause one or more of the at least one processor circuit to select a subset of the layers of the trained machine learning model after the quality metric satisfies the second threshold, and perform another process iteration to quantize the subset of the layers of the trained machine learning model and determine a third quantized machine learning model based on the quantized subset of the layers of the trained machine learning model, unselected ones of the subset of the layers not to be quantized in the third quantized machine learning model.
[0123] Example 8 includes the at least one non-transitory computer readable medium of any one of examples 5 to 7, wherein the instructions are to cause one or more of the at least one processor circuit to discard the second quantized machine learning model after a determination that the quality metric does not satisfy the second threshold.
[0124] Example 9 includes the at least one non-transitory computer readable medium of any one of examples 4 to 8, wherein the trained machine learning model is a floating point machine learning model, and the algorithm includes a quantization aware training algorithm.
[0125] Example 10 includes an apparatus comprising interface circuitry, machine readable instructions, and at least one processor circuit to be programmed based on the machine readable instructions to inference a dataset using a trained machine learning model, collect quantization statistics for a layer of the trained machine learning model from inferencing the dataset, the trained machine learning model including a plurality of layers, quantize the layer of the trained machine learning model based on the collected quantization statistics, generate a first quantized machine learning model based on the quantized layer of the trained machine learning model, and retrain the first quantized machine learning model based on the dataset to generate a second quantized machine learning model.
[0126] Example 11 includes the apparatus of example 10, wherein one or more of the at least one processor circuit is to generate quantization scale and zero point parameters based on the collected quantization statistics, and quantize the layer of the trained machine learning model based on the quantization scale and zero point parameters.
[0127] Example 12 includes the apparatus of example 11, wherein one or more of the at least one processor circuit is to select one or more data from the dataset, generate an output by inferencing the selected one or more data using the first quantized machine learning model, and compare the output with a threshold.
[0128] Example 13 includes the apparatus of example 12, wherein one or more of the at least one processor circuit to initialize an algorithm based on the quantization scale and zero point parameters after a determination that the output satisfies the threshold, the first quantized machine learning model to be retrained based on the algorithm to generate the second quantized machine learning model.
[0129] Example 14 includes the apparatus of example 13, wherein one or more of the at least one processor circuit is to select a hold-out subset of the dataset, generate a quality metric associated with inferencing the hold-out subset using the second quantized machine learning model, and compare the quality metric with a second threshold.
[0130] Example 15 includes the apparatus of example 14, wherein one or more of the at least one processor circuit is to determine the quality metric satisfies the second threshold, at least one of output or store the second quantized machine learning model, select a subset of the layers of the trained machine learning model, and perform another process iteration to (i) quantize the subset of the layers of the trained machine learning model and (ii) determine a third quantized machine learning model based on the quantized subset of the layers of the trained machine learning model, unselected ones of the subset of layers not to be quantized in the third quantized machine learning model.
[0131] Example 16 includes an apparatus comprising interface circuitry, machine readable instructions, and at least one processor circuit to be programmed based on the machine readable instructions to quantize at least one layer of a trained machine learning model based on a first algorithm to determine a first quantized machine learning model, the trained machine learning model including a plurality of layers, retrain the first quantized machine learning model based on a second algorithm to determine a second quantized machine learning model, and at least one of output or store the second quantized machine learning model.
[0132] Example 17 includes the apparatus of example 16, wherein the first algorithm includes a post training quantization algorithm, and the second algorithm includes a quantization aware training algorithm.
[0133] Example 18 includes the apparatus of example 17, wherein one or more of the at least one processor circuit is to initialize the quantization aware training algorithm based on quantization parameters associated with the first quantized machine learning model.
[0134] Example 19 includes the apparatus of any one of examples 16 to 18, wherein one or more of the at least one processor circuit is to select a subset of the layers of the trained machine learning model after a quality metric associated with the second quantized machine learning model satisfies a quality target, quantize the subset of the layers of the trained machine learning model, and determine a third quantized machine learning model based on the quantized subset of the layers of the trained machine learning model, unselected ones of the subset of the layers not to be quantized in the third quantized machine learning model .
[0135] Example 20 includes the apparatus of example 19, wherein the trained machine learning model is associated with a first floating point precision, the selected subset of the layers of the third quantized machine learning model are associated with a first fixed point precision, and the unselected ones of the subset of the layers of the third quantized machine learning model are associated with the first floating point precision.
[0136] Example 21 includes the apparatus of example 16, wherein one or more of the at least one processor circuit is to select a subset of the layers of the trained machine learning model to be quantized to determine the first quantized machine learning model, and ones of the layers not in the subset not to be quantized in the first quantized machine learning model.
[0137] The following claims are hereby incorporated into this Detailed Description by this reference. Although certain example systems, apparatus, articles of manufacture, and methods have been disclosed herein, the scope of coverage of this patent is not limited thereto. On the contrary, this patent covers all systems, apparatus, articles of manufacture, and methods fairly falling within the scope of the claims of this patent.
Claims
1.At least one non-transitory computer readable medium comprising computer readable instructions to cause at least one processor circuit to at least:for a layer of a plurality of layers of a trained machine learning model:inference a dataset using the trained machine learning model;collect quantization statistics from inferencing the dataset; andquantize the layer of the trained machine learning model based on the collected quantization statistics;generate a first quantized machine learning model based on the quantized layer of the trained machine learning model; andretrain the first quantized machine learning model based on the dataset to generate a second quantized machine learning model.2.The at least one non-transitory computer readable medium of claim 1, wherein the instructions are to cause one or more of the at least one processor circuit to quantize the layer of the trained machine learning model by:generating a tensor quantization scale and a tensor quantization zero point based on the collected quantization statistics; andgenerating a weight quantization scale and a weight quantization zero point based on the collected quantization statistics.3.The at least one non-transitory computer readable medium of claim 2, wherein the instructions are to cause one or more of the at least one processor circuit to:select one or more data from the dataset;generate an output by inferencing the selected one or more data using the first quantized machine learning model; andcompare the output with a threshold.4.The at least one non-transitory computer readable medium of claim 3, wherein the instructions are to cause one or more of the at least one processor circuit to initialize an algorithm based on the tensor quantization scale, tensor quantization zero point, the weight quantization scale and the weight quantization zero point after a determination that the output satisfies the threshold, the first quantized machine learning model to be retrained based on the algorithm to generate the second quantized machine learning model.5.The at least one non-transitory computer readable medium of claim 4, wherein the instructions are to cause one or more of the at least one processor circuit to:select a hold-out subset of the dataset;generate a quality metric associated with inferencing the hold-out subset using the second quantized machine learning model; andcompare the quality metric with a second threshold.6.The at least one non-transitory computer readable medium of claim 5, wherein the instructions are to cause one or more of the at least one processor circuit to at least one of output or store the second quantized machine learning model after a determination that the quality metric satisfies the second threshold.7.The at least one non-transitory computer readable medium of claim 6, wherein the instructions are to cause one or more of the at least one processor circuit to:select a subset of the layers of the trained machine learning model after the quality metric satisfies the second threshold; andperform another process iteration to quantize the subset of the layers of the trained machine learning model and determine a third quantized machine learning model based on the quantized subset of the layers of the trained machine learning model, unselected ones of the subset of the layers not to be quantized in the third quantized machine learning model.8.The at least one non-transitory computer readable medium of claim 5, wherein the instructions are to cause one or more of the at least one processor circuit to discard the second quantized machine learning model after a determination that the quality metric does not satisfy the second threshold.9.The at least one non-transitory computer readable medium of claim 4, wherein the trained machine learning model is a floating point machine learning model, and the algorithm includes a quantization aware training algorithm.10.An apparatus comprising:interface circuitry;machine readable instructions; andat least one processor circuit to be programmed based on the machine readable instructions to:inference a dataset using a trained machine learning model;collect quantization statistics for a layer of the trained machine learning model from inferencing the dataset, the trained machine learning model including a plurality of layers;quantize the layer of the trained machine learning model based on the collected quantization statistics;generate a first quantized machine learning model based on the quantized layer of the trained machine learning model; andretrain the first quantized machine learning model based on the dataset to generate a second quantized machine learning model.11.The apparatus of claim 10, wherein one or more of the at least one processor circuit is to:generate quantization scale and zero point parameters based on the collected quantization statistics; andquantize the layer of the trained machine learning model based on the quantization scale and zero point parameters.12.The apparatus of claim 11, wherein one or more of the at least one processor circuit is to:select one or more data from the dataset;generate an output by inferencing the selected one or more data using the first quantized machine learning model; andcompare the output with a threshold.13.The apparatus of claim 12, wherein one or more of the at least one processor circuit to initialize an algorithm based on the quantization scale and zero point parameters after a determination that the output satisfies the threshold, the first quantized machine learning model to be retrained based on the algorithm to generate the second quantized machine learning model.14.The apparatus of claim 13, wherein one or more of the at least one processor circuit is to:select a hold-out subset of the dataset;generate a quality metric associated with inferencing the hold-out subset using the second quantized machine learning model; andcompare the quality metric with a second threshold.15.The apparatus of claim 14, wherein one or more of the at least one processor circuit is to:determine the quality metric satisfies the second threshold;at least one of output or store the second quantized machine learning model;select a subset of the layers of the trained machine learning model; andperform another process iteration to (i) quantize the subset of the layers of the trained machine learning model and (ii) determine a third quantized machine learning model based on the quantized subset of the layers of the trained machine learning model, unselected ones of the subset of layers not to be quantized in the third quantized machine learning model.16.An apparatus comprising:interface circuitry;machine readable instructions; andat least one processor circuit to be programmed based on the machine readable instructions to:quantize at least one layer of a trained machine learning model based on a post training quantization algorithm to determine a first quantized machine learning model, the trained machine learning model including a plurality of layers;retrain the first quantized machine learning model based on a quantization aware training algorithm to determine a second quantized machine learning model; andat least one of output or store the second quantized machine learning model.17.The apparatus of claim 16, wherein one or more of the at least one processor circuit is to initialize the quantization aware training algorithm based on quantization parameters associated with the first quantized machine learning model.18.The apparatus of claim 16, wherein one or more of the at least one processor circuit is to:select a subset of the layers of the trained machine learning model after a quality metric associated with the second quantized machine learning model satisfies a quality target;quantize the subset of the layers of the trained machine learning model; anddetermine a third quantized machine learning model based on the quantized subset of the layers of the trained machine learning model, unselected ones of the subset of the layers not to be quantized in the third quantized machine learning model .19.The apparatus of claim 18, wherein the trained machine learning model is associated with a first floating point precision, the selected subset of the layers of the third quantized machine learning model are associated with a first fixed point precision, and the unselected ones of the subset of the layers of the third quantized machine learning model are associated with the first floating point precision.20.The apparatus of claim 16, wherein one or more of the at least one processor circuit is to select a subset of the layers of the trained machine learning model to be quantized to determine the first quantized machine learning model, and ones of the layers not in the subset not to be quantized in the first quantized machine learning model.
Citation Information
Patent Citations
Neural network model quantification method and device, storage medium and electronic equipment
CN115879525A
Neural network model quantitative analysis method and system for dedicated processor
CN116050464A
Model training method and device, electronic equipment and medium
CN116611482A
Adaptive quantization for execution of machine learning models
US20210279635A1
Hybrid quantization of neural networks for edge computing applications
US20220044114A1