Methods and apparatus for low-bit weight-only quantization for large language models

The dynamic low-bit weight-only quantization for LLMs addresses accuracy and speed challenges by selecting optimal quantization algorithms for each data group, enhancing performance and reducing model size.

WO2026112859A1PCT designated stage Publication Date: 2026-06-04INTEL CORP +5

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
INTEL CORP
Filing Date
2024-11-28
Publication Date
2026-06-04

AI Technical Summary

Technical Problem

Existing quantization methods for Large Language Models (LLMs) face challenges in maintaining accuracy while reducing model size and improving inference speed, particularly with symmetric and asymmetric quantization techniques that require additional operations and affect model structure.

Method used

A dynamic low-bit weight-only quantization method that identifies an optimal quantization algorithm for each group of data, using full-range symmetric, half-range symmetric, and asymmetric algorithms to minimize quantization error and enhance accuracy, allowing for larger group sizes with reduced accuracy loss.

Benefits of technology

The method improves LLM performance by increasing accuracy and expediting inference tasks through dynamic quantization, enabling smaller model sizes and faster processing without significant loss of precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024135110_04062026_PF_FP_ABST
    Figure CN2024135110_04062026_PF_FP_ABST
Patent Text Reader

Abstract

An example apparatus includes interface circuitry, machine-readable instructions, and at least one processor circuit to be programmed by the machine-readable instructions to quantize a group of input data using a first quantization algorithm to form a first group of quantized data, quantize the group of input data using a second quantization algorithm to form a second group of quantized data, quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm, determine a first quantization error of the first group of quantized data, determine a second quantization error of the second group of quantized data, and determine a third quantization error of the third group of quantized data.
Need to check novelty before this filing date? Find Prior Art

Description

METHODS AND APPARATUS FOR LOW-BIT WEIGHT-ONLY QUANTIZATION FOR LARGE LANGUAGE MODELSBACKGROUND

[0001] Large Language Models (LLMs) include transformer neural networks used to perform artificial intelligence (AI) -based language-related tasks. LLMs include encoder only models for classification tasks, decoder only models for content generation tasks, and encoder-decoder models for content assessment and generation tasks, such as translation and summarization.BRIEF DESCRIPTION OF THE DRAWINGS

[0002] FIG. 1 is a block diagram of an example implementation of quantization performer circuitry constructed in accordance with teachings of this disclosure to perform low-bit weight-only quantization.

[0003] FIG. 2 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 example quantization performer circuitry of FIG. 1.

[0004] FIG. 3 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 example quantization performer circuitry of FIG. 1 to quantize and de-quantize group data to determine an absolute error of quantization.

[0005] FIG. 4A illustrates an example of a first quantization algorithm (e.g., full-range symmetric quantization) used to quantize and de-quantize group data.

[0006] FIG. 4B illustrates an example of a second quantization algorithm (e.g., half-range symmetric quantization) used to quantize and de-quantize group data.

[0007] FIG. 4C illustrates an example of a third quantization algorithm (e.g., asymmetric quantization) used to quantize and de-quantize group data.

[0008] FIG. 5 illustrates an example identification of a minimum quantization error using the first algorithm of FIG. 4A, the second algorithm of FIG. 4B, and the third algorithm of FIG. 4C.

[0009] FIG. 6 illustrates example 2-bit and 3-bit quantization of three datasets using methods and apparatus disclosed herein as compared with results associated with a traditional asymmetric quantization algorithm.

[0010] FIG. 7A illustrates an example representation of accuracy results associated with the 2-bit quantization of a first group size (n =16) of FIG. 6 using methods and apparatus disclosed herein.

[0011] FIG. 7B illustrates an example representation of accuracy results associated with the 2-bit quantization of a second group size (n = 64) of FIG. 6 using methods and apparatus disclosed herein.

[0012] FIG. 7C illustrates an example representation of accuracy results associated with the 3-bit quantization of a third group size (n = 128) of FIG. 6 using methods and apparatus disclosed herein.

[0013] FIG. 8 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 FIGS. 2-3 to implement the quantization performer circuitry of FIG. 1.

[0014] FIG. 9 is a block diagram of an example implementation of the processor circuitry of FIG. 8.

[0015] FIG. 10 is a block diagram of another example implementation of the programmable circuitry of FIG. 8.

[0016] FIG. 11 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 FIGS. 2-3) 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) .

[0017] 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

[0018] Large Language Models (LLMs) include large transformer-based models that exhibit capabilities in a variety of tasks, from language understanding to text generation. For example, in an LLM-based text generation inference phase, which includes Key-Value (KV) cache enabling, next-token generation is a memory-bound operation, where a token corresponds to a word or a sub-word. In such an example, weight-only quantization becomes the primary driver for expediting the inference phase, where the use of lower bits (e.g., binary digits) results in smaller model sizes. Weight-only quantization represents an effective performance optimization algorithm to reduce the total amount of memory access without losing accuracy. However, to maintain a high level of accuracy, per group quantization can be used in place of weight-only quantization to split input data into groups, such that each group includes a fixed amount of data and has a group-shared scale and zero point.

[0019] In general, quantization reduces the precision of a model’s parameter (s) from higher bit-widths (e.g., 32-bit floating point) to lower bit-widths (e.g., 8-bit integers) . Symmetric quantization and asymmetric quantization represent the two main quantization algorithms. In symmetric quantization, original floating-point values are mapped to a symmetric range around zero in the quantized space. For example, the quantized value for zero in the floating-point space is equivalent to zero in the quantized space when using symmetric quantization. Conversely, asymmetric quantization is not symmetric around zero, instead mapping minimum and maximum values from the float range to the minimum and maximum values of the quantized range. While symmetric quantization tends to show better performance given that asymmetric quantization has zero points to process, asymmetric quantization can nevertheless achieve higher accuracy than symmetric quantization.

[0020] For example, symmetric quantization usually only activates a range of integers represented by [-127, 127] , while a full range of integers uses all bits of a signed 8-bit integer (int8) data type (e.g., a range of [-128, 127] ) , where the full range of integers represents the -128 value of 8-bit symmetric quantization. As a greater number of low bits are enabled in the LLM, the full range of these low bits becomes more important during quantization. For example, while a 3-bit symmetric quantization normally uses [-3, 3] as a data range, the algorithm loses one-eighth of this data range, significantly reducing accuracy. While some existing quantization methods (e.g., GPTQ, AWQ, etc. ) show improvements in relation to 4-bit and 3-bit quantization of LLM models, such quantization methods need to perform additional operations for higher accuracy (e.g., reordering or scaling an activation tensor before computation, etc. ) . Such additional operations can increase quantization accuracy but also require improvements to the model structure, negatively affecting the inference phase.

