METHODS AND APPARATUS FOR CROSS-MEMORY SPECULATIVE INFERENCE ASSOCIATED WITH MASSIVE-SCALE LARGE LANGUAGE MODELS (LLMs)
Cross-memory dual-model speculative inference optimizes CPU performance for LLMs by using HBM for rapid token generation and DDR5 for verification, addressing memory bottlenecks and enhancing computational efficiency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- INTEL CORP
- Filing Date
- 2024-11-01
- Publication Date
- 2026-05-07
AI Technical Summary
Existing CPU-based Large Language Model (LLM) inference faces challenges with high computational demands and memory bottlenecks, particularly in the decode phase, leading to suboptimal hardware utilization and limited performance, especially for massive-scale models exceeding 30 billion parameters.
Implementing cross-memory dual-model speculative inference using AI acceleration engines, where a smaller draft model is deployed in High Bandwidth Memory (HBM) for rapid token generation and a larger validation model in DDR5 memory for batch verification, enhancing computational efficiency and overcoming memory limitations.
This approach significantly accelerates LLM inference by two to three times for massive-scale models, maintaining accuracy while fully leveraging CPU capabilities, particularly for small-batch scenarios.
Smart Images

Figure CN2024129265_07052026_PF_FP_ABST
Abstract
Description
METHODS AND APPARATUS FOR CROSS-MEMORY SPECULATIVE INFERENCE ASSOCIATED WITH MASSIVE-SCALE LARGE LANGUAGE MODELS (LLMs)BACKGROUND
[0001] Large Language Models (LLMs) include transformer neural networks used to perform artificial intelligence (AI) -based language-related tasks. LLMs may 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 model execution circuitry constructed in accordance with teachings of this disclosure to perform cross-memory speculative inference associated with massive-scale LLMs.
[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 model execution 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 model execution circuitry of FIG. 1 to perform rapid generation of batch draft tokens using a High Bandwidth Memory (HBM) node.
[0005] FIG. 4 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 model execution circuitry of FIG. 1 to receive draft tokens and conduct batch verification using Double Data Rate 5 (DDR5) memory.
[0006] FIG. 5 illustrates an example cross-memory speculative inference pipeline constructed in accordance with teachings of this disclosure to accelerate LLM inference-based tasks.
[0007] FIG. 6 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-4 to implement the model execution circuitry of FIG. 1.
[0008] FIG. 7 is a block diagram of an example implementation of the processor circuitry of FIG. 6.
[0009] FIG. 8 is a block diagram of another example implementation of the programmable circuitry of FIG. 6.
[0010] FIG. 9 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-4) 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) .
[0011] 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
[0012] 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, generative LLMs (e.g., ChatGPT, Llama, ChatGLM, etc. ) have been shown to be powerful in various tasks (e.g., question answering, artistic creation, marketing, etc. ) . However, LLMs are computationally expensive, requiring the use of complex architectures or increasingly larger models. While deep learning frameworks (e.g., PyTorch) facilitate central processing unit (CPU) -based computations associated with LLMs, existing levels of software optimization may not meet the latency or throughput demands of real-world applications. As a result, artificial intelligence (AI) -based accelerators are often the preferred choice for tasks associated with training and / or inference. However, CPUs have potential for use in LLM-based inference applications given the recent incorporation of AI acceleration engines into the performance cores (P-cores) of processing units (e.g., processors with Advanced Matrix Extensions ( AMX) equipped with High Bandwidth Memory (HBM) ) .
[0013] For example, LLM inference tasks demand substantial hardware resources, primarily due to the numerous matrix-matrix multiplication (MatMul) operations within the LLM network structure. The hardware requirements for MatMul operations vary with different scales of {M, N, K} dimensions. For example, when the M dimension is large, a weight matrix associated with MatMul can be fully optimized for cache usage, making MatMul a compute-intensive operation. Conversely, a small M dimension (e.g., M = 1 as used for next token-based attention computing, even with large batch sizes) results in memory access bandwidth becoming a bottleneck, turning MatMul into a memory-bound operation. As such, LLM inference imposes high demands on both computational capabilities and memory bandwidth of the underlying hardware. However, LLM inference has potential for enhancement using processing units with AI acceleration engines given an increase in peak computational performance and memory bandwidth and capacity. For example, use of two-dimensional matrix computations in place of one-dimensional vector computations (e.g., AMX) allows for an eight-fold increase in computational operations per clock cycle over advanced vector extensions (AVX) (e.g., AVX-512) instructions for equivalent data types, substantially boosting the peak throughput for LLM inference tasks. Likewise, support for HBM, which offers increased memory channels and wider read bandwidth, can theoretically achieve four times the bandwidth of Double Data Rate 5 (DDR5) (e.g., synchronous dynamic random-access memory) . For example, when HBM can accommodate the full set of weights, end-to-end speedup is doubled. However, for models with parameters exceeding 30 billion, the capacity of each HBM node can be insufficient (e.g., a capacity of 64 gigabytes (GB) ) . In some examples, AI accelerators cannot support such tasks without multi-card or multi-node setups. CPUs (e.g., processors) with large main memory capacity (e.g., from 256 GB to 1 terabyte (TB) ) can provide a more cost-effective solution for these scenarios.
[0014] Despite existing hardware strengths, CPU-based LLM inference faces notable challenges. The LLM-based inference process is divided into two phases, the prefill phase and the decode phase. The prefill phase processes input prompts, leveraging the computational power of processors with AI acceleration engines (e.g., AMX) . However, during the decode phase, auto-regressive token generation can only partially utilize AI acceleration capabilities, with utilization being worse in scenarios of small-batch inference. Additionally, the massive-scale parameter sets of LLMs may exceed HBM’s capacity, diminishing the memory bandwidth benefits. Meanwhile, the large memory capacity of DDR5 remains underutilized due to the latency requirements for massive-scale LLMs. These factors severely limit the computational potential of CPUs with AI acceleration capabilities in LLM inference.
[0015] Existing approaches for using CPUs in LLM inference-based tasks include (1) using the CPU as a primary inference engine to primarily target LLMs with parameter counts below 10 billion, such that the CPU takes the central role in executing the inference, (2) using the CPU as a host for AI accelerators, such that the CPU manages request preprocessing and scheduling while the CPU’s memory serves as an extended storage, providing a swap space when the memory of AI accelerators is exhausted, and (3) using a CPU-GPU (e.g., graphics processing unit) heterogeneous inference to leverage the strength of both the CPU and GPU, where the CPU handles the decoding of lightweight models, providing preliminary predictions to assist the LLM inference tasks performed by AI accelerators. However, the computational characteristics of LLMs result in suboptimal CPU hardware utilization. The application scope under tight latency constraints is often restricted to LLM inference tasks with small batch sizes and modest-scale models (e.g., models with fewer than 10 billion parameters) or to offline tasks that do not have stringent performance requirements. In such contexts, CPUs typically handle lighter computational workloads, leaving the full potential and inherent capabilities of the hardware underutilized. Additionally, the high-frequency data exchange introduced does not effectively compensate for the AI accelerator's limitations in memory capacity.
[0016] Methods and apparatus disclosed herein introduce cross-memory dual-model speculative inference for massive-scale LLMs using processing units with AI acceleration engines. Methods and apparatus disclosed herein focus on meeting latency requirements while ensuring no loss in inference accuracy of the target LLM to fully leverage the capabilities of processing units with AI acceleration engines (e.g., AMX with HBM) . In examples disclosed herein, cross-memory dual-model speculative inference increases a number of tokens in a single decoding step during an auto-regressive decoding process, effectively mitigating the memory bottleneck in the decode phase. As a result, cross-memory dual-model speculative inference disclosed herein enables LLMs to utilize AI-based acceleration across both the prefill and decode phases, particularly for small-batch inference. Furthermore, use of a cross-memory deployment strategy in connection with HBM and / or DDR5 overcomes the existing limitations of HBM capacity for massive-scale LLMs by efficiently utilizing the bandwidth of HBM and the capacity of DDR5, ensuring that the combined potential of a processor-based AI acceleration engine with HBM is fully realized in LLM inference. In examples disclosed herein, speculative inference is used as part of accelerating the autoregressive decoding process by introducing an auxiliary draft model designed to rapidly produce preliminary output tokens. In examples disclosed herein, the original LLM (e.g., referred to as a verify model) , reviews and / or refines the draft tokens to ensure accuracy and coherence. While empirical testing demonstrates an acceptance rate of three to eight tokens in the speculative process, methods and apparatus disclosed herein achieve an end-to-end performance improvement by two to three times for massive-scale LLMs (e.g., such as Llama-2-70B) , showcasing a significant leap in inference efficiency.
[0017] In examples disclosed herein, dual-model cross-memory deployment includes use of (1) HBM to load the weights of a smaller model (e.g., a draft model) , leveraging the high bandwidth of HBM to quickly generate a series of subsequent draft tokens based on the input, and (2) DDR5 memory to load the weights of a target generation model (e.g., a validation model associated with speculative inference) , taking advantage of DDR5’s large memory capacity to accommodate parameters on the order of hundreds of billions. With draft token predictions, the granularity of single step decoding of the target generation model is increased from one token to a batch of tokens. As such, this improves DDR5 cache hit rates and enhances efficiency of an AI-based acceleration processor, significantly boosting the inference performance of massive-scale LLMs. The use of a pipelined speculative inference scheme disclosed herein introduces a micro-batch dimension, enabling concurrent speculative and generation processes. On nodes with a higher core count, this strategy can further minimize prediction overhead and augment hardware utilization. In examples disclosed herein, inference accuracy is maintained while delivering a double or triple increase in acceleration (e.g., using Llama-2-70B tasks under specific conditions) . In examples disclosed herein, increases in acceleration vary across different request types, influenced by the acceptance rate of the draft model’s predictions during the speculative inference phase. In examples disclosed herein, LLM-based inference tasks are significantly accelerated for models exceeding 30 billion parameters, providing a substantial speed boost without compromising accuracy, as compared to direct inference deployment. Additionally, the dual-model cross-memory speculative inference disclosed herein is scalable across both memory and computing nodes, ensuring further performance enhancements. The dual-model approach and pipelined strategy ensure adaptability across different hardware configurations and / or dual memory systems (e.g., not limited to the use of HBM and DDR5) , making this approach suitable for a wide range of business needs and / or computational resources.
[0018] FIG. 1 is a block diagram 100 of an example implementation of model execution circuitry 102 constructed in accordance with teachings of this disclosure to perform cross-memory speculative inference associated with massive-scale LLMs. The model execution circuitry 102 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 execution circuitry 102 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.
[0019] In the example of FIG. 1, the model execution circuitry 102 includes example machine learning accelerator circuitry 105, example model processing circuitry 110, example high bandwidth memory (HBM) execution circuitry 115, an example draft model 120, example main memory execution circuitry 125, and an example validation model 130.
[0020] The machine learning accelerator circuitry 105 accelerates AI and machine learning applications (e.g., artificial neural networks, computer vision processes, etc. ) . For example, the machine learning accelerator circuitry 105 can include any type of circuitry integrated into a central processing unit for AI acceleration (e.g., such as the AMX accelerator for deep-learning training and inference) . In some examples, the machine learning accelerator circuitry 105 can be part of a specific CPU platform (e.g., CPU Max Series) . For example, the machine learning accelerator circuitry 105 accelerates inference tasks that demand substantial hardware resources due to LLM’s transformer-based architecture. LLM inference is divided into two main phases (e.g., a prefill phase and a decode phase) . The prefill phase processes input prompts, while the decode phase generates output tokens in a self-regressive manner (e.g., the generation of each token depending on the computational results of all preceding context) . In some examples, the time taken for generation is directly related to the length of the preceding context. The two phases exhibit significant differences in hardware computational efficiency, such that the prefill phase can efficiently utilize computational resources even with small batch sizes, whereas the decode phase suffers from low computational efficiency due to generating only one token at a time.
[0021] Considering the operator level, computational intensity primarily resides in the linear transformations within the transformers’ hidden layers, specifically matrix-matrix multiplication (MatMul) . These operations constitute the most time-consuming potion of the process and require hardware computing capabilities. In scenarios with small prompt batches, the linear transformation in the self-regressive decoding process essentially degrades to vector-matrix multiplication, which reduces weight matrix reuse and low cache hit rates. Consequently, this phase becomes memory-bound, highlighting the need for higher memory bandwidth in hardware. In examples disclosed herein, the machine learning accelerator circuitry 105 uses an AI acceleration engine to boost the velocity of MatMul operations, performing 1024 bf16 (e.g., 16-bit floating-point data type) floating-point operations per cycle (e.g., 2048 8-bit integer data type (int8) operations) , offering an eight-fold increase over the throughput of existing accelerators for vector processing-intensive workloads (e.g., AVX-512) for the respective data types. In examples disclosed herein, the machine learning accelerator circuitry 105 works in combination with HBM execution circuitry 115, which, compared to DDR5 (e.g., main memory execution circuitry 125) , provides a greater number of memory channels and extended read widths, with a theoretical bandwidth up to four times that of DDR5. In examples disclosed herein, the machine learning accelerator circuitry 105 works in unison with the model processing circuitry 110, HBM execution circuitry 115, and / or the main memory execution circuitry 125, to address several challenges that are known to constrain the computational potential of existing CPUs for LLM-based inference.
[0022] For example, in a self-regressive decoding mode, only a subset of operators during the prompt processing phase can fully utilize the computational power of existing AI acceleration engines. Furthermore, for models with parameters exceeding 30 billion, HBM capacity (e.g., 64 GB per CPU socket) may fail in accommodating all the necessary variables, thereby diminishing the bandwidth benefits. Additionally, the large memory capacity of DDR5 may become less effective under the latency requirements of LLMs. Methods and apparatus for cross-memory speculative inference disclosed herein synergize both software and hardware for efficient inference. For example, to overcome the memory bottleneck inherent in the self-regressive characteristic of the decoding process under small batch sizes, dual-model cross-memory speculative inference is implemented to optimize the computing efficiency of AI-based acceleration engines and the high bandwidth of HBM without compromising the accuracy for massive-scale LLMs, as described in more detail below.
[0023] In some examples, the apparatus includes means for accelerating machine learning. For example, the means for accelerating machine learning may be implemented by machine learning accelerator circuitry 105. In some examples, the machine learning accelerator circuitry 105 may be instantiated by programmable circuitry such as the example programmable circuitry 612 of FIG. 6. For instance, the machine learning accelerator circuitry 105 may be instantiated by the example microprocessor 700 of FIG. 7 executing machine executable instructions such as those implemented by at least block 205 of FIG. 2. In some examples, the machine learning accelerator circuitry 105 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 800 of FIG. 8 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the machine learning accelerator circuitry 105 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the machine learning accelerator 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.
[0024] The model processing circuitry 110 loads weights associated with the draft model 120 (e.g., loaded into a HBM associated with the HBM execution circuitry 120) and / or the validation model 130 (e.g., loaded into a main memory associated with the main memory execution circuitry 125) . For example, the weights of the model correspond to weights that the model (s) learn and adjust during training. For example, the model processing circuitry 110 adjusts the model weights to minimize errors in predicting the correct outputs based on the input data, such that the draft model 120 and / or the validation model 130 can utilize the loaded weights to process new input data. In some examples, the model processing circuitry 110 deploys the draft model 120, which is substantially smaller than the target LLM (e.g., operating at a fraction of the LLM scale) , into HBM. In some examples, the model processing circuitry 110 deploys the validation model 130, which has a substantially larger parameter set, in DDR5 memory (e.g., main memory execution circuitry 125) .
[0025] In some examples, the apparatus includes means for processing a model. For example, the means for processing a model may be implemented by model processing circuitry 110. In some examples, the model processing circuitry 110 may be instantiated by programmable circuitry such as the example programmable circuitry 612 of FIG. 6. For instance, the model processing circuitry 110 may be instantiated by the example microprocessor 700 of FIG. 7 executing machine executable instructions such as those implemented by at least blocks 210, 220, and / or 230 of FIG. 2. In some examples, the model processing circuitry 110 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 800 of FIG. 8 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the model processing circuitry 110 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the model processing 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.
[0026] The high bandwidth memory (HBM) execution circuitry 115 uses the loaded draft model 120 to rapidly generate a sequence of K tokens. For example, the HBM execution circuitry 115 applies the swift inference of the draft model 120, resident in HBM due to its small scale, to look ahead by K tokens (e.g., equivalent to K decoding steps) , thus predicting the decoding sequence. In examples disclosed herein, the HBM execution circuitry 115 feeds these K predicted tokens into the validation model 130 (e.g., a target generation model loaded into the main memory) for batch validation. The speculative inference approach disclosed herein, combined with hardware feature optimization, facilitates the draft model 120 to fully utilize HBM’s bandwidth. For example, the dual-model system (e.g., use of a draft model and a verification model) across different memory nodes as described herein accelerates the inference phase speed. For example, the small-scale draft model 120 deployed in HBM capitalizes on its bandwidth for rapid predictions, which in turn facilitates the massive-scale verification model 130 deployed in DDR5 (e.g., main memory execution circuitry 125) to harness AI acceleration engine compute power during a validation stage that mirrors the computational traits of the prefill phase of inference. By this iterative cooperation, methods and apparatus disclosed herein significantly accelerate the inference speed of the verification model 130 (e.g., target generation model) .
[0027] In some examples, the apparatus includes means for executing processes associated with high bandwidth memory. For example, the means for executing processes associated with high bandwidth memory may be implemented by HBM execution circuitry 115. In some examples, the HBM execution circuitry 115 may be instantiated by programmable circuitry such as the example programmable circuitry 612 of FIG. 6. For instance, the HBM execution circuitry 115 may be instantiated by the example microprocessor 700 of FIG. 7 executing machine executable instructions such as those implemented by at least block 240 of FIG. 2. In some examples, the HBM execution circuitry 115 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 800 of FIG. 8 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the HBM execution circuitry 115 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the HBM execution 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.
[0028] The main memory execution circuitry 125 uses the loaded validation model 130 to receive draft tokens and / or perform batch verification. For example, the validation model 130 enhances the DDR5 cache utilization by augmenting the decoding granularity from one token to batch tokens. In examples disclosed herein, the K tokens generated by the draft model 120 are verified by the validation model 130. In some examples, the validation model 130 concatenates the accepted subset K' tokens, along with the input, to form the input for the next iteration cycle, continuing this iterative process until the generation task is completed. In examples disclosed herein, the validation phase keeps the inference prefill phase computational traits, involving a single decoding step that incorporates K tokens within input (s) . To maintain lossless accuracy, the main memory execution circuitry 125 accepts only tokens that perfectly match the results from the validation model 130 in forward order (e.g., denoted as accepted_k) during the validation phase. For example, the main memory execution circuitry 125 truncates and clears subsequent tokens that are not accepted, along with their corresponding Key-Value (KV) cache data. The main memory execution circuitry 125 concatenates the verified accepted_k tokens with the accurate (accepted_k + 1) th token (e.g., an output of the validation model 130) to form subsequent input for the next iteration.
[0029] In some examples, the main memory execution circuitry 125 determines a lookahead tokens count K based on output of the draft model 120, which is associated with looking ahead in the input stream. An overly ambitious K may escalate a predictive duration of the draft model 120, whereas an insufficient K may hinder the validation model 130 from fully utilizing AI-based acceleration in a single validation process. In examples disclosed herein, the elasticity of the K value is informed by the accuracy differences between the draft model 120 and the validation model 130 on different request types. For example, code generation requests, with narrower accuracy gap (s) , can accommodate a relatively larger K value, while text continuation requests, with broader gap (s) , require a more conservative K value. Therefore, the main memory execution circuitry 125 dynamically adjusts the K value, aligned with the acceptance rate during the inference process, therefore achieving a balance between resource utilization and end-to-end acceleration.
[0030] In some examples, the apparatus includes means for executing processes associated with a main memory. For example, the means for executing processes associated with a main memory may be implemented by main memory execution circuitry 125. In some examples, the main memory execution circuitry 125 may be instantiated by programmable circuitry such as the example programmable circuitry 612 of FIG. 6. For instance, the main memory execution circuitry 125 may be instantiated by the example microprocessor 700 of FIG. 7 executing machine executable instructions such as those implemented by at least block 250 of FIG. 2. In some examples, the main memory execution circuitry 125 may be instantiated by hardware logic circuitry, which may be implemented by an ASIC, XPU, or the FPGA circuitry 800 of FIG. 8 structured to perform operations corresponding to the machine readable instructions. Additionally or alternatively, the main memory execution circuitry 125 may be instantiated by any other combination of hardware, software, and / or firmware. For example, the main memory execution circuitry 125 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.
[0031] While an example manner of implementing the model execution circuitry 102 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 machine learning accelerator circuitry 105, the example model processing circuitry 110, the example HBM execution circuitry 115, the example main memory execution circuitry 125 and / or, more generally, the model execution circuitry 102 of FIG. 1 may be implemented by hardware, software, firmware and / or any combination of hardware, software and / or firmware. Thus, for example, any of the example machine learning accelerator circuitry 105, the example model processing circuitry 110, the example HBM execution circuitry 115, the example main memory execution circuitry 125 and / or, more generally, the model execution circuitry 102 of FIG. 1 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 model execution circuitry 102 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.
[0032] Flowcharts representative of example machine readable instructions, which may be executed by programmable circuitry to implement and / or instantiate the model execution circuitry 102 of FIG. 1 and / or representative of example operations which may be performed by programmable circuitry to implement and / or instantiate the model execution circuitry 102 of FIG. 1, are shown in FIGS. 2-4. 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 612 shown in the example processor platform 600 discussed below in connection with FIG. 6 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. 7 and / or 8. 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.
[0033] 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-4, many other methods of implementing the example model execution circuitry 102 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.
[0034] 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.
[0035] 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) .
[0036] 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.
[0037] As mentioned above, the example operations of FIGS. 2-4 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.
[0038] 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 model execution circuitry 102 of FIG. 1. The machine-readable instructions and / or the operations 200 of FIG. 2 begin at block 201, at which the machine learning accelerator circuitry 105 identifies existing hardware configuration (s) . For example, the machine learning accelerator circuitry 105 determines whether the hardware configuration includes high bandwidth memory (HBM) and / or a type of main memory (e.g., Double Data Rate 5 (DDR5) memory, etc. ) . In some examples, the machine learning accelerator circuitry 105 determines the existing accuracy of massive-scale large language model (LLM) inference tasks (e.g., as performed using the existing hardware configuration) , at block 203. For example, if the accuracy of LLM-based inference tasks can be improved, the machine learning accelerator circuitry 105 determines whether to initiate inference phase acceleration based on cross-memory speculative inference, at block 205. For example, cross-memory speculative inference can be initiated to accelerate massive-scale LLM inference, to allow LLMs to utilize an AI acceleration engine across both the prefill and decode phases of inference (e.g., by increasing the number of tokens in a single decoding step during the auto-regressive decoding process) . To initiate cross-memory speculative inference, the model processing circuitry 110 assigns weights to the draft model (e.g., a first model) and / or the validation model (e.g., a second model) , at block 210. In some examples, the model processing circuitry 110 trains the draft model and / or the validation model to perform rapid generation of batch draft tokens and / or perform batch verification, respectively. In the example of FIG. 2, the model processing circuitry 110 loads the draft model (e.g., draft model 120 of FIG. 1) into the HBM, at block 220, and loads the verification model (e.g., verification model 130 of FIG. 1) into the main memory, at block 230, resulting in a dual-model cross-memory deployment. For example, the first model (e.g., draft model 120) can be executed in a first portion of a memory of the at least one processor circuit (e.g., HBM) , such that the first portion of the memory (e.g., HBM) has a higher bandwidth than a second portion of the memory (e.g., main memory) , which executes the second model (e.g., validation model 130) . For example, the second portion of the memory (e.g., main memory) can be configured to perform matrix multiplication tasks of the LLM. Once the model (s) are loaded, the HBM execution circuitry 115 performs rapid generation of batch draft tokens (e.g., using the draft model 120) , at block 240, as described in more detail in connection with FIG. 3. After the batch draft tokens are generated, the main memory execution circuitry 125 receives the draft tokens and initiates batch verification (e.g., using the verification model 130) , at block 250, as described in more detail in connection with FIG. 4.
[0039] FIG. 3 is a flowchart representative of example machine-readable instructions and / or example operations 240 that may be executed, instantiated, and / or performed by example programmable circuitry to implement the example model execution circuitry 102 of FIG. 1 to perform rapid generation of batch draft tokens using a High Bandwidth Memory (HBM) node. The machine-readable instructions and / or the operations 240 of FIG. 2 begin at block 310, at which the HBM execution circuitry 115 accesses a Key-Value (KV) cache. For example, a KV cache can be used to accelerate the inference process in machine learning models, such as autoregressive models. KV caching involves the caching of previous keys and values, without the need for recalculating these keys and / or values for each new token, reducing the size (s) of matrices used in calculations and expediting matrix multiplications. In examples disclosed herein, the batch of tokens predicted using the draft model 120 can be a batch of tokens associated with a large language model (LLM) . However, the batch of tokens can be associated with any other type of large deep learning model. In examples disclosed herein, a token of the LLM can be identified using a KV pair and tokens stored in the KV cache.
[0040] In the example of FIG. 3, the HBM execution circuitry 115 causes the execution of the draft model 120 to generate token (s) , at block 320. For example, the draft model 120 rapidly generates a sequence of K tokens, which can be verified using the verification model 130, as described in connection with FIG. 4. In particular, the draft model 120 leverages a swift inference process to look ahead by K tokens (e.g., K token decoding steps) to predict a decoding sequence. The resulting K predicted tokens are provided to the verification model 130 for further batch validation. The HBM execution circuitry 115 determines whether to continue the execution of the draft model 120, at block 330. Once the sequence of K tokens is generated, the HBM execution circuitry 115 provides an output of the sequence to the main memory execution circuitry 125, at block 340, for further validation.
[0041] FIG. 4 is a flowchart representative of example machine-readable instructions and / or example operations 250 that may be executed, instantiated, and / or performed by example programmable circuitry to implement the example model execution circuitry 102 of FIG. 1 to received draft tokens and conduct batch verification using DDR5 memory. The machine-readable instructions and / or the operations 250 of FIG. 4 begin at block 410, at which the main memory execution circuitry 125 initializes a number of generated tokens (e.g., received from the draft model 120) and initializes a number of lookahead tokens (e.g., based on the batch of tokens predicted by the draft model 120) , at block 420. For example, the lookahead tokens is associated with output of the draft model 120, such that an overly ambitious K may escalate a predictive duration of the draft model 120, whereas an insufficient K may hinder the validation model 130 from fully utilizing AI-based acceleration. In examples disclosed herein, the main memory execution circuitry 125 dynamically adjusts the K value to align with a desired acceptance rate during the inference process, as described in connection with FIG. 1. For example, the acceptance rate of the predicted tokens results in changes to the acceleration impact for diverse inference requests. For example, the main memory execution circuitry 125 initializes the number of lookahead tokens based on a task to be performed by the validation model 130. In the example of FIG. 4, the main memory execution circuitry 125 initiates lookahead (e.g., using the draft model 120 and / or number of lookahead tokens) to generate tokens, at block 430. The main memory execution circuitry 125 proceeds to validate the generated tokens using the validation model 130 of FIG. 1 to identify a number of the generated tokens to accept, at block 440. In some examples, the task can correspond to an LLM inference task (e.g., generating predictions from prior data, etc. ) . Since LLMs operate using tokens, certain LLM tasks may require a higher K value, while other tasks can be completed using a lower K value. For example, generated tokens are converted into vector embeddings, a numerical representation that the model can make inferences from, allowing the LLM to process the embeddings to generate an output.
[0042] For example, as described in connection with FIG. 1, the main memory execution circuitry 125 accepts only tokens that perfectly match the results from the validation model 130 in forward order (e.g., denoted as accepted_k) during the validation phase. The main memory execution circuitry 125 concatenates the verified accepted_k tokens with the accurate (accepted_k + 1) th token (e.g., an output of the validation model 130) to form subsequent input for the next iteration. As such, in the example of FIG. 4, the main memory execution circuitry 125 updates the number of generated tokens based on the number of accepted tokens, at block 450, and determines whether the number of generated tokens is more than a set maximum number of tokens, at block 460. If the number of generated tokens is not greater than the maximum number of tokens, the main memory execution circuitry 125 initiates the adjustment of the number of lookahead tokens, at block 470. Once the maximum number of tokens is reached, the main memory execution circuitry 125 outputs the generated tokens, at block 480. In some examples, the main memory execution circuitry 125 uses the validation model 130 to concatenate the accepted subset of tokens, along with the input, to form the input for the next iteration cycle, which continues until the generation task is completed and the main memory execution circuitry 125 returns the generated tokens, at block 480. In examples disclosed herein, once the generated tokens are validated, the validated tokens can be added to the KV cache.
[0043] FIG. 5 illustrates an example cross-memory speculative inference pipeline 500 constructed in accordance with teachings of this disclosure to accelerate LLM inference-based tasks. In the example of FIG. 5, the inference algorithm flow associated with the dual-model cross-memory speculative inference disclosed herein is represented as a sequential prediction and validation process for the same batch of inference requests. For example, although the draft model 120 prediction accelerates the inference speed of the validation model 130, additional computational overhead is incurred as a result. In examples disclosed herein, a single batch is segmented into multiple micro-batches, integrating a pipeline parallelism strategy. As such, the overhead introduced by the draft model 120 is reduced and / or eliminated by facilitating overlap between and / or among the micro-batches. This approach is particularly effective in improving throughput in systems equipped with numerous cores and / or distributed across multiple computing nodes. In the example of FIG. 5, a micro-batch inference identifier 505 indicates three different micro-batches 510, 515, 520 generated from a single batch. A temporal view of the inference algorithm flow progress is shown using an example tensor flow 525 (e.g., representing tokens or KV values) and time indicator 530. The inference algorithm flow associated with the validation model 130 and the draft model 120 is shown with an example interaction 535 between the models, as indicated using an example validation model algorithm flow 540, interaction algorithm flow 545, and draft model algorithm flow 550. As shown in the example of FIG. 5, the draft model 120 initiates the inference pipeline 500 flow (e.g., at N-IEN prompt) and the validation model 130 completes the inference pipeline 500 flow (e.g., ending with a validation output) .
[0044] In examples disclosed herein, the utilization of available hardware resources (e.g., HBM 115, machine learning accelerator circuitry 105 and / or AI accelerator engine, etc. ) is optimized to achieve significant performance improvements in massive-scale LLM inference tasks. In examples disclosed herein, the algorithm associated with dual-model cross-memory speculative inference was tested through implementation on an CPU Max 9468 (e.g., running on a CentOS Stream 8 operating system) . For example, the Llama-2-70b model was deployed as a generation model (e.g., validation model 130) and testing was configured using a batch size (e.g., a batch size of 1) , an input prompt length (e.g., input prompt length of 512) , and an output length (e.g., an output length of 512) , with a bf16 (brain floating point) data type selected for text continuation tasks. In examples disclosed herein, the draft model 120 tested was Llama-2-7b, with results demonstrating a significant reduction of up to 47.6%of the baseline time, equal to a speedup of approximately double without any accuracy loss. Furthermore, the acceleration impact for diverse inference requests was observed to fluctuate in accordance with the acceptance rate of the predicted tokens, while the overall enhancement in speed was found to increase by two to three times using methods and apparatus disclosed herein.
[0045] FIG. 6 is a block diagram of an example programmable circuitry platform 600 structured to execute and / or instantiate the example machine-readable instructions and / or the example operations of FIGS. 2-4 to implement the example model execution circuitry 102 of FIG. 1. The programmable circuitry platform 600 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.
[0046] The programmable circuitry platform 600 of the illustrated example includes programmable circuitry 612. The programmable circuitry 612 of the illustrated example is hardware. For example, the programmable circuitry 612 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 612 may be implemented by one or more semiconductor based (e.g., silicon based) devices. In this example, the processor circuitry 612 implements the machine learning accelerator circuitry 105, the model processing circuitry 110, the HBM execution circuitry 115, and the main memory execution circuitry 125.
[0047] The programmable circuitry 612 of the illustrated example includes a local memory 613 (e.g., a cache, registers, etc. ) . The programmable circuitry 612 of the illustrated example is in communication with a main memory including a volatile memory 614 and a non-volatile memory 616 by a bus 618. The volatile memory 614 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 616 may be implemented by flash memory and / or any other desired type of memory device. Access to the main memory 614, 616 of the illustrated example is controlled by a memory controller 617. In some examples, the memory controller 617 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 614, 616.
[0048] The programmable circuitry platform 600 of the illustrated example also includes interface circuitry 620. The interface circuitry 620 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.
[0049] In the illustrated example, one or more input devices 622 are connected to the interface circuitry 620. The input device (s) 622 permit (s) a user (e.g., a human user, a machine user, etc. ) to enter data and / or commands into the programmable circuitry 612. The input device (s) 622 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.
[0050] One or more output devices 624 are also connected to the interface circuitry 620 of the illustrated example. The output devices 624 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 620 of the illustrated example, thus, typically includes a graphics driver card, a graphics driver chip, and / or graphics processor circuitry such as a GPU.
[0051] The interface circuitry 620 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 626. 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.
[0052] The programmable circuitry platform 600 of the illustrated example also includes one or more mass storage devices 628 to store software and / or data. Examples of such mass storage devices 628 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.
[0053] The machine executable instructions 632, which may be implemented by the machine readable instructions of FIGS. 2-4, may be stored in the mass storage device 628, in the volatile memory 614, in the non-volatile memory 616, and / or on at least one non-transitory computer readable storage medium such as a CD or DVD which may be removable.
[0054] FIG. 7 is a block diagram of an example implementation of the programmable circuitry 612 of FIG. 6. In this example, the programmable circuitry 612 of FIG. 6 is implemented by a microprocessor 700. For example, the microprocessor 700 may be a general purpose microprocessor (e.g., general purpose microprocessor circuitry) . The microprocessor 700 executes some or all of the machine readable instructions of the flowcharts of FIGS. 2-4 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 700 in combination with the instructions. For example, the microprocessor 700 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 702 (e.g., 1 core) , the microprocessor 700 of this example is a multi-core semiconductor device including N cores. The cores 702 of the microprocessor 700 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 702 or may be executed by multiple ones of the cores 702 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 702. 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-4.
[0055] The cores 702 may communicate by a first example bus 704. In some examples, the first bus 704 may implement a communication bus to effectuate communication associated with one (s) of the cores 702. For example, the first bus 704 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 704 may implement any other type of computing or electrical bus. The cores 702 may obtain data, instructions, and / or signals from one or more external devices by example interface circuitry 706. The cores 702 may output data, instructions, and / or signals to the one or more external devices by the interface circuitry 706. Although the cores 702 of this example include example local memory 720 (e.g., Level 1 (L1) cache that may be split into an L1 data cache and an L1 instruction cache) , the microprocessor 700 also includes example shared memory 710 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 710. The local memory 720 of each of the cores 702 and the shared memory 710 may be part of a hierarchy of storage devices including multiple levels of cache memory and the main memory (e.g., the main memory 614, 616 of FIG. 6) . 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.
[0056] Each core 702 may be referred to as a CPU, DSP, GPU, etc., or any other type of hardware circuitry. Each core 702 includes control unit circuitry 714, arithmetic and logic (AL) circuitry (sometimes referred to as an ALU) 716, a plurality of registers 718, the L1 cache 720, and a second example bus 722. Other structures may be present. For example, each core 702 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 714 includes semiconductor-based circuits structured to control (e.g., coordinate) data movement within the corresponding core 702. The AL circuitry 716 includes semiconductor-based circuits structured to perform one or more mathematic and / or logic operations on the data within the corresponding core 702. The AL circuitry 716 of some examples performs integer-based operations. In other examples, the AL circuitry 716 also performs floating-point operations. In yet other examples, the AL circuitry 716 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 716 may be referred to as an Arithmetic Logic Unit (ALU) .
[0057] The registers 718 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 716 of the corresponding core 702. For example, the registers 718 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 718 may be arranged in a bank as shown in FIG. 7. Alternatively, the registers 718 may be organized in any other arrangement, format, or structure including distributed throughout the core 702 to shorten access time. The second bus 722 may be implemented by at least one of an I2C bus, a SPI bus, a PCI bus, or a PCIe bus.
[0058] Each core 702 and / or, more generally, the microprocessor 700 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 700 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.
[0059] The microprocessor 700 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 700, in the same chip package as the microprocessor 700 and / or in one or more separate packages from the microprocessor 700.
[0060] FIG. 8 is a block diagram of another example implementation of the programmable circuitry of FIG. 6. In this example, the programmable circuitry 612 is implemented by FPGA circuitry 800. For example, the FPGA circuitry 800 may be implemented by an FPGA. The FPGA circuitry 800 can be used, for example, to perform operations that could otherwise be performed by the example microprocessor 800 of FIG. 8 executing corresponding machine readable instructions. However, once configured, the FPGA circuitry 800 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.
[0061] More specifically, in contrast to the microprocessor 700 of FIG. 7 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-4 but whose interconnections and logic circuitry are fixed once fabricated) , the FPGA circuitry 800 of the example of FIG. 8 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-4. In particular, the FPGA 800 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 800 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-4. As such, the FPGA circuitry 800 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-4 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 800 may perform the operations / functions corresponding to the some or all of the machine readable instructions of FIGS. 2-4 faster than the general-purpose microprocessor can execute the same.
[0062] In the example of FIG. 8, the FPGA circuitry 800 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 800 of FIG. 8 may access and / or load the binary file to cause the FPGA circuitry 800 of FIG. 8 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 800 of FIG. 8 to cause configuration and / or structuring of the FPGA circuitry 800 of FIG. 8, or portion (s) thereof.
[0063] 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 800 of FIG. 8 may access and / or load the binary file to cause the FPGA circuitry 800 of FIG. 8 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 800 of FIG. 8 to cause configuration and / or structuring of the FPGA circuitry 800 of FIG. 8, or portion (s) thereof.
[0064] The FPGA circuitry 800 of FIG. 8, includes example input / output (I / O) circuitry 802 to obtain and / or output data to / from example configuration circuitry 804 and / or external hardware 806. For example, the configuration circuitry 804 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 800, or portion (s) thereof. In some such examples, the configuration circuitry 804 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 806 may be implemented by external hardware circuitry. For example, the external hardware 806 may be implemented by the microprocessor 700 of FIG. 7.
[0065] The FPGA circuitry 800 also includes an array of example logic gate circuitry 808, a plurality of example configurable interconnections 810, and example storage circuitry 812. The logic gate circuitry 808 and the configurable interconnections 810 are configurable to instantiate one or more operations / functions that may correspond to at least some of the machine readable instructions of FIGS. 2-4 and / or other desired operations. The logic gate circuitry 808 shown in FIG. 8 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 808 to enable configuration of the electrical structures and / or the logic gates to form circuits to perform desired operations / functions. The logic gate circuitry 808 may include other electrical structures such as look-up tables (LUTs) , registers (e.g., flip-flops or latches) , multiplexers, etc.
[0066] The configurable interconnections 810 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 808 to program desired logic circuits.
[0067] The storage circuitry 812 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 812 may be implemented by registers or the like. In the illustrated example, the storage circuitry 812 is distributed amongst the logic gate circuitry 808 to facilitate access and increase execution speed.
[0068] The example FPGA circuitry 800 of FIG. 8 also includes example dedicated operations circuitry 814. In this example, the dedicated operations circuitry 814 includes special purpose circuitry 816 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 816 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 800 may also include example general purpose programmable circuitry 818 such as an example CPU 820 and / or an example DSP 822. Other general purpose programmable circuitry 818 may additionally or alternatively be present such as a GPU, an XPU, etc., that can be programmed to perform other operations.
[0069] Although FIGS. 7 and 8 illustrate two example implementations of the programmable circuitry 612 of FIG. 6, many other approaches are contemplated. For example, FPGA circuitry may include an on-board CPU, such as one or more of the example CPU 820 of FIG. 8. Therefore, the programmable circuitry 612 of FIG. 6 may additionally be implemented by combining at least the example microprocessor 700 of FIG. 7 and the example FPGA circuitry 800 of FIG. 8. In some such hybrid examples, one or more cores 802 of FIG. 8 may execute a first portion of the machine readable instructions represented by the flowchart (s) of FIGS. 2-4 to perform first operation (s) / function (s) , the FPGA circuitry 800 of FIG. 8 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-4, 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-4.
[0070] 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 700 of FIG. 7 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 800 of FIG. 8 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.
[0071] 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 700 of FIG. 7 may execute machine readable instructions in one or more threads executing concurrently and / or in series. In some examples, the FPGA circuitry 800 of FIG. 8 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 700 of FIG. 7.
[0072] In some examples, the programmable circuitry 612 of FIG. 6 may be in one or more packages. For example, the microprocessor 700 of FIG. 7 and / or the FPGA circuitry 800 of FIG. 8 may be in one or more packages. In some examples, an XPU may be implemented by the programmable circuitry 612 of FIG. 6 which may be in one or more packages. For example, the XPU may include a CPU (e.g., the microprocessor 700 of FIG. 7, the CPU 820 of FIG. 8, etc. ) in one package, a DSP (e.g., the DSP 822 of FIG. 8) in another package, a GPU in yet another package, and an FPGA (e.g., the FPGA circuitry 800 of FIG. 8) in still yet another package.
[0073] A block diagram illustrating an example software distribution platform 905 to distribute software such as the example machine readable instructions 632 of FIG. 6 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. 9. The example software distribution platform 905 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 905. For example, the entity that owns and / or operates the software distribution platform 905 may be a developer, a seller, and / or a licensor of software such as the example machine readable instructions 632 of FIG. 6. 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 605 includes one or more servers and one or more storage devices. The storage devices store the machine readable instructions 632, which may correspond to the example machine readable instructions of FIGS. 2-4, as described above. The one or more servers of the example software distribution platform 605 are in communication with an example network 610, 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 632 from the software distribution platform 905. For example, the software, which may correspond to the example machine readable instructions of FIGS. 2-4, may be downloaded to the example programmable circuitry platform 600, which is to execute the machine readable instructions 632 to implement the model execution circuitry 102 of FIG. 1. In some examples, one or more servers of the software distribution platform 905 periodically offer, transmit, and / or force updates to the software (e.g., the example machine readable instructions 632 of FIG. 6) 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.
[0074] “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.
[0075] 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.
[0076] 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.
[0077] 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) .
[0078] 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.
[0079] From the foregoing, it will be appreciated that example systems, methods, apparatus, and articles of manufacture disclosed herein introduce cross-memory dual-model speculative inference for massive-scale LLMs using processing units with AI acceleration engines. In examples disclosed herein, cross-memory dual-model speculative inference increases a number of tokens in a single decoding step during an auto-regressive decoding process, effectively mitigating the memory bottleneck in the decode phase. As a result, cross-memory dual-model speculative inference disclosed herein enables LLMs to utilize AI-based acceleration across both the prefill and decode phases, particularly for small-batch inference. Furthermore, use of a cross-memory deployment strategy in connection with HBM and / or DDR5 overcomes the existing limitations of HBM capacity for massive-scale LLMs by efficiently utilizing the bandwidth of HBM and the capacity of DDR5. Furthermore, the use of a pipelined speculative inference scheme disclosed herein introduces a micro-batch dimension, enabling concurrent speculative and generation processes. The dual-model cross-memory speculative inference disclosed herein is scalable across both memory and computing nodes and permits adaptability across different hardware configurations and / or dual memory systems. Thus, examples disclosed herein result in improvements to the operation of a machine.
[0080] Example methods, apparatus, systems, and articles of manufacture for cross-memory speculative inference associated with massive-scale large language models (LLMs) are disclosed herein. Further examples and combinations thereof include the following:
[0081] Example 1 includes at least one non-transitory machine-readable medium comprising machine-readable instructions to cause at least one processor circuit to at least cause a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache, validate tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model, select one or more validated tokens, and add the selected one or more validated tokens to the key-value cache.
[0082] Example 2 includes the at least one non-transitory machine-readable medium of example 1, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.
[0083] Example 3 includes the at least one non-transitory machine-readable medium of one or more of examples 1-2, wherein the machine-readable instructions are to cause one or more of the at least one processor circuit to, after validation of the tokens in the batch of tokens, adjust a number of the lookahead tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.
[0084] Example 4 includes the at least one non-transitory machine-readable medium of one or more of examples 1-3, wherein the machine-readable instructions are to cause one or more of the at least one processor circuit to initialize the number of lookahead tokens based on a task to be performed by the second model.
[0085] Example 5 includes the at least one non-transitory machine-readable medium of example 1, wherein the first model is to be executed in a first portion of a memory of the at least one processor circuit.
[0086] Example 6 includes the at least one non-transitory machine-readable medium of one or more of examples 1-5, wherein the second model is executed in a second portion of the memory of the at least one processor circuit, the first portion of the memory having higher bandwidth than the second portion of the memory.
[0087] Example 7 includes the at least one non-transitory machine-readable medium of one or more of examples 1-6, wherein the second portion of the memory is configured to perform matrix multiplication tasks of the LLM.
[0088] Example 8 includes the at least one non-transitory machine-readable medium of example 1, wherein the first model is a draft model and the second model is a validation model, the draft model to rapidly generate the batch of tokens for verification by the validation model.
[0089] Example 9 includes an apparatus, comprising interface circuitry, machine-readable instructions, and at least one processor circuit to be programmed by the machine-readable instructions to cause a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache, validate tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model, select one or more validated tokens, and add the selected one or more validated tokens to the key-value cache.
[0090] Example 10 includes the apparatus of example 9, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.
[0091] Example 11 includes the apparatus of one or more of examples 9-10, wherein one or more of the at least one processor circuit is to, after validation of the tokens in the batch of tokens, adjust a number of the lookahead tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.
[0092] Example 12 includes the apparatus of one or more of examples 9-11, wherein one or more of the at least one processor circuit is to initialize the number of lookahead tokens based on a task to be performed by the second model.
[0093] Example 13 includes the apparatus of example 9, wherein the first model is to be executed in a first portion of a memory of the at least one processor circuit.
[0094] Example 14 includes the apparatus of one or more of examples 9-13, wherein the second model is executed in a second portion of the memory of the at least one processor circuit, the first portion of the memory having higher bandwidth than the second portion of the memory.
[0095] Example 15 includes the apparatus of one or more of examples 9-14, wherein the second portion of the memory is configured to perform matrix multiplication tasks of the LLM.
[0096] Example 16 includes the apparatus of example 9, wherein the first model is a draft model and the second model is a validation model, the draft model to rapidly generate the batch of tokens for verification by the validation model.
[0097] Example 17 includes an apparatus, comprising means for executing processes associated with high bandwidth memory to cause a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache, and means for executing processes associated with a main memory to validate tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model, select one or more validated tokens, and add the selected one or more validated tokens to the key-value cache.
[0098] Example 18 includes the apparatus of example 17, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.
[0099] Example 19 includes the apparatus of one or more of examples 17-18, wherein the means for executing processes associated with a main memory is to adjust a number of the lookahead tokens after validation of the tokens in the batch of tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.
[0100] Example 20 includes the apparatus of one or more of examples 17-19, wherein the means for executing processes associated with a main memory is to initialize the number of lookahead tokens based on a task to be performed by the second model.
[0101] Example 21 includes the apparatus of example 17, wherein the first model is to be executed in a first portion of a memory.
[0102] Example 22 includes the apparatus of one or more of examples 17-21, wherein the second model is executed in a second portion of the memory, the first portion of the memory having higher bandwidth than the second portion of the memory.
[0103] Example 23 includes the apparatus of one or more of examples 17-22, wherein the second portion of the memory is configured to perform matrix multiplication tasks of the LLM.
[0104] Example 24 includes the apparatus of example 17, wherein the first model is a draft model and the second model is a validation model, the draft model to rapidly generate the batch of tokens for verification by the validation model.
[0105] Example 25 includes a method, comprising causing a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache, validating tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model, selecting one or more validated tokens, and adding the selected one or more validated tokens to the key-value cache.
[0106] Example 26 includes the method of example 25, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.
[0107] Example 27 includes the method of one or more of examples 25-26, further including adjusting a number of the lookahead tokens after validation of the tokens in the batch of tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.
[0108] Example 28 includes the method of one or more of examples 25-27, further including initializing the number of lookahead tokens based on a task to be performed by the second model.
[0109] Example 29 includes the method of example 25, wherein the first model is executed in a first portion of a memory.
[0110] Example 30 includes the method of one or more of examples 25-29, wherein the second model is executed in a second portion of the memory, the first portion of the memory having higher bandwidth than the second portion of the memory.
[0111] Example 31 includes the method of one or more of examples 25-30, wherein the second portion of the memory is configured to perform matrix multiplication tasks of the LLM.
[0112] Example 32 includes the method of example 25, wherein the first model is a draft model and the second model is a validation model, the draft model to rapidly generate the batch of tokens for verification by the validation model.
[0113] 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.At least one non-transitory machine-readable medium comprising machine-readable instructions to cause at least one processor circuit to at least:cause a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache;validate tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model;select one or more validated tokens; andadd the selected one or more validated tokens to the key-value cache.2.The at least one non-transitory machine-readable medium of claim 1, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.3.The at least one non-transitory machine-readable medium of claim 2, wherein the machine-readable instructions are to cause one or more of the at least one processor circuit to, after validation of the tokens in the batch of tokens, adjust a number of the lookahead tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.4.The at least one non-transitory machine-readable medium of claim 3, wherein the machine-readable instructions are to cause one or more of the at least one processor circuit to initialize the number of lookahead tokens based on a task to be performed by the second model.5.The at least one non-transitory machine-readable medium of claim 1, wherein the first model is to be executed in a first portion of a memory of the at least one processor circuit.6.The at least one non-transitory machine-readable medium of claim 5, wherein the second model is executed in a second portion of the memory of the at least one processor circuit, the first portion of the memory having higher bandwidth than the second portion of the memory.7.The at least one non-transitory machine-readable medium of claim 6, wherein the second portion of the memory is configured to perform matrix multiplication tasks of the LLM.8.The at least one non-transitory machine-readable medium of claim 1, wherein the first model is a draft model and the second model is a validation model, the draft model to rapidly generate the batch of tokens for verification by the validation model.9.An apparatus, comprising:interface circuitry;machine-readable instructions; andat least one processor circuit to be programmed by the machine-readable instructions to:cause a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache;validate tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model;select one or more validated tokens; andadd the selected one or more validated tokens to the key-value cache.10.The apparatus of claim 9, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.11.The apparatus of claim 10, wherein one or more of the at least one processor circuit is to, after validation of the tokens in the batch of tokens, adjust a number of the lookahead tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.12.The apparatus of claim 11, wherein one or more of the at least one processor circuit is to initialize the number of lookahead tokens based on a task to be performed by the second model.13.The apparatus of claim 9, wherein the first model is to be executed in a first portion of a memory of the at least one processor circuit.14.The apparatus of claim 13, wherein the second model is executed in a second portion of the memory of the at least one processor circuit, the first portion of the memory having higher bandwidth than the second portion of the memory.15.The apparatus of claim 14, wherein the second portion of the memory is configured to perform matrix multiplication tasks of the LLM.16.The apparatus of claim 9, wherein the first model is a draft model and the second model is a validation model, the draft model to rapidly generate the batch of tokens for verification by the validation model.17.An apparatus, comprising:means for executing processes associated with high bandwidth memory to cause a batch of tokens of a large language model (LLM) to be predicted using a first model, a token of the LLM being defined by a key-value pair and tokens stored in a key-value cache; andmeans for executing processes associated with a main memory to:validate tokens in the batch of tokens using a second model, a size of the first model being smaller than a size of the second model;select one or more validated tokens; andadd the selected one or more validated tokens to the key-value cache.18.The apparatus of claim 17, wherein the first model predicts the batch of tokens by decoding the batch of tokens, the predicted batch of tokens being read by the second model as a batch of lookahead tokens.19.The apparatus of claim 18, wherein the means for executing processes associated with a main memory is to adjust a number of the lookahead tokens after validation of the tokens in the batch of tokens, the validation including increasing single step decoding granularity of the second model from one token to the batch of tokens.20.The apparatus of claim 19, wherein the means for executing processes associated with a main memory is to initialize the number of lookahead tokens based on a task to be performed by the second model.
Citation Information
Patent Citations
Large model cache-based speculation reasoning acceleration method
CN118313456A
Token caching method and electronic equipment
CN118747120A
Speculative decoding in autoregressive generative artificial intelligence models
US20240320433A1
Methods and systems for fast inference from machine learning models
WO2024118603A1
Speculative decoding in autoregressive generative artificial intelligence models
WO2024220143A1