Method and apparatus for compressing data
By partitioning data into blocks and using RLE and partial Huffman encoding, the method addresses memory capacity and bandwidth bottlenecks in hardware accelerators and CNNs, enhancing processing efficiency and compatibility.
Patent Information
- Application Number
- JP2020030252
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-02-27
- Filing Date
- 2020-02-26
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-02-26
AI Technical Summary
Hardware accelerators and convolutional neural networks (CNNs) on processor chips face memory capacity limitations and bandwidth bottlenecks due to limited off-chip memory interfaces, which hinder efficient data processing.
Implementing a data compression method that partitions data into blocks and applies lossless compression techniques like RLE and partial Huffman encoding, along with block headers for decoding, to optimize bandwidth and compatibility with CNN frequencies.
Enhances memory capacity and processing efficiency by reducing data size before transfer, allowing parallel decoding and increasing computational bandwidth while maintaining hardware compatibility.
Smart Images

Figure 0007548706000001 
Figure 0007548706000006 
Figure 0007548706000005
Abstract
Description
[Technical field]
[0001] This disclosure relates generally to processors, and more particularly, to a method and apparatus for compressing data. [Background technology]
[0002] In recent years, hardware-based neural networks implemented on a processor chip (e.g., on-chip) have become popular in various data processing systems. Neural networks provide a framework for machine learning algorithms to work together to process large and / or complex data. In some examples, neural networks are connected to off-chip memory (e.g., memory located outside the processor chip) to increase the available capacity of the on-chip neural network. [Brief description of the drawings]
[0003] [Figure 1] 1 is a block implementation of a diagram including an exemplary data compressor and a data decompressor. [Diagram 2] 2 is a block diagram of an exemplary implementation of the data compressor and data decompressor of FIG. 1; [Diagram 3] 3 is a flowchart representing example machine-readable instructions that may be executed to implement the example data compressor of FIG. 1 and / or FIG. 2 to compress a data set. [Figure 4] 3 is a flowchart representing example machine-readable instructions that may be executed to implement the example data compressor of FIG. 1 and / or FIG. 2 to compress a data set. [Diagram 5] 3 is a flowchart representing example machine-readable instructions that may be executed to execute the example data decompressor of FIG. 1 and / or FIG. 2 to decompress a compressed data set. [Figure 6] 3 illustrates an exemplary data decompression process that may be performed by the data decompressor of FIG. 1 and / or FIG. 2. [Figure 7]FIG. 5 is a block diagram of an example processing platform configured to execute the instructions of FIGS. 3-4 to implement the example data compressor of FIGS. 1 and / or 2. [Figure 8] 6 is a block diagram of an example processing platform configured to execute the instructions of FIG. 5 to implement the example data decompressor of FIG. 1 and / or FIG. 2.
[0004] The drawings are not to scale. Generally, the same reference numbers are used throughout the drawings and the accompanying detailed description to refer to the same or like parts. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0005] Typical computing systems, including personal computers and / or mobile devices, employ advanced image processing or computer vision algorithms to automate tasks that human vision can perform. Computer vision tasks include acquiring, processing, analyzing, and / or understanding digital images. Such tasks facilitate, in part, extracting dimensional data from digital images and generating numerical and / or symbolic information. Computer vision algorithms use the numerical and / or symbolic information to make decisions and otherwise perform operations related to three-dimensional (3-D) pose estimation, event detection, object recognition, video tracking, among others. Thus, performing such tasks quickly (e.g., in real-time or near real-time) and efficiently is critical to support augmented reality (AR), virtual reality (VR), robotics, and / or other applications.
[0006] Advanced image processing or computer vision algorithms may employ hardware accelerators and / or convolutional neural networks (CNNs or ConvNets). A hardware accelerator is a hardware component that performs functions (e.g., classifying images, clustering images, performing object recognition, etc.) more efficiently than software implemented by a general-purpose central processing unit (CPU). A CNN is a deep artificial neural network that can be used to classify images, cluster images by similarity (e.g., photo search), and / or perform object recognition in images using convolution. As used herein, a convolution is defined as a function that is derived from two given functions by an integral that expresses how the shape of one function is modified by the shape of the other function. Thus, a CNN may be used to identify faces, individuals, road signs, animals, etc., in an input image by passing the output of one or more filters that correspond to image features (e.g., horizon lines, two-dimensional (2-D) shapes, etc.) of the input image to identify matches of the image features in the input image.
[0007] Some hardware accelerators and / or CNNs have limited memory capacity. Thus, such hardware accelerators and / or CNNs located on a processor chip may be connected to memory (e.g., off-chip memory such as dynamic random access memory (DRAM)) to increase the memory capacity to support the increased data processing power of the hardware accelerator and / or CNN. However, the transfer of data from the off-chip memory to the on-chip hardware accelerator and / or CNN creates a bottleneck effect corresponding to the limited bandwidth, limiting the processing power of the hardware accelerator and / or CNN. Some techniques reduce the bandwidth requirements of the off-chip memory interface using lossless compression techniques (e.g., Huffman compression) that reduce the amount of data that needs to be moved to the on-chip hardware accelerator and / or CNN. However, such techniques are not compatible with the frequencies at which some hardware accelerators and / or CNNs operate and / or the frequencies at which the decoder needs to operate.
[0008] Examples disclosed herein include off-chip data compression techniques to optimize the bandwidth improvements provided by lossless encoding techniques while enabling hardware accelerator and / or CNN frequency compatible hardware decompression implementations. Examples disclosed herein include splitting (e.g., grouping) data stored in off-chip memory into a number of blocks of data and applying a compression technique (e.g., run-length encoding, partial Huffman encoding, no encoding, and / or any other lossless compression technique) for each block based on characteristics of the data in each block.
[0009] For example, if all data in a block corresponds to the same character (e.g., all "0's", all "1's", all "a's"), the embodiments disclosed herein compress the block using RLE encoding. RLE encoding is a lossless data compression that compresses all block data into a single value that represents all values in the block including information about the number of characters in the original block. For example, if a block is a data block of 16 characters, where each character corresponds to a "0", RLE encoding compresses the subblock into a single character "0" that represents 16 "0" characters including a character that indicates the original size of the data block (e.g., 16).
[0010] In cases where the data in a block do not all correspond to the same character, the embodiments disclosed herein may implement a Huffman technique (e.g., a full Huffman technique or a partial Huffman technique). The Huffman technique is a lossless data compression / encoding algorithm that assigns variable length codes to input characters, where the length of the code is based on the frequency of the corresponding input character. Thus, the Huffman technique results in non-uniform length codes. For example, characters that are more frequent in the block are assigned shorter length codes than characters that are less frequent in the block. Thus, the Huffman technique reduces the size of data blocks with repeated characters. To apply Huffman coding, a Huffman tree is generated based on the frequency of occurrence of each character in a data set. Each character in the data block is assigned a code based on the Huffman tree. In most cases, encoding data using the Huffman coding technique results in lossless data compression.
[0011] The partial Huffman coding technique applies the Huffman coding technique to only a preset number of characters, leaving the remaining characters uncoded. Each character is then marked or tagged as coded or uncoded. In this manner, decoding time is reduced and the size of the Huffman tables required to decode the Huffman coded data is reduced. Reducing the size of the Huffman tables reduces the amount of data that needs to be transmitted to the decoder along with the coded data. Additionally, reducing the Huffman tables facilitates hardware solutions that increase the decoding speed. The embodiments disclosed herein generally correspond to the partial Huffman technique. However, the full Huffman technique may alternatively be used.
[0012] Additionally, examples disclosed herein divide Huffman-encoded data blocks into coded data sub-blocks. Such coded data sub-blocks are padded by adding a preset code to the end of each sub-block, allowing an on-chip decoder to divide the sub-blocks for parallel decoding, thereby increasing computational bandwidth. In some examples, where there are few or no repeated characters within a block, some Huffman techniques may not reduce the size of the data block due to the amount of overhead associated with the included headers. Thus, examples disclosed herein do not perform any compression / encoding techniques on blocks where some Huffman techniques do not reduce the size of the data block.
[0013] Using the examples disclosed herein, users can tailor the compression scheme to a particular application data profile to achieve higher compression ratios. Additionally, the examples disclosed herein reduce the requirements for Huffman coding lookup tables to be compatible with hardware memory limitations and speed requirements. Additionally, the examples disclosed herein enable decoding and / or code parallelization, thereby supporting high decoding bandwidths.
[0014] 1 is a block diagram of an example off-chip component 100 and an example on-chip component 102. The example off-chip component 100 includes an example off-chip memory 104 for storing data / data sets and an example data compressor 106 for compressing the data sets stored in the example off-chip memory 104 before transmitting to the example on-chip component 102 for hardware-based processing. The example on-chip component 102 includes an example data decompressor 108 for decompressing the compressed data sets and an example hardware accelerator / neural network engine 110 for processing the data sets. Although the example block diagram of FIG. 1 includes the off-chip component 100, the example off-chip memory 104 and / or the example data compressor 106 may be located on the same chip as the example on-chip component 102 (e.g., all of the components of FIG. 1 may be located on the same chip).
[0015] The example off-chip component 100 of FIG. 1 includes an off-chip memory 104 (e.g., DRAM) that stores data to be processed by the hardware accelerator / neural network 110. The example off-chip memory 104 increases the memory capacity of the example hardware accelerator / neural network 110 by providing additional memory to store additional data that may be processed by the hardware accelerator / neural network 110. As described above, transferring uncompressed data from the off-chip memory 104 to the hardware accelerator / neural network 110 creates a bottleneck due to the bandwidth limitations of the off-chip memory 104 (e.g., DRAM). Thus, the example data compressor 106 compresses data that is stored and / or has already been stored in the off-chip memory 104 before sending it to the on-chip component 102 to reduce the size of the data and reduce and / or eliminate the bottleneck problem. The example data compressor 106 divides the stored data into blocks of data and compresses the data using three compression / encoding techniques based on the characteristics of the data in the blocks. Additionally, the exemplary data compressor 106 generates headers for the blocks (e.g., a first header for a first block, a second header for a second block, etc.) that identify the compression / encoding technique used and provide information (e.g., block size, encoding table, sub-block size, etc.) that the exemplary data decompressor 108 can use to decompress the blocks. In this manner, the exemplary data decompressor 108 can properly decompress the compressed data. Once compressed, the exemplary data compressor 106 stores the compressed data in the exemplary off-chip memory 104. In this manner, the off-chip memory 104 can transmit the compressed data to be processed by the exemplary hardware accelerator / neural network 110. In some examples, the data compressor 106 includes multiple processors that compress multiple data blocks in parallel, thereby increasing computational bandwidth. The exemplary data compressor 106 is further described below in connection with FIG. 2.
[0016] The example on-chip components 102 of FIG. 1 include a data decompressor 108 that interfaces with the off-chip components 100 to receive compressed data from the off-chip memory 104 and decompresses the compressed data before being sent to the hardware accelerator / neural network 110. In some examples, the data decompressor 108 is a hardware accelerator. The example data decompressor 108 receives the compressed data and identifies headers of blocks of compressed data to determine a compression technique. In this manner, the data decompressor 108 decompresses the compressed blocks based on the compression technique identified in the header of each block. Once decompressed, the example data decompressor 108 sends the decompressed data to the example hardware accelerator / neural network 110. The example hardware accelerator / neural network 110 processes the decompressed data based on the settings of the hardware accelerator / neural network 110. The example data decompressor 108 is further described below in conjunction with FIG. 2.
[0017] Figure 2 is a block diagram of an example implementation of an exemplary data compressor 106 and an example implementation of an exemplary data decompressor 108 of Figure 1. The example data compressor 106 includes an example memory interface 200, an example data slicer 202, an example data processor 204, an example compressor 206, an example header generator 208, an example padder 210, and an example compressed data assembler 212. The example data decompressor 108 includes an example off-chip interface 218, an example header processor 220, an example data splitter 221, an example decompressor 222, an example decompressed data assembler 224, and an example hardware accelerator / neural network interface 226.
[0018] The example memory interface 200 of Figure 2 receives data from the example off-chip memory 104 of Figure 1 to be compressed and sent to the example on-chip data decompressor 108. Once the data compressor 106 has compressed the data, the example memory interface 200 of Figure 2 sends the compressed data to the example off-chip memory 104 so that it can be retrieved by the on-chip components 102 of Figure 1.
[0019] When the memory interface 200 retrieves data from the exemplary off-chip memory 104, the exemplary data slicer 202 divides (e.g., slices) the data into data blocks. In some examples, the data slicer 202 divides the data into uniform fixed-size blocks. Additionally, the data slicer 202 may slice the encoded data (e.g., blocks encoded in part using Huffman compression) into encoded data sub-blocks to enable parallel decompression processing of the exemplary data decompressor 108, as described further below. In some examples, the data slicer 202 includes two data slicers. For example, there is a first data slicer that divides the original data into data blocks and a second data slicer that divides the Huffman encoded data into encoded data sub-blocks.
[0020] The example data processor 204 of FIG. 2 is one or more data processors that determine (e.g., select) a compression technique (e.g., RLE encoding, Huffman encoding, no encoding, and / or any other lossless compression technique) to use for a block of data based on characteristics of the data in the block. For example, when data processor(s) 204 obtain a block, data processor 204 determines whether all of the data in the block corresponds to the same value and / or character (e.g., all "0's," all "1's," all "a's," etc.). If data processor 204 determines that the data in the block corresponds to the same value / character, data processor 204 determines that an RLE encoding technique may be applied to the block to compress the block without loss of information. If data processor 204 determines that the data in the block corresponds to different values / characters, data processor 204 may determine that (e.g., partial or complete) Huffman encoding or no encoding should be applied to the block. As discussed above, applying Huffman coding techniques to some blocks may result in a larger amount of data (e.g., if the blocks have few or no repeated values / characters). Thus, in some examples, the exemplary data processor 204 may process the data blocks to determine whether a partial Huffman coding technique for the data block will result in a smaller or larger amount of data. In such examples, if the exemplary data processor 204 determines (e.g., using probabilistic modeling) that partial Huffman coding of the data block will result in more data than no coding, the data processor 204 determines that no coding is applied to the data block. In other examples, the compressor 206 applies partial Huffman coding to the data and the data processor 204 determines whether the result is larger or smaller than without applying the compression technique (e.g., no coding). If the data processor 204 determines that the result is larger than without applying the compression technique, the data processor 204 discards the Huffman coded data, thereby leaving the data block uncoded (e.g., uncompressed).The data processor 204 may be a single data processor or multiple data processors, for example, multiple data processors 204 may be utilized to process data blocks in parallel.
[0021] The example compressor 206 of FIG. 2 performs a compression technique (e.g., RLE encoding, Huffman encoding, and / or any other lossless compression technique) on the data block based on the technique selected by the data processor 204. As described above, the data processor 204 selects RLE encoding when all data in the block correspond to the same value and / or character (e.g., all "0's", all "1's", all "a's", etc.). When the data processor 204 selects RLE for the data block, the data processor 204 instructs the header generator 208 to generate a header or data packet that identifies the repeating value of the block and / or the number of times a value is repeated. For example, if the block is an eight character block with each bit corresponding to a "1", the data processor 204 instructs the header generator 208 to generate a header that identifies an indication that each of the eight characters corresponds to a "1" value and that the "1" is repeated eight times.
[0022] When the data processor 204 of FIG. 2 selects Huffman coding or partial Huffman coding, the exemplary compressor 206 applies Huffman coding or partial Huffman coding to the data block. As described above, to apply Huffman coding, a Huffman tree is generated based on the frequency of occurrence of each character in the data set. Each character of the block of data is assigned a code based on the Huffman tree. In most cases, encoding data using Huffman coding techniques results in lossless data compression. Partial Huffman coding techniques include applying Huffman coding techniques to only a preset number of characters and leaving the remaining characters uncoded, thereby reducing the decoding time and the size of the Huffman tables required to decode the Huffman coded data. Characters in the coded data are preceded by a marker that identifies whether the character is coded. In some examples, the data processor 204 determines which and / or how many of the preset characters are in the Huffman coding, including a tradeoff between header overhead and data compression. For example, the data processor 204 may determine that the fractional Huffman technique can only be applied to 8 of the 236 possible characters. Thus, the data processor 204 determines the 8 most frequently repeated characters of the data, and the compressor 206 applies symbols to the 8 determined characters to apply fractional Huffman coding using the 8 determined characters. Applying the fractional Huffman coding technique allows for faster compression and allows the memory 104 to transmit smaller Huffman tables that are used to decompress (e.g., decode) blocks compressed using the Huffman coding technique. The compressor 206 may be a single compressor or multiple compressors. For example, multiple compressors 206 may be utilized to code (e.g., compress) blocks of data in parallel.
[0023] The example header generator 208 of FIG. 2 generates a header and / or data packet that identifies the encoding and / or compression type (e.g., RLE encoding, Huffman encoding, no encoding, and / or any other lossless compression technique) used to encode and / or compress the block of data. For example, if the compression type of the block is RLE compression, the header generator 208 generates a header and / or data packet that identifies the RLC compression as well as a repeated character corresponding to the RLE compression and the number of times the character is repeated. If the compression type of the block is Huffman compression or partial Huffman compression, the header generator 208 generates a header and / or data packet that corresponds to the Huffman compression and / or partial Huffman compression technique. For example, the header generator 208 may generate a header that includes a character marker that indicates that the block is Huffman encoded, a table for decoding the data, the size of the encoded data, the size of a sub-block, and / or whether a sub-block is encoded. If the compression type of the block is coded and / or uncompressed, the exemplary header generator 208 generates a header and / or data packet corresponding to uncompressed and / or uncoded and the size of the uncoded data. The exemplary header generator 208 adds a header and / or data packet to the coded or uncoded block. In this manner, the exemplary data decompressor 108 can identify which compression technique was used for each block and decompress the compressed block based on the compression technique. The header generator 208 may be a single header generator or multiple header generators. For example, the header generator 208 may be utilized to generate headers for blocks of data in parallel.
[0024] When Huffman coding or partial Huffman coding is applied to block data to generate Huffman coded data, the example slicer 202 of FIG. 2 slices (e.g., groups) the Huffman coded data into a preset number of coded sub-blocks corresponding to N coded sub-blocks. For example, if the coded data includes 27 Huffman codes and the preset number of coded sub-blocks is 9, the slicer 202 groups 3 Huffman codes for each sub-block. The preset number of coded sub-blocks may be based on the number of parallel processors of the data decompressor 108. In this manner, each parallel processor can process each coded sub-block or N sub-blocks in parallel. Once sliced into coded sub-blocks, the example padder 210 pads each sub-block with a predefined code pattern that represents the end of the sub-block. As described above, the Huffman codes are variable (e.g., non-uniform) in length. For example, a first Huffman code for a first 16-bit sub-block may be 8 bits long, while a second Huffman code for a second 16-bit sub-block may be 10 bits long. Thus, grouping one or more Huffman codes corresponds to a variable (e.g., non-uniform) length coded sub-block. Thus, the padder 210 adds a predefined code to the end of the sub-block, and the header generator 208 includes the size of the padded sub-block in the header, such that the exemplary data decompressor 108 splits the individual coded sub-blocks based on the size specified in the header to facilitate parallel decoding. The padder 210 may be a single padder or multiple padders. For example, the padder 210 may be utilized to pad the coded sub-blocks in parallel.
[0025] 2 assembles the padded encoded sub-blocks in order with the generated headers to complete the Huffman encoding of the data block. Additionally, the example compressed data assembler 212 assembles encoded (e.g., compressed) or unencoded (e.g., uncompressed) data blocks to generate the entire compressed data that is sent to the example data decompressor 108. In some examples, data blocks may be processed in parallel. Thus, the compressed data assembler 212 monitors the blocks so that the encoded blocks can be assembled in the same order that the data blocks were arranged prior to encoding.
[0026] The example off-chip interface 218 of FIG. 2 retrieves compressed data from the example off-chip memory 104. Once the compressed data is retrieved, the example header processor 220 processes the compressed data to identify headers for blocks of compressed data. As discussed above, the headers include information that identifies the encoding technique used to compress each block of compressed data. Thus, the header processor 220 can split compressed blocks by identifying headers for decompression of the data blocks.
[0027] The example decompressor 222 of FIG. 2 decompresses data blocks based on corresponding compression information specified in the header of each corresponding block. For example, if the first header of the first block of encoded data corresponds to RLE compression, the decompressor 222 processes the first header to determine which characters are repeated and how many times the characters are repeated, and passes the determined number of repeated characters to the decompressed data assembler 224. The number may be preset or may be specified in the header. If the second header of the second block of encoded data corresponds to no encoding, the decompressor 222 removes the header and passes the unencoded data to the decompressed data assembler without decompressing (e.g., decoding) the data. If the third header of the third block of encoded data corresponds to (e.g., partially or completely) Huffman encoding, the decompressor 222 decompresses the third block of encoded data using a Huffman table from the header of the block corresponding to the Huffman code. In some examples, the data splitter 221 divides the block of compressed data into sub-blocks based on a sub-block size specified in the header, where each sub-group can be processed in parallel by multiple decompressors 222. Once decompressed, the decompressors 222 pass the decompressed sub-blocks to an exemplary decompressed data assembler 224.
[0028] The example decompressed data assembler 224 of FIG. 2 assembles the decoded sub-blocks to complete the Huffman decoding of the data block. For example, if there are multiple decompressors 222 that decode the Huffman-encoded sub-blocks in parallel, the decompressed data assembler 224 monitors the parallel processors so that the decompressed sub-blocks can be ordered to generate the decompressed block data. Additionally, the example decompressed data assembler 224 assembles the decoded (e.g., decompressed) data blocks to generate the entire decompressed data that is sent to the example hardware accelerator / neural network 110. In some examples, the data blocks are processed (e.g., decompressed and / or decoded) in parallel. Thus, the decompressed data assembler 224 monitors the blocks so that the decoded blocks can be assembled in the same order as the data blocks were received. The hardware accelerator / neural network interface 226 of FIG. 2 sends the full set of decompressed data to the example hardware accelerator / neural network 110 of the on-chip component 102 of FIG. 1.
[0029] 2 illustrates an example method of implementing the example data compressor 106 and the example data decompressor 108 of FIG. 1, although one or more of the elements, processes and / or devices illustrated in FIG. 2 may be combined, divided, rearranged, omitted, removed, and / or implemented in other ways. Additionally, the example memory interface 200, the example data slicer 202, the example data processor 204, the example compressor 206, the example header generator 208, the example padder 210, the example compressed data assembler 212, the example off-chip interface 218, the example header processor 220, the example data splitter 221, the example decompressor 222, the example decompressed data assembler 224, the example hardware accelerator / neural network interface 226, and / or more generally, the example data compressor 106 and / or the example data decompressor 108 of FIG. 2 may be implemented by hardware, software, firmware, and / or any combination of hardware, software, and / or firmware. Thus, for example, the example memory interface 200, example data slicer 202, example data processor 204, example compressor 206, example header generator 208, example padder 210, example compressed data assembler 212, example off-chip interface 218, example header processor 220, example data splitter 221, example decompressor 222, example decompressed data assembler 224, example hardware accelerator / neural network interface 226, and / or more generally, the example data compressor 106 and / or the example data decompressor 108 of FIG. 2 may be implemented by one or more analog or digital circuits, logic circuits, programmable processors, programmable controllers, graphics processing units (GPUs), digital signal processors (DSPs), application specific integrated circuits (ASICs), programmable logic devices (PLDs), and / or field programmable logic devices (FPLDs).When any of the apparatus or system claims of this patent are read to cover purely software and / or firmware implementations, the example memory interface 200, example data slicer 202, example data processor 204, example compressor 206, example header generator 208, example padder 210, example compressed data assembler 212, example off-chip interface 218, example header processor 220, example data splitter 221, example decompressor 222, example decompressed data assembler 224, example hardware accelerator / neural network interface 226, and / or more generally, the example data compressor 106 and / or the example data decompressor 108 of FIG. 2 are expressly defined herein to include non-transitory computer readable storage devices or storage discs containing software and / or firmware, such as memories, digital versatile discs (DVDs), compact discs (CDs), Blu-ray discs, etc. Additionally, the example data compressor 106 and / or data decompressor 108 of Figure 2 may include one or more elements, processes and / or devices in addition to or instead of those shown in Figure 2, and / or may include two or more of any or all of the illustrated elements, processes and devices. As used herein, the phrase "in communication," including variations thereof, encompasses direct communication and / or indirect communication via one or more intermediate 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.
[0030] Flowcharts illustrating exemplary hardware logic, machine readable instructions, hardware implemented state machines, and / or any combination thereof for implementing the exemplary data compressor 106 of FIG. 1 and / or FIG. 2 are shown in FIG. 3-4. Flowcharts illustrating exemplary hardware logic, machine readable instructions, hardware implemented state machines, and / or any combination thereof for implementing the exemplary data decompressor 108 of FIG. 1 and / or FIG. 2 are shown in FIG. 5. The machine readable instructions may be executable programs or portions of executable programs for execution by a computer processor, such as the processor 712, 812 shown in the exemplary processor platform 700, 800 discussed below in connection with FIG. 7 and / or FIG. 8. The program may be embodied in software stored on a non-transitory computer readable storage medium, such as a CD-ROM, floppy disk, hard drive, DVD, Blu-ray disk, memory associated with the processor 712, 812, etc., although the entire program and / or portions thereof may alternatively be executed by a device other than the processor 712, 812 and / or embodied in firmware or dedicated hardware. Further, although the exemplary program is described with reference to the flowcharts shown in Figures 3-5, many other ways of implementing the exemplary data compressor 106 and / or data decompressor 108 of Figure 2 may alternatively be used. For example, the order of execution of the blocks may be changed and / or some of the described blocks may be modified, eliminated, or combined. Additionally or alternatively, any or all of the blocks may be implemented by one or more hardware circuits (e.g., discrete and / or integrated analog and / or digital circuits, FPGAs, ASICs, comparators, operational amplifiers (op-amps), logic circuits, etc.) configured to perform the corresponding operations without executing software or firmware.
[0031] As noted above, the exemplary processes of Figures 3-5 may be implemented using executable instructions (e.g., computer and / or machine readable instructions) stored on a non-transitory computer and / or machine readable medium, such as a hard disk drive, flash memory, read-only memory, compact disk, digital versatile disk, cache, random access memory, and / or any other storage device or storage disk in which information is stored for any period of time (e.g., long term, permanent, short term, temporary buffering, and / or caching of information). As used herein, the term non-transitory computer readable medium is 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.
[0032] The terms "including" and "comprising" (and all forms and tenses thereof) are used herein as 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 any type of claim provision, it should be understood that additional elements, terms, etc. may be present without falling outside the scope of the corresponding claim or provision. As used herein, the terms "comprising" and "including" are open-ended in the same way that, for example, the term "at least" is used as a transitional phrase in a claim preamble. When the term "and / or" is used in the form A, B, and / or C, it means any combination or subset of A, B, and / or C, such as: (1) A only; (2) B only; (3) C only; (4) A and B; (5) A and C; (6) B and C; (7) A, B and C.
[0033] Figure 3 is an example flowchart 300 representing machine-readable instructions that may be executed by an example implementation of the data compressor 106 of Figure 1 and / or Figure 2 to compress data stored off-chip before being transmitted to the on-chip component 102 of Figure 1. Although the flowchart 300 of Figure 3 is described in conjunction with the example data compressor 106 of Figure 1 and / or Figure 2, other types of data compressors and / or other types of processors may be utilized instead. Although the example flowchart 300 of Figure 3 is described in conjunction with RLE compression, Huffman compression, and / or no compression, other compression techniques may additionally or alternatively be used.
[0034] In block 302, the example data slicer 202 retrieves a data set from the example off-chip memory 104 via the example memory interface. The data set is a data set stored in the example off-chip memory 104 for use by the example on-chip hardware accelerator / neural network 110 of FIG. 1 which performs hardware-based processing of the data set. In block 304, the data slicer 202 divides the data set into N data blocks. The size and / or number of the blocks may be based on user and / or manufacturer preferences. The N data blocks may or may not be uniform in size. In block 306, the example data compressor 106 compresses the data blocks as described below in connection with FIG. 4.
[0035] At block 308, the example compressed data assembler 212 assembles the compressed blocks to generate a compressed data set. For example, if the data compressor 106 compresses the blocks in order, the data assembler 212 attaches the compressed blocks in the same order that the blocks were compressed. If the data compressor 106 compresses the blocks out of order or in parallel, the data assembler 212 monitors the compression so that the compressed data blocks can be reassembled in the same order as the data from the data set. At block 310, the example interface 202 sends the compressed data set to the illustrated off-chip memory 104 for storage as compressed data.
[0036] FIG. 4 is an exemplary flowchart 306 of exemplary machine-readable instructions that may be executed by an exemplary implementation of the data compressor 106 of FIG. 1 and / or FIG. 2 to compress a block of data, as described above in connection with FIG. 3. Although the flowchart 306 of FIG. 4 is described in connection with the exemplary data compressor 106 of FIG. 1 and / or FIG. 2, other types of data compressors and / or other types of processors may be used instead. The exemplary flowchart 306 of FIG. 4 may be performed on multiple blocks of data, linearly and / or in parallel (e.g., by parallel data slicer 202, data processor 204, compressor 206, header generator 208, and / or padder 210). Although the exemplary flowchart 306 of FIG. 4 is described in connection with RLE compression, Huffman compression, and / or no compression, other compression techniques may additionally or alternatively be used.
[0037] For each of the N blocks of data (blocks 402-430), the example data processor 204 determines whether all of the data in the data block correspond to the same value and / or character (block 404). For example, if the data block contains all "a's", the example data processor 204 determines that all of the data in the data block correspond to the same character.
[0038] If the exemplary data processor 204 determines that all data in the block corresponds to the same value and / or character (block 404: YES), the exemplary compressor 206 performs an RLE compression technique to encode / compress the data in the block (block 406). For example, the compressor 206 may instruct the header generator 208 to generate a data packet that identifies repeated characters and / or the number of repetitions of the character that the character is repeated in the block of data. In block 408, the exemplary header generator 208 generates a data packet and / or a header for inclusion in the compressed data that identifies that the data block was compressed using the RLE compression technique. In this manner, the exemplary data decompressor 108 can identify the block as corresponding to RLE compression and decompress the block based on the RLE decompression technique.
[0039] If the exemplary data processor 204 determines that not all of the data in the block correspond to the same value and / or character (block 404: NO), the exemplary compressor 206 performs a partial Huffman coding technique to encode / compress the data block (block 412). In some examples, the compressor 206 may perform a full Huffman coding technique. As described above, to apply Huffman coding, the exemplary compressor 206 generates a Huffman tree based on the frequency of occurrence of each character in a set of data. The compressor 206 assigns a code to each character in the block of data based on the Huffman tree. In most cases, encoding data using a Huffman coding technique results in lossless data compression that is smaller in size than no coding. To apply a partial Huffman coding technique, the exemplary compressor 206 applies the Huffman coding technique only to a preset number of characters and leaves the remaining characters uncoded, thereby increasing the encoding and / or decoding time and reducing the size of the Huffman tables required to decode the Huffman coded data. Additionally, the exemplary compressor 206 marks each character as either coded or uncoded.
[0040] At block 414, the exemplary data processor 204 determines whether the coded data and headers accommodate more bits than the uncoded data. As discussed above, Huffman or partial Huffman compression techniques may accommodate more data for data blocks with little or no repetition of characters within the block. In some examples, the data processor 204 may determine whether Huffman or partial Huffman compression will result in more bits before performing compression (e.g., before block 412) based on the repetition of data within the block.
[0041] If the exemplary data processor 204 determines that the encoded data and header correspond to more bits than the unencoded data (block 414: YES), the exemplary data processor 204 discards the encoded data (block 416). In block 418, the exemplary header generator 208 generates a header corresponding to no encoding. In this manner, the exemplary data decompressor 108 can determine that the block of data is unencoded and / or uncompressed. In block 420, the exemplary header generator 208 passes the block of unencoded data along with the generated header to the exemplary compressed data assembler 212.
[0042] If the example data processor 204 determines that the encoded data does not correspond to more bits than the unencoded data (block 414: NO), the example header generator 208 generates a header corresponding to Huffman and / or partial Huffman (PF) encoding (block 422). In this manner, the example data decompressor 108 identifies blocks corresponding to Huffman and / or PH compression and decompresses the blocks based on Huffman and / or PH decompression techniques. In block 424, the example data slicer 202 slices, divides, and / or groups the encoded data into encoded sub-blocks. The sub-blocks may include one or more Huffman codes. The number of Huffman codes per sub-block may be preset, customizable, and / or based on user and / or manufacturer preferences. For example, the number of Huffman codes per sub-block may correspond to the number of parallel processors in the example data decompressor 108, thereby optimizing the processing power of the data decompressor 108.
[0043] In block 424, the exemplary padder 210 pads the encoded sub-blocks using a predefined pattern. As described above, different Huffman codes may correspond to non-uniform (e.g., different) lengths as a result of the encoding process. For example, a first Huffman code may be 2 bits of data and a second Huffman code may be 4 bits of data. Thus, the sliced sub-block sizes may correspond to non-uniform (e.g., different) lengths. Thus, the exemplary padder 210 pads each of the encoded sub-blocks with a predefined pattern corresponding to the end of the sub-block. In some examples, the padding ensures that each variable-sized sub-block is the same length (e.g., a selected length). In this manner, the exemplary data decompressor 108 may divide the compressed sub-blocks for parallel decompression by dividing the sub-blocks based on a selected sub-block length. In some examples, the padded sub-blocks are of different lengths. In such examples, the data decompressor 108 divides the encoded block into sub-blocks based on the specified padding in the header. At block 428, the example padder 210 passes the padded sub-blocks with headers to the example compressed data assembler 212 to be assembled before transmission to the example on-chip component 102 of FIG.
[0044] Figure 5 is an example flowchart 500 representing example machine-readable instructions that may be executed by an example implementation of the data decompressor 108 of Figures 1 and / or 2 to decompress compressed data from the example off-chip component 100 of Figure 1. Although the flowchart 500 of Figure 5 is described in conjunction with the example data decompressor 108 of Figures 1 and / or 2, other types of data decompressors and / or other types of processors may be utilized instead. Although the flowchart 500 is described in conjunction with successive decompression of compressed blocks, the flowchart may be used in conjunction with a parallel decompression process in which each block is processed in parallel.
[0045] At block 502, the example header processor 220 obtains a compressed data set from the example off-chip interface 218. The compressed data set corresponds to data stored in the example off-chip memory 104 that has been compressed by the example data compressor 106 using techniques disclosed herein. For each of the compressed data blocks (blocks 504-530) (e.g., processed sequentially by a single decompressor 222), the example header processor 220 identifies a header of an available compressed block that corresponds to an encoded block of data (block 506). As discussed above, during compression of the data, each compressed data block includes a header that identifies the type of compression used to compress the data block. Thus, at block 508, the example header processor 220 determines the compression and / or encoding type based on the header of the encoded block. Although the example flowchart 500 of FIG. 5 is described in conjunction with data compressed using RLE compression, Huffman compression, and / or no compression, the headers may correspond to additional and / or alternative compression techniques. In such an embodiment, data decompressor 108 decompresses the data based on such additional and / or alternative compression techniques.
[0046] For each of the compressed data blocks (blocks 508-530) (e.g., split by the exemplary data splitter 221 and processed sequentially by a single decompressor 222), the exemplary decompressor 222 determines whether the compression type corresponds to RLE encoding and / or compression (block 510). If the exemplary decompressor 222 determines that the compression type corresponds to RLE encoding (block 510: YES), the exemplary decompressor 222 performs RLE decompression to decode the data based on the header information (block 512). For example, if the header information specifies that the block of data corresponds to "a" repeated 16 times, the decompressor 222 decompresses the data to generate "a" repeated 16 times. In block 514, the exemplary decompressor 222 passes the decompressed data (e.g., "a" repeated 16 times in the above example) to the exemplary decompressed data assembler 224.
[0047] If the exemplary decompressor 222 determines that the compression type does not correspond to RLE encoding (block 510: NO), the exemplary decompressor 222 determines whether the compression type corresponds to non-encoded data (block 516). If the exemplary decompressor 222 determines that the compression type corresponds to non-encoded data (block 516: YES), the exemplary decompressor 222 passes the non-encoded data to the decompressed data assembler 224. If the exemplary decompressor 222 determines that the compression type does not correspond to non-encoded data (block 516: NO), the exemplary decompressor 222 determines the encoding sub-blocks of the Huffman or partial Huffman encoded data block based on the sub-block size specified in the header (block 520). As described above, the exemplary data compressor 106 pads the ends of the sub-blocks of the data block with a predefined end pattern. In this manner, the exemplary decompressor 222 can divide the block into sub-blocks based on the sub-block size specified in the header.
[0048] For each encoded sub-block (blocks 520-528) (e.g., split into sub-blocks by the exemplary data splitter 221 and processed linearly using a single decompressor 222 or in parallel using multiple decompressors 222), the exemplary decompressor 222 performs block (e.g., partial or full Huffman) decoding on the encoded sub-block. For example, the decompressor 222 may utilize a Huffman table that maps Huffman codes to characters representing the decompressed data to decompress and / or decode characters marked as encoded and leave characters marked as uncoded unchanged. In block 526, the exemplary decompressor 222 passes the decoded sub-block to the decompressed data assembler 224. In block 529, the exemplary decompressed data assembler 224 assembles the sub-blocks into decompressed blocks.
[0049] At block 532, the example decompressed data assembler 224 assembles the decoded blocks into a decompressed data set in an order that corresponds to the data set stored in the example off-chip memory 104. At block 534, the example hardware accelerator / neural network interface 226 transmits the decompressed data set to the hardware accelerator / neural network 110 of FIG.
[0050] Figure 6 illustrates an example data decompression process 600 for data from the example off-chip component 100 of Figure 1 using the example data compressor 106 of Figure 1 and / or Figure 2. The example decompression process 600 includes an example data set 601, an example data block 602, example decision blocks 604, 614, an example RLE compression 606, example headers 608, 616, 620, an example compressed data set 610, an example coding block 612, an example Huffman compression 613, an example coded data block 616, an example uncoded data block 618, an example coding block 622, an example slicing 624, an example coded sub-block 626, and an example padding 628.
[0051] 6 corresponds to data stored in the exemplary off-chip memory 100. The exemplary data slicer 202 slices the data set 601 into multiple data blocks, including the exemplary data block 602. Once sliced, the exemplary data processor 204 selects an encoding technique based on characteristics of the data in the data block 602 at decision block 604. If the data processor 204 determines that all the data in the block is the same, the data processor 204 selects RLE compression 606 to compress the data block 602. If the data processor 204 determines that not all the data in the block is the same, the data processor 204 selects partial Huffman compression (or full Huffman compression) 613.
[0052] If RLE compression 606 is selected, the exemplary header generator 208 generates an exemplary header 608 corresponding to the RLE compression technique and identifies a value representing all the data in the data block and the number of repetitions specified in the header. Thus, the exemplary header 608 is included as an encoded data block 612 in the compressed data set 610. If partial Huffman compression 613 is selected, when the compressor 206 performs the partial Huffman compression 613, the data processor 204 determines whether the encoded data and the header are greater than a threshold (e.g., a threshold corresponding to the amount of data corresponding to the non-encoded data block 602). If the data processor 204 determines that the encoded data and the corresponding header are greater than the threshold, the compressor 206 discards the encoded data block and the header generator 208 generates an exemplary header 616 corresponding to no encoding and includes the header 616 with the non-encoded data block 602 as an encoded block 612 in the compressed data set 610.
[0053] If the data processor 204 determines that the encoded data and corresponding header are smaller than the threshold, the exemplary header generator 208 generates an exemplary header 620 that specifies the partial Huffman compression 613. Additionally, the exemplary data slicer 202 slices the Huffman encoded data 622 in an exemplary slicing block 624 to generate encoded sub-blocks 626. Because the encoded data sub-blocks 626 may be of non-uniform size (e.g., each data sub-block 626 may correspond to a different size), the exemplary padder 210 pads the encoded data sub-blocks 626 with a selected pattern in an exemplary padding block 628. Additionally, the header generator 208 adds the size of each sub-block to the header. In this manner, the exemplary data decompressor 108 can divide the encoded block 612 into exemplary encoded data sub-blocks 626 based on the specified size. Once padded, the header 620, the padded sub-blocks and the corresponding headers are included in the exemplary compressed data set 610 as encoded blocks 612.
[0054] Figure 7 is a block diagram of an example processor platform 700 configured to execute the instructions of Figures 3-4 to implement the example data compressor 106 of Figure 2. The processor platform 700 can be, for example, a server, a personal computer, a workstation, a self-learning machine (e.g., neural networks), a mobile device (e.g., a mobile phone, a smartphone, a tablet such as an iPad®), or any other type of computing device.
[0055] The processor platform 700 of the illustrated example includes a processor 712. The processor 712 of the illustrated example is hardware. For example, the processor 712 can be implemented by one or more integrated circuits, logic circuits, microprocessors, GPUs, DSPs, or controllers of any desired family or manufacturer. A hardware processor may be a semiconductor-based (e.g., silicon-based) device. In this example, the processor implements the example memory interface 200, the example data slicer 202, the example data processor 204, the example compressor 206, the example header generator 208, the example padder 210, and / or the example compressed data assembler 212 of FIG. 2.
[0056] The processor 712 of the illustrated example includes a local memory 713 (e.g., a cache). In some examples, the local memory 713 implements the example results storage 218. The processor 712 of the illustrated example is in communication with a main memory, including a volatile memory 714 and a non-volatile memory 716, via a bus 718. The volatile memory 714 may be implemented by SDRAM (Synchronous Dynamic Random Access Memory), DRAM (Dynamic Random Access Memory), RDRAM® (RAMBUS® Dynamic Random Access Memory), and / or any other type of random access memory device. The non-volatile memory 716 may be implemented by flash memory and / or any other desired type of memory device. Access to the main memory 714, 716 is controlled by a memory controller.
[0057] The processor platform 700 of the illustrated example also includes an interface circuit 720. The interface circuit 720 may be implemented with any type of interface standard, such as an Ethernet interface, a Universal Serial Bus (USB), a Bluetooth interface, a Near Field Communication (NFC) interface, and / or a PCI Express interface.
[0058] In the illustrated example, one or more input devices 722 are connected to the interface circuit 720. The input devices 722 allow a user to enter data and / or commands into the processor 712. The input devices can be implemented, for example, by audio sensors, microphones, cameras, (still or video) keyboards, buttons, mice, touch screens, track pads, track balls, isopoints, and / or voice recognition systems.
[0059] One or more output devices 724 are also connected to the interface circuitry 720 of the illustrated example. The output device(s) 724 can be implemented by, for example, a display device (e.g., a light emitting diode (LED), an organic light emitting diode (OLED), a liquid crystal display (LCD), a cathode ray tube display (CRT), an in-place switching (IPS) display, a touch screen, etc.), a tactile output device, a printer, and / or a speaker. Thus, the interface circuitry 720 of the illustrated example typically includes a graphics driver card, a graphics driver chip, and / or a graphics driver processor.
[0060] The interface circuitry 720 of the illustrated example also includes communications devices such as transmitters, receivers, transceivers, modems, residential gateways, wireless access points, network interfaces, etc. that facilitate the exchange of data with external machines (e.g., any type of computing device) over the network 726. Communications may be via, for example, an Ethernet connection, a Digital Subscriber Line (SDL) connection, a telephone line connection, a coaxial cable system, a satellite system, a line-of-sight wireless system, a cellular telephone system, etc.
[0061] The processor platform 700 of the illustrated example also includes one or more mass storage devices 728 for storing software and / or data. Examples of such mass storage devices 728 include a floppy disk drive, a hard drive disk, a compact disk drive, a Blu-ray disk drive, a redundant array of independent disks (RAID), and a digital versatile disk (DVD) drive.
[0062] The machine-executable instructions 732 of Figures 3-4 may be stored in the mass storage device 72 8, in the volatile memory 714, in the non-volatile memory 716, and / or on a removable non-transitory computer-readable storage medium such as a CD, DVD, etc.
[0063] Figure 8 is a block diagram of an example processor platform 800 configured to execute the instructions of Figure 5 to implement the example data compressor 106 of Figure 2. The processor platform 800 can be, for example, a server, a personal computer, a workstation, a self-learning machine (e.g., neural networks), a mobile device (e.g., a mobile phone, a smartphone, a tablet such as an iPad), or any other type of computing device.
[0064] The processor platform 800 of the illustrated example includes a processor 812. The processor 812 of the illustrated example is hardware. For example, the processor 812 can be implemented by one or more integrated circuits, logic circuits, microprocessors, GPUs, DSPs, or controllers of any desired family or manufacturer. The hardware processor may be a semiconductor-based (e.g., silicon-based) device. In this example, the processor implements the example off-chip interface 218, the example header processor 220, the example data splitter 221, the example decompressor 222, the example decompressed data assembler 224, and / or the example hardware accelerator / neural network interface 226 of FIG. 2.
[0065] The processor 812 of the illustrated example includes a local memory 813 (e.g., a cache). In some examples, the local memory 813 implements the example results storage 218. The processor 812 of the illustrated example communicates with a main memory, including a volatile memory 814 and a non-volatile memory 816, via a bus 818. The volatile memory 814 may be implemented by SDRAM (Synchronous Dynamic Random Access Memory), DRAM (Dynamic Random Access Memory), RDRAM (RAMBUS Dynamic Random Access Memory), and / or any other type of random access memory device. The non-volatile memory 816 may be implemented by flash memory and / or any other desired type of memory device. Access to the main memory 814, 816 is controlled by a memory controller.
[0066] The processor platform 800 of the illustrated example also includes an interface circuit 820. The interface circuit 820 may be implemented with any type of interface standard, such as an Ethernet interface, a Universal Serial Bus (USB), a Bluetooth interface, a Near Field Communication (NFC) interface, and / or a PCI Express interface.
[0067] In the illustrated example, one or more input devices 822 are connected to the interface circuitry 820. The input devices 822 allow a user to input data and / or commands to the processor 812. The input devices can be implemented, for example, by audio sensors, microphones, cameras (still or video), keyboards, buttons, mice, touch screens, track pads, track balls, isopoints, and / or voice recognition systems.
[0068] One or more output devices 824 are also connected to the interface circuitry 820 of the illustrated example. The output device(s) 824 can be implemented by, for example, a display device (e.g., a light emitting diode (LED), an organic light emitting diode (OLED), a liquid crystal display (LCD), a cathode ray tube display (CRT), an in-place switching (PS) display, a touch screen, etc.), a tactile output device, a printer, and / or a speaker. Thus, the interface circuitry 820 of the illustrated example typically includes a graphics driver card, a graphics driver chip, and / or a graphics driver processor.
[0069] The interface circuitry 720 of the illustrated example also includes communications devices such as transmitters, receivers, transceivers, modems, residential gateways, wireless access points, network interfaces, etc. that facilitate the exchange of data with external machines (e.g., any type of computing device) over the network 726. Communications may be via, for example, an Ethernet connection, a Digital Subscriber Line (SDL) connection, a telephone line connection, a coaxial cable system, a satellite system, a line-of-sight wireless system, a cellular telephone system, etc.
[0070] The processor platform 800 of the illustrated example also includes one or more mass storage devices 828 for storing software and / or data. Examples of such mass storage devices 728 include floppy disk drives, hard drive disks, compact disk drives, Blu-ray disk drives, redundant array of independent disks (RAID), and digital versatile disk (DVD) drives.
[0071] The machine-executable instructions 832 of FIG. 5 may be stored in the mass storage device 828, in the volatile memory 814, in the non-volatile memory 816, and / or on a removable non-transitory computer-readable storage medium such as a CD or DVD.
[0072] Exemplary methods, apparatus, systems, and articles of manufacture for compressing data are disclosed herein. Further examples and combinations thereof include the following.
[0073] Example 1 includes an apparatus including an off-chip memory for storing data; a data slicer for dividing a data set into a plurality of data blocks; a data processor for selecting a first compression technique for a first block of the plurality of data blocks based on a first characteristic of the first block and for selecting a second compression technique for a second block of the plurality of data blocks based on a second characteristic of the second block; a first compressor for compressing the first block using the first compression technique to generate a first compressed data block; a second compressor for compressing the second block using the second compression technique to generate a second compressed data block; a header generator for generating a first header specifying the first compression technique and a second header specifying the second compression technique; and an interface for transmitting the first compressed data block with the first header and the second compressed data block with the second header, the first compressed data block and the second compressed data block, the first compressed data block and the second compressed data block, the second ...
[0074] Example 2 includes the apparatus of example 1, wherein the data processor selects the first compression technique when the data in the block correspond to the same value and selects the second compression technique when the data in the block includes at least one different value.
[0075] Example 3 includes the apparatus of example 1, in which the first compression technique is at least one of a Huffman compression technique, an RLE compression technique, or no compression technique.
[0076] Example 4 includes the apparatus of example 3, wherein the data processor is to select the first compression technique over no compression technique if the Huffman compression technique results in more data than no compression technique.
[0077] Example 5 includes the apparatus of example 1, in which the compressor is configured to divide the first compressed data block into sub-blocks of the first compressed data.
[0078] Example 6 includes the apparatus of example 5, wherein the sub-blocks of the first compressed data are non-uniform in size.
[0079] Example 7 includes the apparatus of example 5, further including one or more padders configured to pad the sub-blocks with the pattern by adding the pattern to the sub-blocks.
[0080] Example 8 includes the apparatus of example 1, wherein the data blocks are of uniform size.
[0081] Example 9 includes the apparatus of example 1, wherein the first compressor and the second compressor perform the first compression technique and the second compression technique in parallel on respective blocks.
[0082] Example 10 includes the apparatus of example 1, wherein the compressor is configured to discard the first compressed data block and retain the uncompressed data block if the selected first compression technique results in more data than without the compression technique.
[0083] Example 11 includes the apparatus of example 10, wherein the first header specifies no compression technique.
[0084] Example 12 includes a non-transitory computer-readable storage medium including instructions that, when executed, cause at least a machine to divide a data set into a plurality of data blocks, select a first compression technique for a first block of the plurality of data blocks based on a first characteristic of the first block, select a second compression technique for a second block of the plurality of data blocks based on a second characteristic of the second block, compress the first block using the first compression technique to generate a first compressed data block, compress the second block using the second compression technique to generate a second compressed data block, generate a first header identifying the first compression technique and a second header identifying the second compression technique, and store the first compressed data block with the first header and the second compressed data block with the second header in a chip memory.
[0085] Example 13 includes the computer-readable storage medium of example 12, wherein the instructions cause the machine to select the first compression technique if the data in the block corresponds to a same value and to select the second compression technique if the data in the block includes at least one distinct value.
[0086] Example 14 includes the computer-readable storage medium of example 12, wherein the first compression technique is at least one of a Huffman compression technique, an RLE compression technique, or no compression technique.
[0087] Example 15 includes the computer-readable storage medium of example 14, in which the instructions cause the machine to select the first compression technique over no compression technique if the Huffman compression technique results in more data than no compression technique.
[0088] Example 16 includes the computer-readable storage medium of example 12, in which the instructions cause the machine to divide the first compressed data block into sub-blocks of the first compressed data.
[0089] Example 17 includes the computer-readable storage medium of example 16, wherein the sub-blocks of the first compressed data are non-uniform in size.
[0090] Example 18 includes the computer-readable storage medium of example 16, in which the instructions cause the machine to pad the sub-blocks with the pattern by appending the pattern to the sub-blocks.
[0091] Example 19 includes the computer-readable storage medium of example 12, wherein the data blocks are uniform in size.
[0092] Example 20 includes the computer-readable storage medium of example 12, in which the instructions cause the machine to perform the first compression technique and the second compression technique in parallel for each block.
[0093] Example 21 includes the computer-readable storage medium of example 12, in which the instructions cause the machine to discard the first compressed data block and retain the uncompressed data block if the selected first compression technique results in more data than no compression technique.
[0094] Example 22 includes the computer-readable storage medium of example 20, wherein the first header identifies no compression technique.
[0095] Example 23 includes a method that includes dividing a data set into a plurality of data blocks; selecting a first compression technique for a first block of the plurality of data blocks based on a first characteristic of the first block; selecting a second compression technique for a second block of the plurality of data blocks based on a second characteristic of the second block; compressing the first block using the first compression technique to generate a first compressed data block; compressing the second block using the second compression technique to generate a second compressed data block; generating a first header identifying the first compression technique and a second header identifying the second compression technique; and storing the first compressed data block with the first header and the second compressed data block with the second header in a chip memory.
[0096] Example 24 includes the method of example 23, wherein the first compression technique is selected when the data of the block corresponds to the same value, and the second compression technique is selected when the data of the block includes at least one different value.
[0097] Example 25 includes the apparatus of example 23, in which the first compression technique is at least one of a Huffman compression technique, an RLE compression technique, or no compression technique.
[0098] Example 26 includes the apparatus of example 25, wherein the first compression technique is selected over no compression technique if the Huffman compression technique results in more data than no compression technique.
[0099] Example 27 includes the apparatus of example 23, further including dividing the first compressed data block into sub-blocks of the first compressed data.
[0100] Example 28 includes the apparatus of example 27, wherein the sub-blocks of the first compressed data are non-uniform in size.
[0101] Example 29 includes the apparatus of example 27, further including padding the sub-blocks with the pattern by adding the pattern to the sub-blocks.
[0102] Example 30 includes the apparatus of example 23, in which the data blocks are uniform in size.
[0103] Example 31 includes the apparatus of example 23, wherein the first compression technique and the second compression technique are performed in parallel on each block.
[0104] Example 32 includes the apparatus of example 23, further including discarding the first compressed data block and retaining the uncompressed data block if the selected first compression technique results in more data than without the compression technique.
[0105] Example 33 includes the apparatus of example 32, wherein the first header specifies no compression technique.
[0106] Example 34 is an exemplary computer-readable storage medium including first instructions that, when executed, cause at least a machine to perform at least one of distributing, configuring, assembling, installing, instantiating, retrieving, decompressing, and decoding second instructions for execution; and second instructions that, when executed, cause at least the machine to divide a data set into a plurality of data blocks, select a first compression technique for a first block of the plurality of data blocks based on a first characteristic of the first block, select a second compression technique for a second block of the plurality of data blocks based on a second characteristic of the second block, compress the first block using the first compression technique to generate a first compressed data block, compress the second block using the second compression technique to generate a second compressed data block, generate a first header identifying the first compression technique and a second header identifying the second compression technique, and store the first compressed data block with the first header and the second compressed data block with the second header in a chip memory.
[0107] Example 35 includes the computer-readable storage medium of example 34, wherein the instructions cause the machine to select the first compression technique if the data in the block corresponds to a same value and to select the second compression technique if the data in the block includes at least one distinct value.
[0108] Example 36 includes the computer-readable storage medium of example 34, wherein the first compression technique is at least one of a Huffman compression technique, an RLE compression technique, or no compression technique.
[0109] Example 37 includes the computer-readable storage medium of example 36, in which the instructions cause the machine to select the first compression technique over no compression technique if the Huffman compression technique results in more data than no compression technique.
[0110] Example 38 includes the computer-readable storage medium of example 34, in which the instructions cause the machine to divide the first compressed data block into sub-blocks of the first compressed data.
[0111] Example 39 includes the computer-readable storage medium of example 38, wherein the sub-blocks of the first compressed data are non-uniform in size.
[0112] Example 40 includes the computer-readable storage medium of example 38, in which the instructions cause the machine to pad the sub-blocks with the pattern by appending the pattern to the sub-blocks.
[0113] Example 41 includes the computer-readable storage medium of example 34, wherein the data blocks are uniform in size.
[0114] Example 42 includes the computer-readable storage medium of example 34, in which the instructions cause the machine to perform the first compression technique and the second compression technique in parallel for each block.
[0115] Example 43 includes the computer-readable storage medium of example 34, in which the instructions cause the machine to discard the first compressed data block and retain the uncompressed data block if the selected first compression technique results in more data than no compression technique.
[0116] Example 44 includes the computer-readable storage medium of example 42, wherein the first header identifies no compression technique.
[0117] From the foregoing, it will be appreciated that exemplary methods, apparatus, and articles of manufacture are disclosed that compress data stored in off-chip memory before being transmitted to an on-chip neural network and / or hardware accelerator. The disclosed methods, apparatus, and articles of manufacture improve the efficiency of computing devices by facilitating the utilization of off-chip memory with an on-chip neural network and / or hardware accelerator, thereby increasing memory capacity. Using the examples disclosed herein, users can tailor the compression scheme to a particular application data profile to achieve higher compression ratios. By compressing data before transferring it from off-chip components to on-chip components, the embodiments disclosed herein prevent or otherwise reduce the bottleneck effect of transmitting data without compression. Additionally, by dividing the data into blocks and / or sub-blocks of data, the embodiments disclosed herein facilitate parallel decoding of data using on-chip components, thereby increasing the processing bandwidth of the on-chip components. Using some of the example Huffman encoding schemes disclosed herein reduces the requirements for Huffman encoding lookup tables to be compatible with hardware memory limitations and speed requirements. Thus, the disclosed methods, apparatus, and articles of manufacture are directed to one or more improvements in the functionality of a computer.
[0118] Although certain example methods, apparatus, and articles of manufacture are disclosed herein, the scope of coverage of this patent is not limited thereto. Rather, this patent covers all methods, apparatus, and articles of manufacture that fall within the scope of the claims of this patent.
Claims
1. A memory; a data slicer that splits the dataset into multiple blocks of data; 1. A data processor comprising: determining whether said blocks of data correspond to the same value; a first compressor for compressing the block using a first compression technique to generate a first compressed data block in response to determining that the data in the block correspond to the same value; a second compressor, in response to determining that the data in the block do not correspond to the same value, compressing the block using a second compression technique to generate a second compressed data block, the second compressor discarding the second compressed data block and retaining the data in the block if the second compressed data block results in more data than without the compression technique; a header generator that generates a first header that identifies the first compression technique and, depending on whether the second compressed data block has been discarded, generates a second header that identifies the second compression technique or no compression technique; and an interface for transmitting data of the first compressed data block with the first header and the second compressed data block with the second header or the block with the second header, which are stored in the memory.
2. 2. The apparatus of claim 1, wherein the first compression technique is an RLE compression technique and the second compression technique is a Huffman compression technique.
3. 2. The apparatus of claim 1, wherein the second compressor divides the second compressed data block into sub-blocks of second compressed data.
4. The apparatus of claim 3 , wherein the sub-blocks of second compressed data are non-uniform in size.
5. The apparatus of claim 3 , further comprising one or more padders that pad the sub-blocks with a pattern by adding the pattern to the sub-blocks.
6. The apparatus of claim 1 , wherein the blocks are uniform in size.
7. 2. The apparatus of claim 1, wherein the first compressor and the second compressor perform the first compression technique and the second compression technique in parallel on respective blocks.
8. When executed, at least to the machine, Split the dataset into multiple blocks of data, determining whether said blocks of data correspond to the same value; in response to determining that the data in the block correspond to the same value, compressing the block using a first compression technique to generate a first compressed data block; in response to determining that the data in the block do not correspond to the same value, compressing the block using a second compression technique to generate a second compressed data block, and if the second compressed data block results in more data than without the compression technique, discarding the second compressed data block and retaining the data in the block; generating a first header identifying the first compression technique and, depending on whether the second compressed data block is discarded, generating a second header identifying the second compression technique or no compression technique; storing the first compressed data block with the first header and the second compressed data block with the second header or the data of the block with the second header in a memory; A program containing instructions to cause something to happen.
9. 9. The program of claim 8, wherein the first compression technique is an RLE compression technique and the second compression technique is a Huffman compression technique.
10. 9. The program of claim 8, wherein the instructions cause the machine to divide the second compressed data block into sub-blocks of second compressed data.
11. The program of claim 10 , wherein the sub-blocks of the second compressed data are non-uniform in size.
12. 11. The program of claim 10, wherein the instructions cause the machine to pad the sub-block with a pattern by appending the pattern to the sub-block.
13. The program of claim 8 , wherein the blocks are uniform in size.
14. 9. The program of claim 8, wherein the instructions cause the machine to perform the first compression technique and the second compression technique in parallel on respective blocks.
15. Dividing the data set into multiple blocks of data; determining whether said blocks of data correspond to the same value; in response to determining that the data in the block corresponds to the same value, compressing the block using a first compression technique to generate a first compressed data block; in response to determining that the data in the block do not correspond to the same value, compressing the block using a second compression technique to generate a second compressed data block, where if the second compressed data block results in more data than without the compression technique, discarding the second compressed data block and retaining the data in the block; generating a first header identifying the first compression technique and, depending on whether the second compressed data block has been discarded, generating a second header identifying the second compression technique or no compression technique; storing in a memory the first compressed data block with the first header and the second compressed data block with the second header or the data of the block with the second header.
16. 16. The method of claim 15, wherein the first compression technique is an RLE compression technique and the second compression technique is a Huffman compression technique.
17. 16. The method of claim 15, further comprising dividing the second compressed data block into sub-blocks of second compressed data.
18. The method of claim 17 , wherein the sub-blocks of the second compressed data are non-uniform in size.
19. 20. The method of claim 17, further comprising padding the sub-block with a pattern by adding the pattern to the sub-block.
20. The method of claim 15 , wherein the blocks are uniform in size.
21. The method of claim 15 , wherein the first compression technique and the second compression technique are performed in parallel on each block.
Citation Information
Patent Citations
Data transmitter
JP1993344162A
Variable-length decoder
JP1995212242A
Data storage device and data reader
JP1996107360A
Disk storage system
JP1998232838A
Data compressing method with pre-processing and extending method of compressed data
JP1999284518A