[0021] Methods and apparatus disclosed herein introduce low-bit, weight-only quantization for LLMs. For example, unlike existing methods, the quantization method disclosed herein is dynamic, allowing all groups to share the same quantization algorithm. In examples disclosed herein, an optimal quantization algorithm for each quantization group is identified in terms of a quantization error, significantly increasing the accuracy of LLM models using any type of quantization (e.g., 2-bit quantization, 3-bit quantization, etc. ) and allowing for the use of larger group sizes with reduced losses in accuracy. For example, the larger group size and lower quantization bit expedites LLM inference during the machine learning model development process. In examples disclosed herein, three quantization algorithms (e.g., full-range symmetric algorithm, half full-range symmetric algorithm, and asymmetric algorithm) are selected for each identified group data. For example, using one or more of the selected quantization algorithms, methods and apparatus disclosed herein first quantize and then dequantize each group data to identify an absolute error of quantization. Subsequently, methods and apparatus disclosed herein identify which of the quantization algorithms yields a minimum quantization error. The selected quantization algorithm having the minimum quantization error is subsequently used for performing actual quantization of a given LLM to achieve increased accuracy. As such, methods and apparatus disclosed herein contribute to improving LLM-based performance associated with inference tasks.

[0022] FIG. 1 is a block diagram 100 illustrating an example implementation of quantization performer circuitry 101 constructed in accordance with teachings of this disclosure to perform low-bit weight-only quantization. The quantization performer circuitry 101 of FIG. 1 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 Processing Unit (CPU) executing first instructions. Additionally or alternatively, the quantization performer circuitry 101 of FIG. 1 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. 1 may, thus, be instantiated at the same or different times. Some or all of the circuitry of FIG. 1 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. 1 may be implemented by microprocessor circuitry executing instructions and / or FPGA circuitry performing operations to implement one or more virtual machines and / or containers.

[0023] In the example of FIG. 1, the quantization performer circuitry 101 includes example accuracy determiner circuitry 102, example group data identifier circuitry 105, example quantization selector circuitry 110, example error identifier circuitry 115, example algorithm selector circuitry 120, and example data storage 125. In the example of FIG. 1, the accuracy determiner circuitry 102, the group data identifier circuitry 105, the quantization selector circuitry 110, the error identifier circuitry 115, the algorithm selector circuitry 120, and the data storage 125 are in communication with an example bus 130.

[0024] The accuracy determiner circuitry 102 identifies an accuracy of LLM quantization during an inference phase of the machine learning model development process. In some examples, the accuracy determiner circuitry 102 identifies whether the LLM quantization accuracy needs to be increased using methods and apparatus disclosed herein. For example, the accuracy determiner circuitry 102 identifies loss of output accuracy associated with converting a model’s weights from a higher precision to a lower precision as part of quantization, such that model performance can be reduced when using lower bit widths of the converted data type (e.g., 4-bit, 3-bit, etc. ) . As such, quantization allows for the use of smaller models, increased scalability, and / or faster inference, while loss of accuracy is a potential drawback that can be mitigated using the methods and apparatus disclosed herein, as described in more detail below.

[0025] In some examples, the apparatus includes means for determining accuracy. For example, the means for determining accuracy may be implemented by accuracy determiner circuitry 102. In some examples, the accuracy determiner circuitry 102 may be instantiated by programmable circuitry such as the example programmable circuitry 812 of FIG. 8. For instance, the accuracy determiner circuitry 102 may be instantiated by the example microprocessor 900 of FIG. 9 executing machine executable instructions such as those implemented by at least blocks 202, 205 of FIG. 2. In some examples, the accuracy determiner circuitry 102 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1000 of FIG. 10 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the accuracy determiner circuitry 102 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the accuracy determiner circuitry 102 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. ) 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.

[0026] The group data identifier circuitry 105 identifies input data and determines a maximum and / or a minimum value of the identified input data. In some examples, the input data is split into groups, such that each group has a fixed amount of data. For example, the group data identifier circuitry 105 groups the input data for further analysis and / or quantization. In examples disclosed herein, the group data identifier circuitry 105 identifies quantization input data associated with the LLaMa2-7B fp16 model, which is part of a family of autoregressive LLMs used for time-series predictions and / or language modeling (e.g., generating text by sequentially predicting subsequent tokens based on preceding tokens, etc. ) .

[0027] In some examples, the apparatus includes means for identifying group data. For example, the means for identifying group data may be implemented by group data identifier circuitry 105. In some examples, the group data identifier circuitry 105 may be instantiated by programmable circuitry such as the example programmable circuitry 812 of FIG. 8. For instance, the group data identifier circuitry 105 may be instantiated by the example microprocessor 900 of FIG. 9 executing machine executable instructions such as those implemented by at least block 210 of FIG. 2. In some examples, the group data identifier circuitry 105 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1000 of FIG. 10 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the group data identifier circuitry 105 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the group data identifier circuitry 105 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. ) 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.

[0028] The quantization selector circuitry 110 selects a quantization algorithm to quantize and de-quantize each group input data (e.g., identified using the group data identifier circuitry 105) . In some examples, the quantization selector circuitry 110 selects a full-range symmetric quantization algorithm, a half-range symmetric quantization algorithm, or an asymmetric quantization algorithm to perform quantization of the group input data. For example, the quantization selector circuitry 110 selects the full-range symmetric quantization algorithm to map the maximum of an absolute minimum (e.g., abs (min) ) and an absolute maximum (e.g., abs (max) ) of a given group of input data to a negative full range value, as described in more detail in connection with FIG. 4A. In some examples, the quantization selector circuitry 110 selects the half-range symmetric quantization algorithm to map the maximum of the given group of input data to a symmetric range plus 0.5, and the minimum of the given group of input data to a negative full range plus 0.5, as described in more detail in connection with FIG. 4B. In some examples, the quantization selector circuitry 110 selects the asymmetric quantization algorithm to map the maximum of the group input data to a symmetric range and the minimum of the group input data to a negative full range, as described in more detail in connection with FIG. 4C. In examples disclosed herein, the quantization selector circuitry 110 performs quantization using all three types of quantization algorithms (e.g., full-range symmetric quantization, half-range symmetric quantization, and asymmetric quantization) .

[0029] In some examples, the apparatus includes means for selecting a quantization algorithm. For example, the means for selecting a quantization algorithm may be implemented by quantization selector circuitry 110. In some examples, the quantization selector circuitry 110 may be instantiated by programmable circuitry such as the example programmable circuitry 812 of FIG. 8. For instance, the quantization selector circuitry 110 may be instantiated by the example microprocessor 900 of FIG. 9 executing machine executable instructions such as those implemented by at least blocks 310, 315, 320 of FIG. 3. In some examples, the quantization selector circuitry 110 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1000 of FIG. 10 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the quantization selector circuitry 110 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the quantization selector circuitry 110 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. ) 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.

