Hybrid precision interface in neural network processing units
The fabric interface in NPUs addresses the challenge of varying precision needs by dynamically transforming data precision within PEs, enhancing computational efficiency and compatibility across neural network tasks.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- MOFFETT TECH CO LTD
- Filing Date
- 2024-10-21
- Publication Date
- 2026-04-30
AI Technical Summary
Existing neural network processing units (NPUs) face challenges in efficiently handling the high computational demands and memory requirements due to the need for flexible data precision transformation between low-precision (LP) and high-precision (HP) representations, as different neural network tasks require varying levels of precision for optimal performance.
A fabric interface within each Processing Entity (PE) in a Network-on-Chip (NoC) architecture that supports hybrid precision sparsification, enabling data to be transformed between LP and HP formats through channel and bit-depth extension/compression circuits, using look-up-tables to adjust precision dynamically.
Enables efficient data transmission and storage, optimizing resource utilization and computational efficiency by aligning data precision with memory requirements, ensuring compatibility with diverse neural network tasks and hardware platforms.
Smart Images

Figure CN2024125974_30042026_PF_FP_ABST
Abstract
Description
Hybrid Precision Interface in Neural Network Processing UnitsTECHNICAL FIELD
[0001] The present invention pertains to the field of neural networks and, more specifically, to a circuit design with a fabric interface supporting hybrid precision data exchange in neural network processing unit.BACKGROUND
[0002] Neural networks (NNs) have become central to various advanced computational fields, such as computer vision, natural language processing (NLP) , and autonomous systems. These networks are characterized by a massive number of parameters, including weights, and intermediate states, such as activations, which significantly increase the demand for computational power and memory resources. The efficient handling of these resource-intensive computations is critical for the effective deployment of modern neural networks.
[0003] To address the high computational demands of such large-scale NNs, contemporary neural network processing units (NPUs) or accelerators employ arrays of processing entities (PEs) . These PEs are typically arranged in a Network-on-Chip (NoC) architecture to enhance the parallelism required for NN computations. By performing computations simultaneously and sharing data through multiple channels, the PEs can implement a pipeline architecture, optimizing both data flow and computational speed. The structure of the NoC allows PEs to collaborate in real-time, exchanging intermediate data as needed to efficiently process neural network tasks.
[0004] In addition to parallelism, NPUs or accelerators leverage techniques such as sparsification and quantization. These methods help reduce the memory footprint and bandwidth consumption of tensors-the fundamental data structures in NN computations-further alleviating the computational and memory requirements. Quantization, in particular, plays a key role in adjusting the precision of tensor data at different stages of the neural network’s operation.
[0005] In practice, data within the NoC should ideally shift between different bit-depth representations at various stages of its lifecycle. For instance, during transmission between PEs or even between different NoCs, low-precision (LP) representations are preferred to accelerate data movement and save bandwidth. However, during computation within a PE, high-precision (HP) representations are more desired to ensure the necessary accuracy. The specific levels of LP and HP can vary depending on the task at hand, as different neural network tasks and use cases demand different levels of precision.
[0006] Thus, there is a clear need for a flexible circuit, e.g., in an inference system, capable of transforming tensors between LP and HP in both directions, as well as supporting various LP and HP formats to accommodate the diverse requirements of different NN tasks. This disclosure describes a design of the flexible circuit,SUMMARY
[0007] Various embodiments of the present specification may include processors and systems implementing a circuit interface supporting hybrid precision for data transmission, storage, and processing. A system composed of one or more computers can be configured to perform specific operations or actions by installing software, firmware, hardware, or a combination of these elements. This configuration enables the system to carry out the designated actions. Similarly, computer programs can be designed to perform particular operations by including instructions that, when executed by data processing apparatus, prompt the apparatus to execute these actions.
[0008] In one general aspect, a novel fabric interface of a PE in a NoC is described. In some embodiments, the fabric interface may include a channel extension circuit configured to: receive first data from another PE, extend a channel dimension of the first data to obtain extended data with an increased dimension aligned with a minimum data granularity of a memory associated with the PE, and store the extended data in the memory; and a channel compression circuit configured to: fetch second data from the memory; compress the channel dimension of the second data to obtain compressed data with a reduced dimension; and output the compressed data from the PE.
[0009] In some embodiments, to extend the channel dimension of the first data, the channel extension circuit is further configured to: pad one or more zero values to a channel dimension of the first data to increase a dimension of the first data to align with the minimum data granularity of the memory.
[0010] In some embodiments, the fabric interface may further include a bit-depth extension circuit configured to increase a bit-depth of data elements in the first data using a first look-up-table (LUT) .
[0011] In some embodiments, the bit-depth extension circuit is further configured to: store, in the first LUT, a plurality of low bit-depth keys respectively mapped to a plurality of high bit-depth values; identify one of the plurality of low bit-depth keys based on a low bit-depth representation of a data element of the first data; determine one of the plurality of high bit-depth values corresponding to the identified low bit-depth key; and replace the low bit-depth representation of the data element of the first data with the determined high bit-depth value.
[0012] In some embodiments, to compress the channel dimension of the second data, the channel compression circuit is further configured to: remove one or more zero values from a channel dimension of the second data and reduce a bit-depth of the second data before outputting from the PE.
[0013] In some embodiments, the fabric interface may further include a bit-depth compression circuit configured to compress a bit-depth of data elements in the second data using a second LUT.
[0014] In some embodiments, the bit-depth compression circuit is further configured to: store, in the second LUT, a plurality of high bit-depth keys mapped to a plurality of low bit-depth values; identify one of the plurality of high bit-depth key based on a high bit-depth representation of a data element in the second data; determine one of the plurality of low bit-depth values corresponding to the identified high bit-depth key; and replace the high bit-depth representation of the data element of the second data with the determined low bit-depth value.
[0015] In some embodiments, the plurality of low bit-depth keys in the first LUT stores have multiple different low bit-depths.
[0016] In some embodiments, the plurality of high bit-depth keys in the second LUT have the same high bit-depth.
[0017] In some embodiments, the PE array forms a mesh network-on-chip (NoC) , and the fabric interface further includes: a first output port for intra-NoC data transmission that is coupled to another PE in the NoC, where the compressed data is output through the first output port to the other PE in the NoC.
[0018] In some embodiments, the first output port is configured to perform instant transmission of the compressed data to the other PE in the same NoC.
[0019] In some embodiments, the PE array forms a mesh network-on-chip (NoC) , and the fabric interface further includes: a second output port for intra-NoC or cross-NoC data transmission that is coupled to an intermediate memory of the mesh NoC, where the compressed data is output through the second output port into the intermediate memory, pending retrieval by another PE in the NoC or from another NoC.
[0020] In some embodiments, the second output port is configured to perform a delayed transmission of the compressed data to the other PE.
[0021] In some embodiments, the fabric interface may further include a third output port for cross-NoC data transmission that is coupled to another NoC, where the compressed data is output through the third output port to another PE from the other NoC.
[0022] In some embodiments, the fabric interface may further include a Direct-Memory-Access (DMA) controller that configures a target bit-depth of the extended data and the compressed data.
[0023] In one general aspect, the fabric interface of the PE may perform a method. The method may include receiving first data from another PE; extending a channel dimension of the first data to obtain extended data with an increased dimension aligned with a minimum data granularity of a memory associated with the PE; storing the extended data into the memory associated with the PE; fetching second data from the memory associated with the PE; compressing the channel dimension of the second data to obtain compressed data with a reduced dimension; and outputting the compressed data from the PE.
[0024] In some embodiments, the extending the channel dimension of the first data includes: padding one or more zero values to the channel dimension of the first data to increase a dimension of the first data to align with the minimum data granularity of the memory.
[0025] In some embodiments, the method may further include increasing a bit-depth of data elements in the first data using a first look-up-table (LUT) by: storing, in the first LUT, a plurality of low bit-depth keys respectively mapped to a plurality of high bit-depth values; identifying one of the plurality of low bit-depth keys based on a low bit-depth representation of a data element of the first data; determining one of the plurality of high bit-depth values corresponding to the identified low bit-depth key; and replacing the low bit-depth representation of the data element of the first data with the determined high bit-depth value.
[0026] In some embodiments, the compressing the channel dimension of the second data includes: removing one or more zero values from the channel dimension of the second data to reduce a bit-depth of the second data based on a configuration instruction that configures the memory.
[0027] In some embodiments, the method may further include compressing a bit-depth of data elements in the second data using a second LUT by: storing, in the second LUT, a plurality of high bit-depth keys mapped to a plurality of low bit-depth values; identifying one of the plurality of high bit-depth key in the second LUT based on a high bit-depth presentation of a data element in the second data; determining one of the plurality of low bit-depth values corresponding to the identified high bit-depth key; and replacing the high bit-depth representation of the data element of the second data with the determined low bit-depth value.
[0028] These and other features of the systems, methods, and non-transitory computer-readable media disclosed herein, as well as the methods of operation and functions of the related elements of structure and the combination of parts and economies of manufacture, will become more apparent upon consideration of the following description and the appended claims with reference to the accompanying drawings, all of which form a part of this specification, wherein like reference numerals designate corresponding parts in the various figures. It is to be expressly understood, however, that the drawings are for purposes of illustration and description only and are not intended as a definition of the limits of the invention.BRIEF DESCRIPTION OF THE DRAWINGS
[0029] FIG. 1 illustrates an exemplary system diagram of a neural network processing unit, in accordance with various embodiments.
[0030] FIG. 2 illustrates an example Processing Entity (PE) in the neural network processing unit, in accordance with various embodiments.
[0031] FIG. 3 illustrates an example fabric interface of a PE in a neural network processing unit supporting hybrid precision sparsification, in accordance with various embodiments.
[0032] FIG. 4A illustrates example data flows in a neural network processing unit supporting hybrid precision sparsification, in accordance with various embodiments.
[0033] FIG. 4B illustrates an example sparse codec in a neural network processing unit supporting hybrid precision sparsification, in accordance with various embodiments.
[0034] FIG. 5 illustrates an example method for data exchange using hybrid precision, in accordance with various embodiments.
[0035] DETAIL DESCRIPTION OF THE EMBODIMENTS
[0036] Embodiments described herein provide methods, systems, apparatus for implementing a fabric interface of a PE that supports hybrid precision data sparsification, enabling an array of such PEs to function as a hybrid precision sparse inference system .
[0037] As mentioned in the background section, sparsification in neural networks involves reducing the number of non-zero elements in weight tensors or activation tensors, thereby lowering the computational burden and memory requirements. The sparsity of neural networks can be achieved through methods such as pruning, quantization, and regularization. These methods reduce the density of neural network tensors, leading to more efficient model execution.
[0038] In certain applications, sparsification eliminates zero-valued elements while retaining non-zero elements. In other applications, sparsification removes low-magnitude elements and preserves high-magnitude elements (e.g., by applying a value threshold to differentiate between low-and high-magnitude elements) . For simplicity, the following description uses the zero / non-zero example. A person skilled in the art would be able to apply the described process to high-magnitude / low-magnitude scenarios.
[0039] This disclosure uses distinct types of tensors to help describe the invention, such as dense tensors, sparse tensors, condensed tensors, and sparse uncondensed tensors.
[0040] A dense tensor refers to a tensor in its original size, characterized by the number of elements and the bit-depth (precision) of these elements as received from upstream or downstream processing engines. The dense tensor may include high-magnitude data and low-magnitude data. When a dense tensor contains a large number of zero-valued data, it is called a sparse tensor.
[0041] The sparse tensor may be represented and stored in different data formats using a combination of a condensed tensor, a bitmask, and optional quantization information. A condensed tensor represents a compressed version of a given tensor, the bitmask maps the data in the condensed tensor with the original tensor, and the quantization information includes quantization parameters used when generating the condensed tensor from the original tensor.
[0042] In a narrow-sense sparse representation, the sparse representation of a sparse tensor may include a condensed tensor and a bitmask. The condensed tensor only stores non-zero elements from a sparse tensor, and the bitmask uses binary values to indicate the original positions of the non-zero elements in the given tensor. The condensed tensor in combination of the bitmask can be used to restore the given tensor. The restoration may be necessary for certain tensor operations (e.g., max or average pooling) or hardware processing units.
[0043] In a more general-sense sparse representation, the sparse representation of a sparse tensor may include a condensed tensor and a bitmask. The condensed tensor stores high-magnitude elements in the original tensor (e.g., a dense tensor) . The bitmask uses multi-bits values to indicate not only the original positions of the high-magnitude elements in the original tensor, but also encoded value information of the low-magnitude elements in the original tensor. The “high-magnitude elements” refer to elements that exceed a value threshold, indicating significance of these elements for the tensor computation. The condensed tensor in combination of the multi-bit bitmask can be used to restore the given tensor.
[0044] In some embodiments, if quantization is performed when converting the given tensor into the corresponding condensed tensor, the quantization parameters (e.g., scale and bias) may be stored as part of the sparse representation in addition to the condensed tensor and the bitmask. While quantization reduces the data precision, the quantization parameters may be used to reverse (to some extent) the data precision when converting the condensed tensor back to its dense format.
[0045] The sparse uncondensed tensor is an expanded version of the condensed tensor. Elements from the condensed tensor are scattered and distributed into this larger tensor, which contains more positions or “spots” than the condensed tensor. Since the elements from the condensed tensor occupy only a subset of these spots, the remaining positions are filled with zero-valued elements, rendering the uncondensed tensor sparse.
[0046] In some scenarios, the dense tensor and the sparse uncondensed tensor share the same size and dimensions, while the condensed tensor has a smaller size. The bit-depth of the dense tensor is higher than that of the condensed tensor. The bit-depth of the sparse uncondensed tensor may remain the same as that of the dense tensor.
[0047] Additionally, the term “sparse representation” of a dense tensor used in this disclosure refers to a group of data generated through the sparsification of the dense tensor.
[0048] In neural networks sparsification, sparse encoding is a process to convert a dense tensor (either a weight tensor or an activation tensor) into a sparse representation. The sparse representation of the dense tensor may include a condensed tensor, a low-bit bitmask, and optional quantization parameters. This condensed tensor captures only the non-zero elements, significantly reducing the amount of data that needs to be processed or transmitted. The low-bit bitmask uses low bit-depth to represent the low magnitude elements. The optional quantization parameters include the parameters used during the quantization (if any) of the dense tensor, and will be used to restore the sparse representation back to the dense format (i.e., as a result of the sparse decoding) . Sparse encoding is particularly beneficial for improving computational efficiency and reducing memory usage in scenarios where the majority of the tensor elements are zeros.
[0049] However, the sparsification process introduces new challenges that must be addressed to fully exploit the benefits of sparse computing. Not all neural network operations or upstream hardware / accelerators are designed to handle sparse data natively. Many standard operations, such as max pooling and average pooling, as well as interactions with dense layers, require tensors in their original dense format. To address this need, sparse decoding is required. Sparse decoding is the reverse of sparse encoding; it reconstructs the dense tensor from its sparse representation by reintroducing the low-magnitude elements (e.g., zeros) at their appropriate positions. This step is crucial for ensuring compatibility with operations that expect dense input tensors and for maintaining the integrity of the computational process within the network.
[0050] Moreover, many existing hardware accelerators and software frameworks may lack native support for sparse operations, necessitating the use of sparse decoding to convert sparse tensors back to their dense forms. This ensures that the neural network can function correctly on a wide range of computing platforms. Additionally, the ability to restore the original dense structure of tensors is important for tasks such as model inspection, analysis, and further processing.
[0051] Consequently, a fully capable neural network processing unit must support hybrid precision sparsification. In particular, when a plurality of PEs are organized as a network, such as a 2D mesh, each PE needs to be able to adjust the precision of the data it handles according to the requirements of the next operation. This includes converting incoming data for internal computation or adjusting outgoing data for transmission. In this disclosure, we describe a fabric interface within each PE that facilitates hybrid precision sparsification. This flexible interface enables the PE array to function effectively as a hybrid precision sparse inference system.
[0052] FIG. 1 illustrates an exemplary system diagram of a neural network (NN) processing unit 100. The neural network processing unit 100 in FIG. 1 may refer to a neural network accelerator or an NPU, e.g., a specialized microprocessor designed to accelerate machine learning and artificial intelligence (AI) tasks. Unlike traditional CPUs (Central Processing Units) and GPUs (Graphics Processing Units) , accelerators or NPUs are optimized specifically for the neural network operations such as convolution computations and vector operations..
[0053] The NN processing unit 100 illustrated in FIG. 1 includes a plurality of Processing Entities (PEs) that are designed to provide maximum parallelism to accelerate neural network operations. These PEs are organized in a 2D mesh network and interconnected via a network of routers (denoted as “R” in FIG. 1) . Additionally, the NN processing unit 100 incorporates double data rate (DDR) memory modules and caches, such as the last-level cache (LLC) , to support efficient data storage and retrieval. The NN processing unit 100 in FIG. 1 is merely illustrative, and may comprise more, fewer, or alternative components. The accelerator 100 may be designed as a reconfigurable device such as a field-programmable gate array (FPGA) , or an application-specific integrated circuit (ASIC) . The sparse codec introduced in this disclosure may be implemented in a PE.
[0054] In some embodiments, to optimize resource utilization and enhance the parallel processing capabilities of the NN processing unit 100, the PEs within the 2D mesh network may be divided into multiple sections, with each section referred to as a core. As illustrated in FIG. 1, every group of 16 PEs (arranged in a 4x4 grid) constitutes a core, resulting in a total of four cores across the 64 PEs in the NN processing unit 100. Each core is equipped with dedicated DDR memory, LLC, and control circuits, including a RISC-V Vector Unit (RVV) , responsible for vector processing, Core-Level Scheduler (CoLS) , which manages the execution and synchronization of multiple PEs, and an Instruction Dispatch Unit (IDU) , which allocates instructions to various execution units within the accelerator. This architecture enables all four cores 110 (i.e., the four PE groups) to operate concurrently, ensuring efficient parallel processing.
[0055] In some embodiments, these cores 110 are further organized into a Network-on-Chip (NoC) for inter-core communication. For instance, in FIG. 1, the four groups of PEs are arranged as a ring NoC, facilitating seamless communication between cores and enhancing overall computational throughput. The ring NoC architecture includes a circular arrangement of cores 110, where data packets travel along a unidirectional or bidirectional ring, passing through each core 110 until they reach their destination. The ring NoC may be used for data communication between DDRs and PCIe or for PEs to read data from DDR belonging to other cores. In addition to the ring NoC, the PEs may be arranged as a 2D mesh NoC, managing the data communication between PEs.
[0056] Furthermore, the ring NoC architecture in FIG. 1 is scalable, allowing additional cores or PEs to be easily added to the ring without significantly increasing the complexity of the network. This flexibility supports the expansion of the NN processing unit to accommodate larger neural network models or additional computational tasks as needed.
[0057] The NN processing unit 100 illustrated in FIG. 1 may interact with an external (host) CPU through a peripheral component interconnect express (PCIe) . The NN processing unit 100 illustrated in FIG. 1 may further include an internal CPU to orchestra the cores with instructions, and a chip-level scheduler (ChLS) .
[0058] FIG. 2 illustrates an example Processing Entity (PE) 140 in the neural network processing unit. The PE 140 is an example of a PE within core 110 from FIG. 1. The internal components of PE 140 depicted in FIG. 2 are for illustrative purposes, and the actual implementation may include additional, fewer, or alternative components depending on the specific design requirements.
[0059] In some embodiments, the PE 140 includes a fabric interface 144, i.e., the communication interface that connects the PE 140 to the rest of the system, including other PEs, memory, caches, ports, routers, or external resources. The fabric interface 144 manages the flow of data in and out of the PE 140, ensuring efficient communication and coordination. In some embodiments, the fabric interface 144 may include two NoC switches: a Data NoC Switch and a Cfg NoC Switch (as well as the AXI SRAM convert and shared memory interface) , both used to facilitate communication with other cores on the NoC. The Data NoC Switch is responsible for transmitting high-bandwidth data and instructions, ensuring efficient communication of tensor data and processing commands across the network. The Cfg NoC Switch is dedicated to handling configuration data, including parameters and setup information for the core and its functional modules. The wired connections to the Data NoC Switch are typically of higher bandwidth compared to those of the Cfg NoC Switch, reflecting the heavier data traffic load on the data path. A more detailed design of the fabric interface 144 is illustrated in FIGs. 3 and 4A.
[0060] Additionally, PE 140 may include a scheduler that manages instruction issuance through an instruction interface, triggering various functional modules. These modules include the DMA (Direct Memory Access) module, which facilitates high-speed data transfer between memory and processing units without burdening the central processing core. The Sparse Processing Unit (SPU) performs tensor multiplication. The Vector Processing Unit (VPU) handles vectorized operations. The Activation Engine (AE) applies activation functions, including ReLU, sigmoid, or softmax, introducing non-linearity into the neural networks. The Transpose Engine (TE) performs tensor transposition, often required in matrix multiplications and other tasks that involve reordering data dimensions. Finally, the Sorting Engine (SE) is responsible for sorting tensor elements, particularly useful in identifying and isolating high-magnitude values for optimization and pruning in sparse computations. These functional modules efficiently access shared memory, allowing seamless data transfer and interaction between them to ensure smooth operation.
[0061] Furthermore, PE 140 incorporates a local RISC-V Vector (RVV) processing unit, such as a single-core RVV, which is optimized for executing vectorized instructions for neural network tasks. The RVV is coupled with TCM (Tightly Coupled Memory) , a high-speed, low-latency memory directly connected to the PE. This TCM allows the PE to store critical data and intermediate results for rapid access, minimizing latency and ensuring efficient execution of compute-intensive tasks such as matrix operations, convolutions, and tensor manipulations.
[0062] FIG. 3 illustrates an example fabric interface 300 of a PE in a neural network processing unit supporting hybrid precision sparsification, in accordance with various embodiments. The fabric interface 300 depicted in FIG. 3 includes example data paths and circuits, interacting with the shared memory 310 of the PE. Depending on the specific implementation, the fabric interface 300 may include additional, fewer, or alternative data paths or circuits. A person skilled in the art would understand that the diagram in FIG. 3 can be mapped to the internal structure of the PE shown in FIG. 2. For simplicity and clarity, FIG. 3 focuses on the fabric interface 300 of the PE, corresponding to the fabric interface 144 in FIG. 2.
[0063] In some embodiments, the fabric interface 300 includes a tensor extension circuit 320 and a tensor compression circuit 330, implementing the precision transformation on data entering and exiting the PE. For instance, the PEs may be optimized for vectorized operations (e.g., a form of neural network computation where multiple data elements are processed in parallel within a single instruction cycle) . This optimization for parallel data handling requires highly efficient memory access, and thus, the shared memory 310 may impose a minimum granularity requirement on the data it stores, often in the form of a memory bank. Memory banks in the shared memory 310 allow the PE to access multiple data elements in parallel, which aligns with the PEs’ vectorized operations. The minimum granularity requirement of the shared memory 310 ensures that data is structured in chunks large enough to match the vectorized operations of the PEs, preventing inefficiencies or delays caused by underutilized memory bandwidth.
[0064] Because of the minimum granularity requirement of the shared memory 310, when data is transferred into the shared memory 310 of the PE and does not align with the required granularity, a tensor extension operation may be performed through the tensor extension circuit 320 to ensure that the data aligns with the memory’s format and processing capabilities. Conversely, for data exiting the PE, to reduce bandwidth usage and prevent unnecessary data migration, a tensor compression operation may be performed through the tensor compression circuit 330.
[0065] In some embodiments, the tensor extension operation may include extending a dimension of the received tensor and / or increasing the bit-depth of the tensor elements within the received tensor. Extending the dimension of the tensor may include increasing (e.g., padding) a number of elements in dimension (e.g., a channel dimension) of the tensor. Increasing the bit-depth of the tensor may include using a higher precision representation (e.g., using more bits to represent one data element) to represent each data element in the tensor. Here, bit-depth refers to the number of bits used to represent a data value. A high bit-depth consumes more memory space but provide high precision (HP) , whereas a low bit-depth consumes less memory space but offers low precision (LP) .
[0066] Conversely, the tensor compression operation may include compressing a dimension of the exiting tensor (i.e., the tensor exiting the PE) and / or reducing the bit-depth of the tensor elements within the existing tensor. Compressing the dimension of the tensor may include removing (e.g., de-padding) a number of elements from a dimension (e.g., a channel dimension) of the tensor. Reducing the bit-depth of the tensor may include using a lower precision representation (e.g., using less bits to represent one data element) to represent each data element in the tensor.
[0067] In other words, the tensor extension or compression may work at a tensor dimension level, a data precision level, or both, depending on the minimum data granularity of the shared memory 310 associated with the PE.
[0068] In some embodiments, the tensor extension circuit 320 is configured to receive first data (e.g., from another PE, from DDR or LLC, from an Ethernet port, or from another proper source in the NoC illustrated in FIG. 1) and perform tensor extension on the first data to obtain extended data, aligned with the minimum data granularity of the shared memory 310 associated with the PE. The extended data is then stored in the shared memory 310.
[0069] As shown in FIG. 3, the tensor extension circuit 320 may include a channel extension circuit 322 for extending a dimension of the incoming tensor, and a bit-depth extension look-up-table (LUT) 324 for increasing a bit-depth of tensor elements in the incoming tensor. Each of these circuits is associated with a selector and may be bypassed, depending on whether the particular extension is required to align with the minimum data granularity of the shared memory 310 associated with the PE.
[0070] The channel extension circuit 322 may be implemented using various types of logic, such as a channel extension circuit 322, a bit-depth extension LUT circuit 324, another form of circuit, or any combination thereof. One or more data selectors, such as a multiplexer (MUX) or demultiplexer (DEMUX) , may be employed to decide whether to trigger one or both of the channel extension circuit 322 and the bit-depth extension LUT circuit 324, or bypass any of them. In some embodiments, the data selector may be controlled based on an instruction issued from a DMA controller (e.g., the DMA controller 142 in FIG. 2) .
[0071] The channel extension circuit 322 may extend the channel dimension of the received data by padding zeros padding zeros to each element to align with the minimum data granularity of the shared memory 310. For instance, a 2-element vector {1, 2} may be converted to an 8-element vector {1, 2, 0, 0, 0, 0, 0, 0} . The target dimension size of the channel extension may be determined by an instruction issued from the DMA controller of the PE.
[0072] In some embodiments, the bit-depth extension circuit 324 may increase the bit-depth of each element in the received data by utilizing a pre-stored and pre-mapped look-up table (LUT) . For example, the LUT stores a plurality of low bit-depth keys, each mapped to multiple corresponding high bit-depth values. These mappings allow for dynamic and flexible bit-depth transformations based on the specific data being processed. As shown in FIG. 3, the low bit-depth keys may include keys of 2bit, 4bit, and 6bit, and the high bit-depth values may include values of 8bit, 16bit, and 32bits.
[0073] In operation, the bit-depth extension circuit 324 may identify the appropriate low bit-depth key that corresponds to the bit-depth of the received data. The bit-depth extension circuit 324 may identify a high bit-depth value corresponding to the identified low bit-depth key based on the instruction issued from the DMA controller of the PE.
[0074] To perform the channel extension, the bit-depth extension circuit 324 processes each element in the received data sequentially. For each element, the bit-depth extension circuit 324 identifies a low bit-depth key corresponding to the element’s low bit-depth representation. Once the low bit-depth key is located, the bit-depth extension circuit 324 then identifies the corresponding high bit-depth representation from corresponding values, which has been pre-mapped to the low bit-depth representation. The low bit-depth representation in the first data is then replaced with this high bit-depth representation, effectively expanding the data’s precision. Subsequently, the data with the increased bit-depth may be stored in the shared memory 310 for subsequent in-PE computation.
[0075] Similar to the tensor extension circuit 320, the tensor compression circuit 330 may be implemented using various types of logic, such as a channel compression circuit 332, a bit-depth compression LUT circuit 334, another form of circuit, or any combination thereof. One or more data selectors, such as a multiplexer (MUX) or demultiplexer (DEMUX) , may be employed to select one or more of the specific circuits to perform the tensor compression on the outgoing data. In some embodiments, the selection of the specific circuit for tensor compression may be determined based on an instruction issued from a DMA controller (e.g., the DMA controller 142 in FIG. 2) .
[0076] In some embodiments, the channel compression circuit 332 is configured to compress a dimension (e.g., a channel dimension) of the outgoing data by removing one or more zero values from the dimension of the tensor. This operation decreases the dimension size of the data before it is output from the PE.
[0077] In some embodiments, the bit-depth compression LUT circuit 334 is configured to reduce the data precision of the tensor by using a smaller number of bits to represent the tensor data. For example, the bit-depth compression LUT circuit 334 may be configured to convert each 8-bit element in the data from the shared memory 310, such as “00000001, ” to 2-bit form, “01” (1 in decimal) , meeting the precision requirements for data transmission. The target bit-depth reduction for the compression process may be determined by an instruction issued from the DMA controller of the PE.
[0078] [Rectified under Rule 91, 26.11.2024]It is important to note that bit-depth compression LUT circuit 334 differs from the bit-depth extension LUT circuit 324in that the number of keys in bit-depth compression LUT circuit 334 (i.e., high bit-depth keys) have the same bit-depth (e.g., all 8-bit keys in FIG. 3) , whereas the low bit-depth keys in the bit-depth extension LUT circuit 324 have multiple different bit depths (e.g., 2-bit keys, 4-bit keys, and 6-bith keys) . This is because higher bit-depth keys consume more memory space, making it more costly to pre-store a large number of them in the bit-depth compression LUT circuit 334.
[0079] Additionally, since the bit-depth compression LUT circuit 334 maps data from high bit-depth to low bit-depth, it is possible for different high bit-depth keys to be mapped to the same low bit-depth value, leading to potential mapping conflicts. The higher the bit-depth of the keys, the greater the likelihood of such conflicts. Therefore, the bit-depth of the keys in the bit-depth compression LUT circuit 334 may be selected to be the minimum high bit-depth required by the PE during neural network computations, ensuring an acceptable balance between data footprint and accuracy.
[0080] FIG. 4A illustrates example data flows in a neural network processing unit supporting hybrid precision sparsification, in accordance with various embodiments. The data flows in FIG. 4A illustrates several different channels for PEs to exchange data. For simplicity, two PEs 400 and 450 and their respective fabric interfaces 420 and 470 are illustrated in FIG. 4A. The PE 400 in this example is the source PE (sending data) and the PE 450 is the destination PE (receiving data) .
[0081] In this example, each of the PEs 400 and 450 includes a sparse codec, a shared memory, and other engines such as the SPU, VPU, AE, TE, SE described in FIG. 2. The sparse codec in each PE supports both sparse encoding and sparse decoding. FIG. 4B explains the sparse codec in more details. The sparse codec 410 in PE 400 performs sparse encoding after loading or receiving uncondensed tensor (i.e., a dense tensor with both high-magnitude and low-magnitude tensor data) , and outputs a condensed tensor for storage. The condensed format saves memory footprint of the data while maintain sufficient information for subsequent restoration back to the uncondensed format (during a sparse decoding process) .
[0082] When the PE 400 is sending data to the other PE 450 through its fabric interface 420, the data read from the memory may be in the uncondensed format or in the condensed format. The uncondensed data in the memory of PE 400 may be generated by some of the engines in the PE 400. For either format, the data may go through the tensor compression circuit in the fabric interface 420 before exiting the PE 400 to further reduce the channel dimension and / or the bit-depth (i.e., the precision) of the data before entering the data transfering channels.
[0083] In some embodiments, the sparse encoding in the PE 400 involves quantization, which reduces the bit-depth of the data as part of the sparsification. Note that the bit-depth reduction during the sparse encoding is independent from the bit-depth compression by the channel compression circuit in the fabric interface 420. The bit-depth reduction effects of these two steps may be accumulated.
[0084] When the PE 450 receives data from the PE 400 through its local fabric interface 470, the data received from the incoming channels may go through the tensor extension circuit in the fabric interface 470 to increase the channel dimension and / or the bit-depth of the data before storing into the memory of PE 450. The data received by the PE 450 may be in a condense format or an uncondensed format. For the condensed data, the sparse codec 460 in the PE 450 may load the data and perform sparse decoding to restore the data back to its uncondensed format (with a higher bit-depth and higher precision) for subsequent NN computations. For the uncondensed data, the other engines in the PE 450 may directly load it for computation or processing.
[0085] In some embodiments, the fabric interface 420 of PE 400 and PE 450 may include different types of ports coupled to different channels. For example, the fabric interface 420 may have a first port connected to the mesh NoC 480, while the fabric interface 470 of PE 450 includes a corresponding first port for receiving data from the mesh NoC 480. These first ports may be coupled via a direct data channel (e.g., through routers) between PE 400 and PE 450, allowing for instantaneous data transmission and reception. These ports are designed to handle data required for real-time computations across PEs, such as convolution operations or distributed matrix processing.
[0086] In another embodiment, the fabric interface 420 may include a second port connected to intermediate memory 482 (e.g., DDR or LLC, as illustrated in FIG. 2) . Data output through this second port is first stored in the intermediate memory 482, waiting to be loaded into the local memory of the receiving PE 450. This second port is used to transfer data that is not immediately required by the receiving PE. For example, multiple PEs may send their intermediate results to the intermediate memory 482, from which PE 450 can later retrieve the data to form the final output tensor. In other words, the second port of the fabric interface supports delayed exchange of compressed data between PEs.
[0087] In yet another embodiment, the fabric interface 420 may include a third port for cross-NoC data exchange. As discussed in FIG. 1, cores and PEs within a NoC are interconnected through routers and intermediate memories. However, for cross-NoC data exchanges, the third port, such as an Ethernet port 483, may be required.
[0088] A combination of these types of ports provide comprehensive support for various channels involved in data exchange between PEs, enabling efficient and flexible intra-NoC and inter-NoC data communication.
[0089] FIG. 4B illustrates an example sparse codec in a neural network processing unit supporting hybrid precision sparsification, in accordance with various embodiments.
[0090] In some embodiments, the sparse codec in FIG. 4B may be implemented inside the PE 140 illustrated in FIG. 2. More particularly, the sparse codec may be implemented in the Sorting Engine (SE) in the PE 140 in FIG. 2.
[0091] The example sparse codec may support both sparse encoding and sparse decoding, which are both essential in practice because they work together to optimize the efficiency of data storage, transmission, and processing, especially in large-scale applications like neural networks. Sparse encoding reduces the memory footprint and computational load by representing only the most significant data elements with high-precision, while compressing less critical data into a more efficient, low-precision format. This not only saves storage space but also speeds up data processing and reduces transmission latency. In practice, the sparsified tensor often needs to be restored to its dense format for several reasons. First, many neural network operations and algorithms are designed to work on dense tensors, requiring the full data structure to be present for correct functioning. Second, many hardware processing units or accelerators require the input tensor to be dense, thus the sparse representation needs to be restored (sparse decoded) to its original dense form to be compatible with these hardware apparatuses. Lastly, certain downstream tasks, such as visualization, analysis, or further processing, may require the dense format to ensure the full integrity and interpretability of the data.
[0092] In some embodiments, during the sparse encoding process (denoted as Sparse Encode in FIG. 4B) , dense data, such as a dense weight tensor or an activation tensor (where “dense” refers to a tensor containing a mix of both high-magnitude values with greater absolute values and low-magnitude values with smaller absolute values) , is input into the sparse codec. The sparse codec then generates a sparse representation of the dense data. The sparse encoding process prioritizes the retention of high-magnitude values due to their greater contribution to the computation accuracy of the neural network, while pruning less critical low-magnitude values to reduce memory footprint and computational cost.
[0093] In some embodiments, the sparse representation of the dense data may include condensed data (e.g., a condensed sub-tensor) that gathers (aggregates) and compresses (e.g., through quantization) the high-magnitude values into a condensed tensor form. Quantizing the high-magnitude values in the condensed data offers technical benefits by reducing the memory footprint and accelerating computation, as fewer bits are used to represent each value. The number of bits used to represent one tensor data is called bit-depth. For instance, each piece of tensor data in the original dense data may use 32 bits, whereas each quantized tensor data in the condensed data may use 8 bits. This way, the quantization operation may compress an original data of 64 bytes (assuming the dimension size of the tensor is 16, i.e., 16*32 bits is 64 bytes) to 16 bytes (16*8bits=16 bytes) , saving the memory footprint by 4 times. This leads to faster processing and lower power consumption, which are particularly advantageous in energy-constrained environments like mobile devices or embedded systems. Additionally, quantization decreases the bandwidth needed for data transfer, improving the efficiency of hardware utilization, especially in systems optimized for lower-precision operations.
[0094] In some embodiments, the sparse representation of the dense data may further include a sparse bitmask that represents the positions of the high-magnitude tensor data within the original dense data, as well as quantized low-magnitude tensor data from the original dense data. This sparse bitmask is necessary for restoring the sparse representation of the original tensor to its original dense format, as it specifies where to place the high-magnitude tensor data from the condensed data and what the low-precision values should be reintroduced.
[0095] Traditional bitmasks typically use a single bit per entry to indicate a binary choice: whether a position contains a pruned or non-pruned value. However, to facilitate the subsequent sparse decoding process, the bitmask needs to convey more than just the binary information. In some embodiments, each entry in the sparse bitmask may utilize two or more bits, with the first bit serving as a sign bit. This design allows each entry in the sparse bitmask to not only differentiate between pruned and non-pruned values but also to specify a range of quantized tensor data. For example, using two bits per entry in the sparse bitmask provides four possible states, with one state representing the presence of a high-magnitude tensor data, and each of the other three states representing a different value range for a low-magnitude tensor data. This design allows to use the same data format, i.e., the sparse bitmask, to assist in reconstructing a more accurate dense tensor.
[0096] Furthermore, the condensed representation of the dense data may include quantization parameters (denoted as Quant Params in FIG. 4B) . These quantization parameters are determined during the sparse encoding process to quantize both the high-magnitude and low-magnitude tensor data in the dense data. Since the value ranges of high-magnitude and low-magnitude tensor data differ, two distinct sets of quantization parameters may be generated respectively for each category. If the tensor data in the dense data have been quantized (resulting in the condensed data and the sparse bitmask) , these quantization parameters may be included as part of the sparse representation of the dense data and subsequently utilized during the sparse decoding process. For instance, the quantization parameters may be applied to a quantized high-magnitude value in the condensed data to generate a dequantized value close to its original high-magnitude value in the dense data. As another example, the quantization parameters may be applied to a multi-bit entry in the sparse bitmask (representing a quantized low-magnitude value) to dequantize the value into a corresponding low-magnitude value range. The dequantized values may be scattered into a dense tensor according to the sparse bitmask to conclude the sparse decoding process.
[0097] In summary, the sparse encoding process transforms the dense data into a sparse representation 51, including one or more of the condensed data representing the high-magnitude tensor data in the dense data, the sparse bitmask representing the low-magnitude tensor data in the dense data, and quant params preparing for sparse decoding process. This sparse representation significantly reduces the memory footprint required for storage and minimizes the latency associated with transmitting the data from one PE to another, compared to handling the dense data directly.
[0098] The sparse decoding process serves as the reverse operation of the sparse encoding process. During sparse decoding, the inputs may include one or more of the condensed data, the sparse bitmask, and the optional quantization parameters if quantization occurred (or collectively, the sparse representation) . At a high level, the sparse bitmask is utilized to map the quantized high-magnitude values from the condensed data back to their original positions within the dense data. If the sparse encoding process involves data quantization, the quantization parameters play a crucial role in this decoding process by being used to dequantize the high-magnitude values in the condensed data and the low-magnitude values in the sparse bitmask, thereby restoring these values as closely as possible to their original forms (e.g., precision and value) in the dense tensor. For instance, the multi-bit entries within the sparse bitmask, which represent the quantized low-precision values, are decoded back into their corresponding original high-precision values (with precision loss) . Although the quantization process inherently reduces the precision of the original tensor data, the use of quantization parameters allows the tensor data in the sparse representation of the dense data to be restored with an acceptable level of precision loss compared to the original values. This bidirectional sparsification process supported by the sparse codec ensures that the sparse representation, while more efficient, still maintains a high degree of accuracy relative to the original dense data. The number of bits in the sparse bitmask is inversely related to the loss of precision of the sparse encoding and decoding process, i.e., a higher bit-depth in the sparse bitmask reduces the precision loss of the sparse encoding and decoding process.
[0099] During the sparse encoding process, the high-magnitude tensor data from the dense data may be gathered into a condensed tensor. This gathering process may be implemented as a gather circuit, which is configured to transform a tensor (either sparse or dense) into a condensed tensor based on the given tensor mask (e.g., by gathering the high-magnitude tensor data into the condensed tensor) . During the sparse decoding process, the high-magnitude tensor data in the condensed tensor need to be scatter back to their original positions in the dense data. This scattering process may be implemented as a scatter circuit, which is configured to transform the condensed tensor into a sparse uncondensed tensor based on a given bitmask by redistributing the high-magnitude tensor data to their original positions as indicated by the given bitmask, and filling the remaining positions with zero-valued elements. To complete the sparse decoding, the data in sparse uncondensed tensor may go through dequantization to restore the bit-depth of the dense tensor. The resultant tensor may be referred to as a restored dense tensor.
[0100] FIG. 5 illustrates an example method 500 for data exchange using hybrid precision, in accordance with various embodiments.
[0101] In some embodiments, the method 500 may be implemented by a PE in a PE array for neural network computation. The method 500 may include a plurality of blocks.
[0102] Block 510 includes receiving first data from another PE.
[0103] Block 520 includes extending a channel dimension of the first data to obtain extended data with an increased dimension aligned with a minimum data granularity of a memory associated with the PE.
[0104] Block 530 includes storing the extended data into the memory associated with the PE.
[0105] Block 540 includes fetching second data from the memory associated with the PE.
[0106] Block 550 includes compressing the channel dimension of the second data to obtain compressed data with a reduced dimension.
[0107] Block 560 includes outputting the compressed data from the PE.
[0108] In some embodiments, the extending the channel dimension of the first data includes: padding one or more zero values to the channel dimension of the first data to increase a dimension of the first data to align with the minimum data granularity of the memory.
[0109] In some embodiments, the method 500 may further include increasing a bit-depth of data elements in the first data using a first look-up-table (LUT) by: storing, in the first LUT, a plurality of low bit-depth keys respectively mapped to a plurality of high bit-depth values; identifying one of the plurality of low bit-depth keys based on a low bit-depth representation of a data element of the first data; determining one of the plurality of high bit-depth values corresponding to the identified low bit-depth key; and replacing the low bit-depth representation of the data element of the first data with the determined high bit-depth value.
[0110] In some embodiments, the compressing the channel dimension of the second data includes: removing one or more zero values from the channel dimension of the second data to reduce a bit-depth of the second data based on a configuration instruction that configures the memory.
[0111] In some embodiments, the method 500 may further include compressing a bit-depth of data elements in the second data using a second LUT by: storing, in the second LUT, a plurality of high bit-depth keys mapped to a plurality of low bit-depth values; identifying one of the plurality of high bit-depth key in the second LUT based on a high bit-depth presentation of a data element in the second data; determining one of the plurality of low bit-depth values corresponding to the identified high bit-depth key; and replacing the high bit-depth representation of the data element of the second data with the determined low bit-depth value.
[0112] Although FIG. 5 shows example blocks of method 500, in some implementations, method 500 may include additional blocks, fewer blocks, different blocks, or differently arranged blocks than those depicted in FIG. 5. Additionally, or alternatively, two or more of the blocks of method 500 may be performed in parallel.
[0113] The performance of certain of the operations may be distributed among the processors, not only residing within a single machine, but deployed across a number of machines. In some example embodiments, the processors or processor-implemented engines may be located in a single geographic location (e.g., within a home environment, an office environment, or a server farm) . In other example embodiments, the processors or processor-implemented engines may be distributed across a number of geographic locations.
[0114] Each of the processes, methods, and algorithms described in the preceding sections may be embodied in, and fully or partially automated by, code modules executed by one or more computer systems or computer processors comprising computer hardware. The processes and algorithms may be implemented partially or wholly in application-specific circuit.
[0115] When the functions disclosed herein are implemented in the form of software functional units and sold or used as independent products, they can be stored in a processor executable non-volatile computer-readable storage medium. Particular technical solutions disclosed herein (in whole or in part) or aspects that contributes to current technologies may be embodied in the form of a software product. The software product may be stored in a storage medium, comprising a number of instructions to cause a computing device (which may be a personal computer, a server, a network device, and the like) to execute all or some steps of the methods of the embodiments of the present application. The storage medium may comprise a flash drive, a portable hard drive, ROM, RAM, a magnetic disk, an optical disc, another medium operable to store program code, or any combination thereof.
[0116] Particular embodiments further provide a system comprising a processor and a non-transitory computer-readable storage medium storing instructions executable by the processor to cause the system to perform operations corresponding to steps in any method of the embodiments disclosed above. Particular embodiments further provide a non-transitory computer-readable storage medium configured with instructions executable by one or more processors to cause the one or more processors to perform operations corresponding to steps in any method of the embodiments disclosed above.
[0117] Embodiments disclosed herein may be implemented through a cloud platform, a server or a server group (hereinafter collectively the “service system” ) that interacts with a client. The client may be a terminal device, or a client registered by a user at a platform, wherein the terminal device may be a mobile terminal, a personal computer (PC) , and any device that may be installed with a platform application program.
[0118] The various features and processes described above may be used independently of one another or may be combined in various ways. All possible combinations and sub-combinations are intended to fall within the scope of this disclosure. In addition, certain method or process blocks may be omitted in some implementations. The methods and processes described herein are also not limited to any particular sequence, and the blocks or states relating thereto can be performed in other sequences that are appropriate. For example, described blocks or states may be performed in an order other than that specifically disclosed, or multiple blocks or states may be combined in a single block or state. The example blocks or states may be performed in serial, in parallel, or in some other manner. Blocks or states may be added to or removed from the disclosed example embodiments. The exemplary systems and components described herein may be configured differently than described. For example, elements may be added to, removed from, or rearranged compared to the disclosed example embodiments.
[0119] The various operations of exemplary methods described herein may be performed, at least partially, by an algorithm. The algorithm may be comprised in program codes or instructions stored in a memory (e.g., a non-transitory computer-readable storage medium described above) . Such algorithm may comprise a machine learning algorithm. In some embodiments, a machine learning algorithm may not explicitly program computers to perform a function but can learn from training samples to make a prediction model that performs the function.
[0120] The various operations of exemplary methods described herein may be performed, at least partially, by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform the relevant operations. Whether temporarily or permanently configured, such processors may constitute processor-implemented engines that operate to perform one or more operations or functions described herein.
[0121] Similarly, the methods described herein may be at least partially processor-implemented, with a particular processor or processors being an example of hardware. For example, at least some of the operations of a method may be performed by one or more processors or processor-implemented engines. Moreover, the one or more processors may also operate to support performance of the relevant operations in a “cloud computing” environment or as a “software as a service” (SaaS) . For example, at least some of the operations may be performed by a group of computers (as examples of machines including processors) , with these operations being accessible via a network (e.g., the Internet) and via one or more appropriate interfaces (e.g., an Application Program Interface (API) ) .
[0122] The performance of certain of the operations may be distributed among the processors, not only residing within a single machine, but deployed across a number of machines. In some example embodiments, the processors or processor-implemented engines may be located in a single geographic location (e.g., within a home environment, an office environment, or a server farm) . In other example embodiments, the processors or processor-implemented engines may be distributed across a number of geographic locations.
[0123] Throughout this specification, plural instances may implement components, operations, or structures described as a single instance. Although individual operations of one or more methods are illustrated and described as separate operations, one or more of the individual operations may be performed concurrently, and nothing requires that the operations be performed in the order illustrated. Structures and functionality presented as separate components in example configurations may be implemented as a combined structure or component. Similarly, structures and functionality presented as a single component may be implemented as separate components. These and other variations, modifications, additions, and improvements fall within the scope of the subject matter herein.
[0124] As used herein, “or” is inclusive and not exclusive, unless expressly indicated otherwise or indicated otherwise by context. Therefore, herein, “A, B, or C” means “A, B, A and B, A and C, B and C, or A, B, and C, ” unless expressly indicated otherwise or indicated otherwise by context. Moreover, “and” is both joint and several, unless expressly indicated otherwise or indicated otherwise by context. Therefore, herein, “A and B” means “A and B, jointly or severally, ” unless expressly indicated otherwise or indicated otherwise by context. Moreover, plural instances may be provided for resources, operations, or structures described herein as a single instance. Additionally, boundaries between various resources, operations, engines, and data stores are somewhat arbitrary, and particular operations are illustrated in a context of specific illustrative configurations. Other allocations of functionality are envisioned and may fall within a scope of various embodiments of the present disclosure. In general, structures and functionality presented as separate resources in the example configurations may be implemented as a combined structure or resource. Similarly, structures and functionality presented as a single resource may be implemented as separate resources. These and other variations, modifications, additions, and improvements fall within a scope of embodiments of the present disclosure as represented by the appended claims. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
[0125] The term “include” or “comprise” is used to indicate the existence of the subsequently declared features, but it does not exclude the addition of other features. Conditional language, such as, among others, “can, ” “could, ” “might, ” or “may, ” unless specifically stated otherwise, or otherwise understood within the context as used, is generally intended to convey that certain embodiments include, while other embodiments do not include, certain features, elements and / or steps. Thus, such conditional language is not generally intended to imply that features, elements and / or steps are in any way required for one or more embodiments or that one or more embodiments necessarily include logic for deciding, with or without user input or prompting, whether these features, elements and / or steps are included or are to be performed in any particular embodiment.
[0126] Although an overview of the subject matter has been described with reference to specific example embodiments, various modifications and changes may be made to these embodiments without departing from the broader scope of embodiments of the present disclosure. Such embodiments of the subject matter may be referred to herein, individually, or collectively, by the term “invention” merely for convenience and without intending to voluntarily limit the scope of this application to any single disclosure or concept if more than one is, in fact, disclosed.
[0127] The embodiments illustrated herein are described in sufficient detail to enable those skilled in the art to practice the teachings disclosed. Other embodiments may be used and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. The Detailed Description, therefore, is not to be taken in a limiting sense, and the scope of various embodiments is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.
Claims
1.A fabric interface of a processing entity (PE) in a PE array for neural network computations, comprising:a channel extension circuit configured to:receive first data from another PE,extend a channel dimension of the first data to obtain extended data with an increased dimension aligned with a minimum data granularity of a memory associated with the PE, andstore the extended data in the memory; anda channel compression circuit configured to:fetch second data from the memory;compress the channel dimension of the second data to obtain compressed data with a reduced dimension; andoutput the compressed data from the PE.2.The fabric interface of claim 1, wherein to extend the channel dimension of the first data, the channel extension circuit is further configured to:pad one or more zero values to a channel dimension of the first data to increase a dimension of the first data to align with the minimum data granularity of the memory.3.The fabric interface of claim 1, further comprising:a bit-depth extension circuit configured to increase a bit-depth of data elements in the first data using a first look-up-table (LUT) .4.The fabric interface of claim 3, wherein the bit-depth extension circuit is further configured to:store, in the first LUT, a plurality of low bit-depth keys respectively mapped to a plurality of high bit-depth values;identify one of the plurality of low bit-depth keys based on a low bit-depth representation of a data element of the first data;determine one of the plurality of high bit-depth values corresponding to the identified low bit-depth key; andreplace the low bit-depth representation of the data element of the first data with the determined high bit-depth value.5.The fabric interface of claim 1, wherein to compress the channel dimension of the second data, the channel compression circuit is further configured to:remove one or more zero values from a channel dimension of the second data and reduce a bit-depth of the second data before outputting from the PE.6.The fabric interface of claim 1, further comprising:a bit-depth compression circuit configured to compress a bit-depth of data elements in the second data using a second LUT.7.The fabric interface of claim 6, wherein the bit-depth compression circuit is further configured to:store, in the second LUT, a plurality of high bit-depth keys mapped to a plurality of low bit-depth values;identify one of the plurality of high bit-depth key based on a high bit-depth representation of a data element in the second data;determine one of the plurality of low bit-depth values corresponding to the identified high bit-depth key; andreplace the high bit-depth representation of the data element of the second data with the determined low bit-depth value.8.The fabric interface of claim 4, wherein the plurality of low bit-depth keys in the first LUT stores have multiple different low bit-depths.9.The fabric interface of claim 7, wherein the plurality of high bit-depth keys in the second LUT have the same high bit-depth.10.The fabric interface of claim 1, wherein the PE array forms a mesh network-on-chip (NoC) , and the fabric interface further comprises:a first output port for intra-NoC data transmission that is coupled to another PE in the NoC, wherein the compressed data is output through the first output port to the other PE in the NoC.11.The fabric interface of claim 10, wherein the first output port is configured to perform instant transmission of the compressed data to the other PE in the same NoC.12.The fabric interface of claim 1, wherein the PE array forms a mesh network-on-chip (NoC) , and the fabric interface further comprises:a second output port for intra-NoC or cross-NoC data transmission that is coupled to an intermediate memory of the mesh NoC, wherein the compressed data is output through the second output port into the intermediate memory, pending retrieval by another PE in the NoC or from another NoC.13.The fabric interface of claim 12, wherein the second output port is configured to perform a delayed transmission of the compressed data to the other PE.14.The fabric interface of claim 1, further comprising:a third output port for cross-NoC data transmission that is coupled to another NoC, wherein the compressed data is output through the third output port to another PE from the other NoC.15.The fabric interface of claim 1, wherein the compressed data output from the PE is transmitted to a second PE in the PE array, where the channel extension circuit of the second PE is configured to receive the compressed data, extend the channel dimension of the compressed data, and store the extended data in a memory.16.A method implemented by a processing entity (PE) in a PE array for neural network computations, comprising:receiving first data from another PE;extending a channel dimension of the first data to obtain extended data with an increased dimension aligned with a minimum data granularity of a memory associated with the PE;storing the extended data into the memory associated with the PE;fetching second data from the memory associated with the PE;compressing the channel dimension of the second data to obtain compressed data with a reduced dimension; andoutputting the compressed data from the PE.17.The method of claim 16, wherein the extending the channel dimension of the first data comprises:padding one or more zero values to the channel dimension of the first data to increase a dimension of the first data to align with the minimum data granularity of the memory.18.The method of claim 16, further comprising increasing a bit-depth of data elements in the first data using a first look-up-table (LUT) by:storing, in the first LUT, a plurality of low bit-depth keys respectively mapped to a plurality of high bit-depth values;identifying one of the plurality of low bit-depth keys based on a low bit-depth representation of a data element of the first data;determining one of the plurality of high bit-depth values corresponding to the identified low bit-depth key; andreplacing the low bit-depth representation of the data element of the first data with the determined high bit-depth value.19.The method of claim 16, wherein the compressing the channel dimension of the second data comprises:removing one or more zero values from the channel dimension of the second data to reduce a bit-depth of the second data based on a configuration instruction that configures the memory.20.The method of claim 16, further comprising compressing a bit-depth of data elements in the second data using a second LUT by:storing, in the second LUT, a plurality of high bit-depth keys mapped to a plurality of low bit-depth values;identifying one of the plurality of high bit-depth key in the second LUT based on a high bit-depth presentation of a data element in the second data;determining one of the plurality of low bit-depth values corresponding to the identified high bit-depth key; andreplacing the high bit-depth representation of the data element of the second data with the determined low bit-depth value.
Citation Information
Patent Citations
Temporally amortized supersampling using a mixed precision convolutional neural network
US20230066626A1
Tensor dimension ordering techniques
WO2024211755A1