[0030] The error identifier circuitry 115 identifies a quantization error associated with the three types of quantization algorithms (e.g., full-range symmetric quantization algorithm, half-range symmetric quantization algorithm, asymmetric quantization algorithm) performed in connection with methods and apparatus disclosed herein. For example, the error identifier circuitry 115 identifies the absolute quantization error for each algorithm based on a dequantization of the quantized group input data, as shown in more detail in connection with FIG. 5. In examples disclosed herein, the quantization error can be defined as err= ∑abs (xj- (qj-zpi) *scalei) , where, given a quantization group i, scalei is a shared scale, zpi is a shared zero point, and each float data xj is constant after training. For example, the quantization process is performed to the shared scale (e.g., scalei) and zero point (e.g., zpi) to transform each float data xj (e.g., the jth number of a quantization group, G) to the integer data range, such that where qj∈ [-1<< (N-1) , 1<< (N-1) -1] , R denotes the rounding function, and N denotes the quantization bit number. In examples disclosed herein, the full range is represented by 1<< (N-1) and the symmetric range is represented by (1<< (N-1) )-1. In examples disclosed herein, the focus is on minimizing the quantization error using the scalei and zpi for each quantization group to identify  min (err) (e.g., identifying the inputs for which the output is minimum) .

[0031] In some examples, the apparatus includes means for identifying a quantization error. For example, the means for identifying a quantization error may be implemented by error identifier circuitry 115. In some examples, the error identifier circuitry 115 may be instantiated by programmable circuitry such as the example programmable circuitry 812 of FIG. 8. For instance, the error identifier circuitry 115 may be instantiated by the example microprocessor 900 of FIG. 9 executing machine executable instructions such as those implemented by at least block 335 of FIG. 3. In some examples, the error identifier circuitry 115 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1000 of FIG. 10 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the error identifier circuitry 115 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the error identifier circuitry 115 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. ) 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.

[0032] The algorithm selector circuitry 120 selects the quantization algorithm (e.g., full-range symmetric quantization algorithm, half-range symmetric quantization algorithm, asymmetric quantization algorithm) with the minimum quantization error to perform the actual LLM quantization. For example, once the error identifier circuitry 115 identifies the quantization error (s) associated with each of the three algorithms for all groups of the group input data, the algorithm selector circuitry 120 selects the quantization algorithm having the minimum quantization error, as shown in more detail in connection with FIG. 5.

[0033] In some examples, the apparatus includes means for selecting an algorithm for LLM quantization. For example, the means for selecting an algorithm for LLM quantization may be implemented by algorithm selector circuitry 120. In some examples, the algorithm selector circuitry 120 may be instantiated by programmable circuitry such as the example programmable circuitry 812 of FIG. 8. For instance, the algorithm selector circuitry 120 may be instantiated by the example microprocessor 900 of FIG. 9 executing machine executable instructions such as those implemented by at least block 220 of FIG. 2. In some examples, the algorithm selector circuitry 120 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 1000 of FIG. 10 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the algorithm selector circuitry 120 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the algorithm selector circuitry 120 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. ) 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.

[0034] The data storage 125 can be used to store any information associated with the accuracy determiner circuitry 102, the group data identifier circuitry 105, the quantization selector circuitry 110, the error identifier circuitry 115, and / or the algorithm selector circuitry 120. The data storage 125 of the illustrated example of FIG. 2 can be implemented by any memory, storage device and / or storage disc for storing data such as flash memory, magnetic media, optical media, etc. Furthermore, the data stored in the data storage 125 can be in any data format such as binary data, comma delimited data, tab delimited data, structured query language (SQL) structures, image data, etc.

[0035] While an example manner of implementing the quantization performer circuitry 101 is illustrated in FIG. 1, one or more of the elements, processes and / or devices illustrated in FIG. 1 may be combined, divided, re-arranged, omitted, eliminated and / or implemented in any other way. Further, the example accuracy determiner circuitry 102, the example group data identifier circuitry 105, the example quantization selector circuitry 110, the example error identifier circuitry 115, the example algorithm selector circuitry 120, and / or, more generally, the quantization performer circuitry 101 may be implemented by hardware, software, firmware and / or any combination of hardware, software and / or firmware. Thus, for example, any of the example accuracy determiner circuitry 102, the example group data identifier circuitry 105, the example quantization selector circuitry 110, the example error identifier circuitry 115, the example algorithm selector circuitry 120, and / or, more generally, the quantization performer circuitry 101 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 quantization performer circuitry 101 of FIG. 1 may include one or more elements, processes, and / or devices in addition to, or instead of, those illustrated in FIG. 1, and / or may include more than one of any or all of the illustrated elements, processes and devices.

[0036] Flowcharts representative of example machine readable instructions, which may be executed by programmable circuitry to implement and / or instantiate the quantization performer circuitry 101 of FIG. 1 and / or representative of example operations which may be performed by programmable circuitry to implement and / or instantiate the quantization performer circuitry 101 of FIG. 1, are shown in FIGS. 2-3. 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 812 shown in the example processor platform 800 discussed below in connection with FIG. 8 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. 9 and / or 10. 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.

[0037] 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 flowcharts illustrated in FIGS. 2-3, many other methods of implementing the example quantization performer circuitry 101 of FIG. 1 may alternatively be used. For example, the order of execution of the blocks of the flowchart (s) 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.

[0038] 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.

[0039] 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) .

[0040] 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.

[0041] As mentioned above, the example operations of FIGS. 2-3 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.

[0042] FIG. 2 is a flowchart representative of example machine-readable instructions and / or example operations 200 that may be executed, instantiated, and / or performed by example programmable circuitry to implement the example quantization performer circuitry 101 of FIG. 1. The machine-readable instructions and / or the operations 200 of FIG. 2 begin at block 202, at which the accuracy determiner circuitry 102 identifies the accuracy of LLM quantization during an inference phase of the machine learning model development process. For example, the accuracy determiner circuitry 102 identifies accuracy of 2-bit or 3-bit quantization (e.g., using lower bit widths of the converted data type) . If the accuracy determiner circuitry 102 determines that accuracy of LLM quantization can be increased, at block 205, the group data identifier circuitry 105 identifies a minimum and a maximum of one or more group input data, at block 210. For example, as shown in more detail in connection with FIG. 5, the group data identifier circuitry 105 identifies quantization group data and separates the data such that there is a fixed amount of data in each group. The group data identifier circuitry 105 then identifies the maximum and minimum values for the input data within each group. The quantization selector circuitry 110 proceeds to quantize and de-quantize group input data to determine an absolute error of quantization, at block 215, as described in more detail in connection with FIG. 3. For example, the quantization selector circuitry 110 selects two or more quantization algorithms to determine which algorithm results in the lowest quantization error. In examples disclosed herein, a total of three quantization algorithms are assessed, as shown in more detail in connection with FIGS. 4A, 4B, and 4C. Subsequently, the algorithm selector circuitry 120 identifies the quantization algorithm that shows the lowest quantization error for performing further LLM quantization, at block 220. The algorithm selector circuitry 120 proceeds to initiate LLM quantization using the selected quantization algorithm, at block 225.

[0043] FIG. 3 is a flowchart representative of example machine-readable instructions and / or example operations 215 that may be executed, instantiated, and / or performed by example programmable circuitry to implement the example quantization performer circuitry 101 of FIG. 1 to quantize and de-quantize group data to determine an absolute error of quantization. The machine-readable instructions and / or the operations 215 of FIG. 2 begin at block 310, at which the quantization selector circuitry 110 identifies group (s) associated with the group input data. For example, as illustrated in FIG. 5, the quantization selector circuitry 110 initiates quantization of the group of input data based on the identified minimum and maximum values of the group input data. In examples disclosed herein, the quantization selector circuitry 110 performs quantization using all three quantization algorithms, namely the full-range symmetric quantization algorithm, the half-range symmetric quantization algorithm, and the asymmetric quantization algorithm. However, the algorithms can be performed in any order and / or based on any selection. Likewise, any other type of quantization algorithm can be used for identifying quantization errors.

[0044] In the example of FIG. 3, the quantization selector circuitry 110 applies a first quantization algorithm (e.g., for full-range symmetric quantization) to the group (s) associated with the input data to obtain a first group of quantized data, at block 310. The quantization selector circuitry 110 proceeds to apply a second quantization algorithm (e.g., for half-range symmetric quantization) to obtain a second group of quantized data, at block 320, followed by a third quantization algorithm (e.g., for asymmetric quantization) to obtain a third group of quantized data, at block 325. The error identifier circuitry 115 proceeds to determine quantization error (s) associated with the first, second, and third quantization algorithms for each of the first, second, and third quantized groups of data, at block 330. In some examples, the error identifier circuitry 115 determines the quantization error (s) based on a comparison of the quantized and de-quantized values within each group. The error identifier circuitry 115 selects the quantization algorithm with the lowest error, at block 335. For example, the quantization algorithm with the lowest error (e.g., based on a sum of errors determined for each group) can be used for further LLM quantization (e.g., 2-bit quantization, 3-bit quantization, etc. ) .

[0045] FIG. 4A illustrates an example of a first quantization algorithm (e.g., full-range symmetric quantization) distributions 400, 420, 440 used to quantize and de-quantize group data. In the example of FIG. 4A, the first quantization algorithm distributions 400, 420, 440 include an illustration of a minimum value identification 405, a maximum value identification 410, a negative full range 415, and a symmetric range 418. The symmetric quantization algorithms illustrated in connection with FIGS. 4A and 4B can include mapping of original floating-point values to a symmetric range (e.g., around zero) in the quantized space. As such, the quantized value for zero in the floating-point space is equivalent to exactly zero in the quantized space. In examples disclosed herein, full-range symmetric quantization maps the maximum of an absolute minimum value (e.g., abs (min) ) and an absolute maximum value (e.g., abs (max) ) to a negative full range value. If the distribution of group data is balanced (e.g., min==max) , the full-range symmetric quantization algorithm will include some clip errors. For example, the quantization selector circuitry 110 maps the maximum value to a positive full range, but if the maximum value is out of the integer range, the quantization selector circuitry 110 clips the maximum value to a symmetric range. In examples disclosed herein, the error associated with clip operation is 0.5, given that the data within the symmetric range (e.g., [symmetric range, symmetric range + 0.5] ) should be rounded to fit within the range. As such, the quantization selector circuitry 110 clips data that falls outside of the symmetric range + 0.5.

[0046] For example, while a range of values in a given vector can be mapped to a lower-bit representation, allowing for the full range of vector values to be mapped, there are outliers (e.g., a value that is much larger than other values) that can cause other values (e.g., smaller values) to be mapped to the same lower-bit representation and lose their differentiating factor. The quantization selector circuitry 110 clips such values. In some examples, the quantization selector circuitry 110 sets a different dynamic range of the original values to allow all outliers to obtain the same value. In some examples, the quantization error associated with values that are not outliers is significantly reduced. In the example of FIG. 4A, full-range symmetric quantization includes distributions which correspond to (1) an absolute minimum that is greater than the absolute maximum (e.g., distribution 400, where abs (min) >abs (max) ) , (2) an absolute minimum that is greater than or equal to the absolute maximum (e.g., distribution 420, where abs (min) >= abs (max) ) , and (3) a balanced distribution 440, including a clip area corresponding to clipping of the maximum value to a symmetric range (e.g., represented by an example clip area) .

[0047] FIG. 4B illustrates an example of a second quantization algorithm (e.g., half-range symmetric quantization) distribution 460 used to quantize and de-quantize group data. In examples disclosed herein, the half full-range symmetric quantization maps the maximum value (e.g., maximum value 410) to a symmetric range + 0.5 (e.g., symmetric range 418) and the minimum value (e.g., minimum value 405) to a negative full range + 0.5 (e.g., negative full range 415) . In examples disclosed herein, the maximum value 410 is the only number that is clipped, such that the maximum value 410 is mapped to a symmetric range + 0.5, which is rounded as symmetric range + 1. For example, the half full-range symmetric quantization algorithm disclosed herein has a lower clip error than the full-range symmetric quantization algorithm shown in connection with FIG. 4A. However, the bit utilization of the full-range symmetric quantization is less than that of the full-range symmetric quantization.

[0048] FIG. 4C illustrates an example of a third quantization algorithm (e.g., asymmetric quantization) distribution 480 used to quantize and de-quantize group data. In contrast to symmetric quantization, asymmetric quantization is not symmetric around zero, but instead maps the minimum and maximum values from the float range to minimum and maximum values of the quantized range. In the example of FIG. 4C, asymmetric quantization does not have a clip error, always mapping the maximum value (e.g., maximum value 410) to a symmetric range (e.g., symmetric range 418) and the minimum value (e.g., minimum value 405) to the negative full range (e.g., negative full range 415) . Likewise, asymmetric quantization uses all bits and has a higher accuracy as compared to the symmetric quantization-based algorithms, but this type of quantization may not be ideal for 2-bit quantization. For example, given a rounding error of approximately 0.5, asymmetric quantization has an additional rounding error associated with the zero point, which is used to perform dequantization. Given that in some instances the zero point may be maintained as a float value, low-bit LLM inference performance can be significantly affected when using asymmetric quantization. In contrast, the traditional symmetric quantization algorithm ignores the full range value of the integer data range, making the use of asymmetric quantization algorithm less desirable as compared to the full-range symmetric quantization algorithm and / or the half full-range symmetric quantization algorithm of FIGS. 4A and 4B. In part, these differences are due to the zero-centered nature of symmetric quantization versus the offset of asymmetric quantization.

[0049] FIG. 5 illustrates an example identification 500 of a minimum quantization error using the first algorithm of FIG. 4A (e.g., full-range symmetric quantization) , the second algorithm of FIG. 4B (e.g., half-range symmetric quantization) , and the third algorithm of FIG. 4C (e.g., asymmetric quantization) . In the example of FIG. 5, three different groups of input data (e.g., a first group 505, a second group 510, a third group 515) are identified using a weight matrix 520, where each group has a total of 4 values and a total of 2 bits (group = 4, bits = 2) . In the example of FIG. 5, the group data identifier circuitry 105 retrieves quantization group data 525 to identify the quantization input data 530 consisting of the first group 505, the second group 510, and the third group 515. The group data identifier circuitry 105 identifies the minimum and maximum values 535 of the quantization input data 530 groups (e.g., yielding a minimum and maximum values matrix 540) . As described in connection with FIGS. 2-3, the quantization selector circuitry 110 performs quantization 560 of the minimum and maximum values matrix 540 using all three of the quantization algorithms. The quantization selector circuitry 110 identifies the quantized values 562, 570, 575 associated with the output (s) of the full-range symmetric 545, half-range symmetric 550, and asymmetric 555 quantization algorithm (s) , respectively. The error identifier circuitry 115 proceeds to dequantize the quantized values 562, 570, 575 to identify the resulting quantization error value (s) 565, 572, 580 associated with the full-range symmetric 545, half-range symmetric 550, and asymmetric 555 quantization algorithm (s) , respectively. In some examples, the error identifier circuitry 115 identifies the quantization error value (s) 565, 572, 580 based on a difference between the original and dequantized values.

[0050] The algorithm selector circuitry 120 proceeds to select one of the full-range symmetric 545, half-range symmetric 550, or asymmetric 555 quantization algorithm (s) based on an identified minimum error 585 associated with the algorithm. In the example of FIG. 5, a sum of errors 590 indicates the lowest error identified for each of the first group 505 (e.g., Group 0) , the second group 510 (e.g., Group 1) , and the third group 515 (e.g., Group 2) . For example, the sum of errors 590 shows the lowest quantization error for the first group 505 (e.g., Group 0) obtained using asymmetric 555 quantization (e.g., algorithm C) , the lowest quantization error for the second group 510 (e.g., Group 1) obtained using half-range symmetric 550 quantization (e.g., algorithm B) , and the lowest quantization error for the third group 515 (e.g., Group 2) obtained using full-range symmetric 545 quantization (e.g., algorithm A) . In examples disclosed herein, the algorithm selector circuitry 120 performs LLM-based quantization (e.g., 2-bit quantization, 3-bit quantization, etc. ) based on the selected quantization algorithm with a minimum quantization error.

[0051] FIG. 6 illustrates example 2-bit and 3-bit quantization results 600 of three datasets using methods and apparatus disclosed herein as compared with results associated with a traditional asymmetric quantization algorithm. In the example of FIG. 6, a LLaMa2-7B fp16 model is used as quantization input data for quantization using the traditional asymmetric quantization algorithm (e.g., a higher accuracy algorithm as compared to symmetric quantization algorithms) and the methods and apparatus disclosed herein. In the example of FIG. 6, 2-bit and 3-bit quantization involves using small group sizes for 2-bit quantization (e.g., a group size of 16 and 64 for INT2) and large group sizes for 3-bit quantization (e.g., a group size of 128 for INT3) . Three datasets are tested, including (1) WinoGrande, (2) PIQA (Physical Interaction: Question Answering) , and (3) LAMBADA (Language Modeling Broadened to Account for Discourse Aspects) . In the example of FIG. 6, an example quantization type dataset 605 is shown in combination with results for 2-bit quantization with a first group size 610, 2-bit quantization with a second group size 615, and 3-bit quantization with a third group size 620. The quantization algorithms compared are the known asymmetric quantization algorithm and the dynamic-based quantization algorithm disclosed herein, which identifies the preferred quantization algorithm for each quantization group in terms of the quantization error, with the results further illustrated and compared in connection with FIGS. 7A-7C.

[0052] FIG. 7A illustrates an example representation of accuracy results 700 associated with the 2-bit quantization of a first group size (n =16) of FIG. 6 using methods and apparatus disclosed herein. Quantization results using the asymmetric quantization algorithm 705 and the dynamic quantization algorithm 710 for all three datasets (e.g., WinoGrande, PIQA, LAMBADA) are shown, with higher accuracies associated with the dynamic quantization algorithm 710. FIG. 7B illustrates an example representation of accuracy results 725 associated with the 2-bit quantization of a second group size (n = 64) of FIG. 6 using methods and apparatus disclosed herein. FIG. 7C illustrates an example representation of accuracy results 750 associated with the 3-bit quantization of a third group size (n = 128) of FIG. 6 using methods and apparatus disclosed herein. In the example of FIGS. 7B-7C, higher accuracies of the quantization results are associated with the dynamic quantization algorithm 710, as opposed to the traditional asymmetric quantization algorithm 705. As such, the accuracy of LLM quantization can be improved using the dynamic quantization algorithm 710 disclosed herein (e.g., for larger group sizes and / or lower quantization bits) while enhancing the speed of LLM inference.

[0053] FIG. 8 is a block diagram of an example programmable circuitry platform 800 structured to execute and / or instantiate the example machine-readable instructions and / or the example operations of FIGS. 2-3 to implement the example quantization performer circuitry 101 of FIG. 1. The programmable circuitry platform 800 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.

[0054] The programmable circuitry platform 800 of the illustrated example includes programmable circuitry 812. The programmable circuitry 812 of the illustrated example is hardware. For example, the programmable circuitry 812 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 812 may be implemented by one or more semiconductor based (e.g., silicon based) devices. In this example, the processor circuitry 812 implements the accuracy determiner circuitry 102, the group data identifier circuitry 105, the quantization selector circuitry 110, the error identifier circuitry 115, and the algorithm selector circuitry 120.

[0055] The programmable circuitry 812 of the illustrated example includes a local memory 813 (e.g., a cache, registers, etc. ) . The programmable circuitry 812 of the illustrated example is in communication with a main memory including a volatile memory 814 and a non-volatile memory 816 by a bus 818. The volatile memory 814 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 816 may be implemented by flash memory and / or any other desired type of memory device. Access to the main memory 814, 816 of the illustrated example is controlled by a memory controller 817. In some examples, the memory controller 817 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 814, 816.

[0056] The programmable circuitry platform 800 of the illustrated example also includes interface circuitry 820. The interface circuitry 820 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.

[0057] In the illustrated example, one or more input devices 822 are connected to the interface circuitry 820. The input device (s) 822 permit (s) a user (e.g., a human user, a machine user, etc. ) to enter data and / or commands into the programmable circuitry 812. The input device (s) 822 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 track-pad, a trackball, an isopoint device, and / or a voice recognition system.

[0058] One or more output devices 824 are also connected to the interface circuitry 820 of the illustrated example. The output devices 824 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 820 of the illustrated example, thus, typically includes a graphics driver card, a graphics driver chip, and / or graphics processor circuitry such as a GPU.

[0059] The interface circuitry 820 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 826. 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 line-of-site wireless system, a cellular telephone system, an optical connection, etc.

[0060] The programmable circuitry platform 800 of the illustrated example also includes one or more mass storage devices 828 to store software and / or data. Examples of such mass storage devices 828 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.

[0061] The machine executable instructions 832, which may be implemented by the machine readable instructions of FIGS. 2-3, may be stored in the mass storage device 828, in the volatile memory 814, in the non-volatile memory 816, and / or on at least one non-transitory computer readable storage medium such as a CD or DVD which may be removable.

[0062] FIG. 9 is a block diagram of an example implementation of the programmable circuitry 812 of FIG. 8. In this example, the programmable circuitry 812 of FIG. 8 is implemented by a microprocessor 900. For example, the microprocessor 900 may be a general purpose microprocessor (e.g., general purpose microprocessor circuitry) . The microprocessor 900 executes some or all of the machine readable instructions of the flowcharts of FIGS. 2-3 to effectively instantiate the circuitry of FIG. 1 logic circuits to perform the operations corresponding to those machine readable instructions. In some such examples, the circuitry of FIG. 1 is instantiated by the hardware circuits of the microprocessor 900 in combination with the instructions. For example, the microprocessor 900 may implement multi-core hardware circuitry such as a CPU, a DSP, a GPU, an XPU, etc. Although it may include any number of example cores 902 (e.g., 1 core) , the microprocessor 900 of this example is a multi-core semiconductor device including N cores. The cores 902 of the microprocessor 900 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 902 or may be executed by multiple ones of the cores 902 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 902. The software program may correspond to a portion or all of the machine readable instructions and / or operations represented by the flowcharts of FIGS. 2-3.

[0063] The cores 902 may communicate by a first example bus 904. In some examples, the first bus 904 may implement a communication bus to effectuate communication associated with one (s) of the cores 902. For example, the first bus 904 may implement 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 904 may implement any other type of computing or electrical bus. The cores 902 may obtain data, instructions, and / or signals from one or more external devices by example interface circuitry 906. The cores 902 may output data, instructions, and / or signals to the one or more external devices by the interface circuitry 906. Although the cores 902 of this example include example local memory 920 (e.g., Level 1 (L1) cache that may be split into an L1 data cache and an L1 instruction cache) , the microprocessor 900 also includes example shared memory 910 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 910. The local memory 920 of each of the cores 902 and the shared memory 910 may be part of a hierarchy of storage devices including multiple levels of cache memory and the main memory (e.g., the main memory 814, 816 of FIG. 8) . 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.

[0064] Each core 902 may be referred to as a CPU, DSP, GPU, etc., or any other type of hardware circuitry. Each core 902 includes control unit circuitry 914, arithmetic and logic (AL) circuitry (sometimes referred to as an ALU) 916, a plurality of registers 918, the L1 cache 920, and a second example bus 922. Other structures may be present. For example, each core 902 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 914 includes semiconductor-based circuits structured to control (e.g., coordinate) data movement within the corresponding core 902. The AL circuitry 916 includes semiconductor-based circuits structured to perform one or more mathematic and / or logic operations on the data within the corresponding core 902. The AL circuitry 916 of some examples performs integer-based operations. In other examples, the AL circuitry 916 also performs floating-point operations. In yet other examples, the AL circuitry 916 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 916 may be referred to as an Arithmetic Logic Unit (ALU) .

[0065] The registers 918 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 916 of the corresponding core 902. For example, the registers 918 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 918 may be arranged in a bank as shown in FIG. 9. Alternatively, the registers 918 may be organized in any other arrangement, format, or structure including distributed throughout the core 902 to shorten access time. The second bus 922 may be implemented by at least one of an I2C bus, a SPI bus, a PCI bus, or a PCIe bus.

[0066] Each core 902 and / or, more generally, the microprocessor 900 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 900 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.

[0067] The microprocessor 900 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 900, in the same chip package as the microprocessor 900 and / or in one or more separate packages from the microprocessor 900.

[0068] FIG. 10 is a block diagram of another example implementation of the programmable circuitry of FIG. 8. In this example, the programmable circuitry 812 is implemented by FPGA circuitry 1000. For example, the FPGA circuitry 1000 may be implemented by an FPGA. The FPGA circuitry 1000 can be used, for example, to perform operations that could otherwise be performed by the example microprocessor 900 of FIG. 9 executing corresponding machine readable instructions. However, once configured, the FPGA circuitry 1000 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.

[0069] More specifically, in contrast to the microprocessor 900 of FIG. 9 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 flowcharts of FIGS. 2-3 but whose interconnections and logic circuitry are fixed once fabricated) , the FPGA circuitry 1000 of the example of FIG. 10 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 flowcharts of FIGS. 2-3. In particular, the FPGA 1000 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 1000 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 flowcharts of FIGS. 2-3. As such, the FPGA circuitry 1000 may be configured and / or structured to effectively instantiate some or all of the operations / functions corresponding to the machine readable instructions of the flowcharts of FIGS. 2-3 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 1000 may perform the operations / functions corresponding to the some or all of the machine readable instructions of FIGS. 2-3 faster than the general-purpose microprocessor can execute the same.

[0070] In the example of FIG. 10, the FPGA circuitry 1000 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 1000 of FIG. 10 may access and / or load the binary file to cause the FPGA circuitry 1000 of FIG. 10 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 1000 of FIG. 10 to cause configuration and / or structuring of the FPGA circuitry 1000 of FIG. 10, or portion (s) thereof.

[0071] 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 1000 of FIG. 10 may access and / or load the binary file to cause the FPGA circuitry 1000 of FIG. 10 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 1000 of FIG. 10 to cause configuration and / or structuring of the FPGA circuitry 1000 of FIG. 10, or portion (s) thereof.

[0072] The FPGA circuitry 1000 of FIG. 10, includes example input / output (I / O) circuitry 1002 to obtain and / or output data to / from example configuration circuitry 1004 and / or external hardware 1006. For example, the configuration circuitry 1004 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 1000, or portion (s) thereof. In some such examples, the configuration circuitry 1004 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 1006 may be implemented by external hardware circuitry. For example, the external hardware 1006 may be implemented by the microprocessor 900 of FIG. 9.

[0073] The FPGA circuitry 1000 also includes an array of example logic gate circuitry 1008, a plurality of example configurable interconnections 1010, and example storage circuitry 1012. The logic gate circuitry 1008 and the configurable interconnections 1010 are configurable to instantiate one or more operations / functions that may correspond to at least some of the machine readable instructions of FIGS. 2-3 and / or other desired operations. The logic gate circuitry 1008 shown in FIG. 10 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 1008 to enable configuration of the electrical structures and / or the logic gates to form circuits to perform desired operations / functions. The logic gate circuitry 1008 may include other electrical structures such as look-up tables (LUTs) , registers (e.g., flip-flops or latches) , multiplexers, etc.

[0074] The configurable interconnections 1010 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 1008 to program desired logic circuits.

[0075] The storage circuitry 1012 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 1012 may be implemented by registers or the like. In the illustrated example, the storage circuitry 1012 is distributed amongst the logic gate circuitry 1008 to facilitate access and increase execution speed.

[0076] The example FPGA circuitry 1000 of FIG. 10 also includes example dedicated operations circuitry 1014. In this example, the dedicated operations circuitry 1014 includes special purpose circuitry 1016 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 1016 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 1000 may also include example general purpose programmable circuitry 1018 such as an example CPU 1020 and / or an example DSP 1022. Other general purpose programmable circuitry 1018 may additionally or alternatively be present such as a GPU, an XPU, etc., that can be programmed to perform other operations.

[0077] Although FIGS. 9 and 10 illustrate two example implementations of the programmable circuitry 812 of FIG. 8, many other approaches are contemplated. For example, FPGA circuitry may include an on-board CPU, such as one or more of the example CPU 1020 of FIG. 10. Therefore, the programmable circuitry 812 of FIG. 8 may additionally be implemented by combining at least the example microprocessor 900 of FIG. 9 and the example FPGA circuitry 1000 of FIG. 10. In some such hybrid examples, one or more cores 1002 of FIG. 10 may execute a first portion of the machine readable instructions represented by the flowchart (s) of FIGS. 2-3 to perform first operation (s)  / function (s) , the FPGA circuitry 1000 of FIG. 10 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 flowcharts of FIGS. 2-3, 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 flowcharts of FIGS. 2-3.

[0078] It should be understood that some or all of the circuitry of FIG. 1 may, thus, be instantiated at the same or different times. For example, same and / or different portion (s) of the microprocessor 900 of FIG. 9 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 1000 of FIG. 10 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.

[0079] In some examples, some or all of the circuitry of FIG. 1 may be instantiated, for example, in one or more threads executing concurrently and / or in series. For example, the microprocessor 900 of FIG. 9 may execute machine readable instructions in one or more threads executing concurrently and / or in series. In some examples, the FPGA circuitry 1000 of FIG. 10 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. 1 may be implemented within one or more virtual machines and / or containers executing on the microprocessor 900 of FIG. 9.

[0080] In some examples, the programmable circuitry 812 of FIG. 8 may be in one or more packages. For example, the microprocessor 900 of FIG. 9 and / or the FPGA circuitry 1000 of FIG. 10 may be in one or more packages. In some examples, an XPU may be implemented by the programmable circuitry 812 of FIG. 8 which may be in one or more packages. For example, the XPU may include a CPU (e.g., the microprocessor 900 of FIG. 9, the CPU 1020 of FIG. 10, etc. ) in one package, a DSP (e.g., the DSP 1022 of FIG. 10) in another package, a GPU in yet another package, and an FPGA (e.g., the FPGA circuitry 1000 of FIG. 10) in still yet another package.

[0081] A block diagram illustrating an example software distribution platform 1105 to distribute software such as the example machine readable instructions 832 of FIG. 8 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. 11. The example software distribution platform 1105 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 1105. For example, the entity that owns and / or operates the software distribution platform 1105 may be a developer, a seller, and / or a licensor of software such as the example machine readable instructions 832 of FIG. 8. 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 1105 includes one or more servers and one or more storage devices. The storage devices store the machine readable instructions 832, which may correspond to the example machine readable instructions of FIGS. 2-3, as described above. The one or more servers of the example software distribution platform 805 are in communication with an example network 810, 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 832 from the software distribution platform 1105. For example, the software, which may correspond to the example machine readable instructions of FIGS. 2-3, may be downloaded to the example programmable circuitry platform 800, which is to execute the machine readable instructions 832 to implement the quantization performer circuitry 101 of FIG. 1. In some examples, one or more servers of the software distribution platform 1105 periodically offer, transmit, and / or force updates to the software (e.g., the example machine readable instructions 832 of FIG. 8) 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.

[0082] “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.

[0083] 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.

[0084] 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.

[0085] 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) .

[0086] 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.

[0087] From the foregoing, it will be appreciated that example systems, methods, apparatus, and articles of manufacture disclosed herein permit low-bit, weight-only quantization for LLMs. In examples disclosed herein, an optimal quantization algorithm for each quantization group is identified in terms of a quantization error, significantly increasing the accuracy of LLM models for 2-bit quantization and / or 3-bit quantization and allowing for the use of larger group sizes with reduced losses in accuracy. In examples disclosed herein, three quantization algorithms (e.g., full-range symmetric algorithm, half full-range symmetric algorithm, and asymmetric algorithm) are selected for each identified group data. The symmetric or asymmetric quantization algorithm having a minimum quantization error is subsequently used for performing actual quantization of a given LLM. As such, methods and apparatus disclosed herein contribute to improving LLM-based performance associated with inference tasks. Thus, examples disclosed herein result in improvements to the operation of a machine.

[0088] Example methods, apparatus, systems, and articles of manufacture for low-bit, weight-only quantization for LLMs are disclosed herein. Further examples and combinations thereof include the following:

[0089] Example 1 includes an apparatus, comprising interface circuitry, machine-readable instructions, and at least one processor circuit to be programmed by the machine-readable instructions to quantize a group of input data using a first quantization algorithm to form a first group of quantized data, quantize the group of input data using a second quantization algorithm to form a second group of quantized data, the first quantization algorithm different from the second quantization algorithm, quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm, determine a first quantization error of the first group of quantized data, determine a second quantization error of the second group of quantized data, determine a third quantization error of the third group of quantized data, select one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error, and perform quantization of a large language model (LLM) using a selected quantization algorithm.

[0090] Example 2 includes the apparatus of example 1, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data

[0091] Example 3 includes the apparatus of example 1, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.

[0092] Example 4 includes the apparatus of example 1, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.

[0093] Example 5 includes the apparatus of example 1, wherein one or more of the at least one processor circuit is to identify a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.

[0094] Example 6 includes the apparatus of example 1, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.

[0095] Example 7 includes the apparatus of example 1, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 3-bit quantization algorithm.

[0096] Example 8 includes At least one non-transitory machine-readable medium comprising machine-readable instructions to cause at least one processor circuit to at least quantize a group of input data using a first quantization algorithm to form a first group of quantized data, quantize the group of input data using a second quantization algorithm to form a second group of quantized data, the first quantization algorithm different from the second quantization algorithm, quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm, determine a first quantization error of the first group of quantized data, determine a second quantization error of the second group of quantized data, determine a third quantization error of the third group of quantized data, select one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error, and perform quantization of a large language model (LLM) using a selected quantization algorithm.

[0097] Example 9 includes the at least one non-transitory machine-readable medium of example 8, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data to a negative full range value.

[0098] Example 10 includes the at least one non-transitory machine-readable medium of example 8, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.

[0099] Example 11 includes the at least one non-transitory machine-readable medium of example 8, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.

[0100] Example 12 includes the at least one non-transitory machine-readable medium of example 8, wherein the machine-readable instructions are to cause one or more of the at least one processor circuit to identify a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.

[0101] Example 13 includes the at least one non-transitory machine-readable medium of example 8, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.

[0102] Example 14 includes the at least one non-transitory machine-readable medium of example 8, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 3-bit quantization algorithm.

[0103] Example 15 includes an apparatus, comprising means for selecting a quantization algorithm to quantize a group of input data using a first quantization algorithm to form a first group of quantized data, quantize the group of input data using a second quantization algorithm to form a second group of quantized data, the first quantization algorithm different from the second quantization algorithm, and quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm, means for identifying a quantization error to determine a first quantization error of the first group of quantized data, and determine a second quantization error of the second group of quantized data, and determine a third quantization error of the third group of quantized data, and means for selecting an algorithm for LLM quantization to select one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error, and perform quantization of a large language model (LLM) using a selected quantization algorithm.

[0104] Example 16 includes the apparatus of example 15, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data to a negative full range value.

[0105] Example 17 includes the apparatus of example 15, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.

[0106] Example 18 includes the apparatus of example 15, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.

[0107] Example 19 includes the apparatus of example 15, whether the means for identifying a quantization error is to identify a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.

[0108] Example 20 includes the apparatus of example 15, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.

[0109] Example 21 includes a method, comprising quantizing a group of input data using a first quantization algorithm to form a first quantized data set, quantizing, by at least one processor circuit programmed by at least one instruction, the group of input data using a second quantization algorithm to form a second quantized data set, the first quantization algorithm different from the second quantization algorithm, quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm, determining, by one or more of the at least one processor circuit, a first quantization error of the first quantized data set, determining a second quantization error of the second quantized data set, determining a third quantization error of the third group of quantized data, selecting one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error, and performing quantization of a large language model (LLM) using a selected quantization algorithm.

[0110] Example 22 includes the method of example 21, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data to a negative full range value.

[0111] Example 23 includes the method of example 21, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.

[0112] Example 24 includes the method of example 21, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.

[0113] Example 25 includes the method of example 21, further including identifying a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.

[0114] Example 26 includes the method of example 21, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.

[0115] Example 27 includes the method of example 21, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 3-bit quantization algorithm.

[0116] The following claims are hereby incorporated into this Detailed Description by this reference. Although certain example systems, methods, apparatus, and articles of manufacture have been disclosed herein, the scope of coverage of this patent is not limited thereto. On the contrary, this patent covers all systems, methods, apparatus, and articles of manufacture fairly falling within the scope of the claims of this patent.

Claims

1.An apparatus, comprising:interface circuitry;machine-readable instructions; andat least one processor circuit to be programmed by the machine-readable instructions to:quantize a group of input data using a first quantization algorithm to form a first group of quantized data;quantize the group of input data using a second quantization algorithm to form a second group of quantized data, the first quantization algorithm different from the second quantization algorithm;quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm;determine a first quantization error of the first group of quantized data;determine a second quantization error of the second group of quantized data;determine a third quantization error of the third group of quantized data;select one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error; andperform quantization of a large language model (LLM) using a selected quantization algorithm.2.The apparatus of claim 1, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data to a negative full range value.3.The apparatus of claim 1, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.4.The apparatus of claim 1, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.5.The apparatus of claim 1, wherein one or more of the at least one processor circuit is to identify a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.6.The apparatus of claim 1, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.7.The apparatus of claim 1, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 3-bit quantization algorithm.8.At least one non-transitory machine-readable medium comprising machine-readable instructions to cause at least one processor circuit to at least:quantize a group of input data using a first quantization algorithm to form a first group of quantized data;quantize the group of input data using a second quantization algorithm to form a second group of quantized data, the first quantization algorithm different from the second quantization algorithm;quantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm;determine a first quantization error of the first group of quantized data;determine a second quantization error of the second group of quantized data;determine a third quantization error of the third group of quantized data;select one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error; andperform quantization of a large language model (LLM) using a selected quantization algorithm.9.The at least one non-transitory machine-readable medium of claim 8, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data to a negative full range value.10.The at least one non-transitory machine-readable medium of claim 8, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.11.The at least one non-transitory machine-readable medium of claim 8, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.12.The at least one non-transitory machine-readable medium of claim 8, wherein the machine-readable instructions are to cause one or more of the at least one processor circuit to identify a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.13.The at least one non-transitory machine-readable medium of claim 8, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.14.The at least one non-transitory machine-readable medium of claim 8, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 3-bit quantization algorithm.15.An apparatus, comprising:means for selecting a quantization algorithm to:quantize a group of input data using a first quantization algorithm to form a first group of quantized data;quantize the group of input data using a second quantization algorithm to form a second group of quantized data, the first quantization algorithm different from the second quantization algorithm; andquantize the group of input data using a third quantization algorithm to form a third group of quantized data, the third quantization algorithm different from the first quantization algorithm and the second quantization algorithm;means for identifying a quantization error to:determine a first quantization error of the first group of quantized data; anddetermine a second quantization error of the second group of quantized data; anddetermine a third quantization error of the third group of quantized data; andmeans for selecting an algorithm for LLM quantization to:select one of the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm based on a comparison of the first quantization error, the second quantization error, and the third quantization error; andperform quantization of a large language model (LLM) using a selected quantization algorithm.16.The apparatus of claim 15, wherein the first quantization algorithm is a full-range symmetric quantization algorithm, the full-range symmetric quantization algorithm to map a first maximum of an absolute minimum value of the group input data and a second maximum of an absolute maximum value of the group input data to a negative full range value.17.The apparatus of claim 15, wherein the second quantization algorithm is a half-range symmetric quantization algorithm, the half-range symmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range, such that the maximum value is clipped.18.The apparatus of claim 15, wherein the third quantization algorithm is an asymmetric quantization algorithm, the asymmetric quantization algorithm to map a maximum value of the group input data to a symmetric range and a minimum value of the group input data to a negative full range without a clip error.19.The apparatus of claim 15, whether the means for identifying a quantization error is to identify a minimum error based on a comparison of the first quantization error, the second quantization error, and the third quantization error.20.The apparatus of claim 15, wherein the first quantization algorithm, the second quantization algorithm, or the third quantization algorithm is a 2-bit quantization algorithm.