Search

US-12625626-B2 - Adaptive compression for accelerator devices

US12625626B2US 12625626 B2US12625626 B2US 12625626B2US-12625626-B2

Abstract

An accelerator device may access an input data chunk to be compressed by the accelerator device. The accelerator device may access an entropy value for the input data chunk. The accelerator device may compress the input data chunk or return an indication that the input data chunk will not be compressed based on the entropy value and an entropy threshold.

Inventors

  • Fei Wang
  • John Browne
  • Laurent Coquerel

Assignees

  • INTEL CORPORATION

Dates

Publication Date
20260512
Application Date
20220715

Claims (20)

  1. 1 . An apparatus comprising: a processor; and an accelerator device, the accelerator device to comprise circuitry configured to: access an input data chunk to be compressed by the accelerator device; access an entropy value for the input data chunk; compress the input data chunk or return an indication that the input data chunk will not be compressed based on the entropy value and an entropy threshold; and generate a stored block for the input data chunk by inserting one or more headers into the input data chunk when the circuitry returns the indication that the input data chunk will not be compressed.
  2. 2 . The apparatus of claim 1 , wherein the circuitry to access the entropy value is to comprise one or more of: (i) circuitry to compute the entropy value based on the input data chunk, or (ii) circuitry to receive the entropy value from another source.
  3. 3 . The apparatus of claim 1 , wherein the entropy value is to be computed by the accelerator device based on a predetermined subset of bits of the input data chunk.
  4. 4 . The apparatus of claim 1 , wherein a size of the input data chunk is to be based on a size of a buffer of the accelerator device.
  5. 5 . The apparatus of claim 1 , wherein the input data chunk is a first input data chunk of a plurality of input data chunks received from an application, a virtual machine, or a microservice, wherein the circuitry of the accelerator device is to compress the first input data chunk based on the entropy value and the entropy threshold.
  6. 6 . The apparatus of claim 5 , the accelerator device to comprise circuitry configured to: compute an entropy value for a second input data chunk of the plurality of input data chunks; and generate a stored block for the second input data chunk based on the entropy value for the second input data chunk and the entropy threshold.
  7. 7 . The apparatus of claim 5 , the accelerator device to comprise circuitry configured to: receive a second input data chunk of the plurality of input data chunks; and compress the second input data chunk based on the compression of the first input data chunk.
  8. 8 . The apparatus of claim 7 , wherein an entropy value for the second input data chunk exceeds the entropy threshold, wherein the entropy value for the first input data chunk is less than the entropy threshold.
  9. 9 . The apparatus of claim 1 , wherein the input data chunk, an indication of a lossless compression format, and the entropy threshold are to be received from an application, a virtual machine, or a microservice via one or more application programming interface (API) calls to a microservice of the accelerator device.
  10. 10 . The apparatus of claim 9 , the accelerator device to comprise circuitry configured to: return, to the application, the virtual machine, or the microservice, a response to include one or more of: (i) an indication that the input data chunk was compressed, (ii) the indication that the input data chunk will not be compressed, or (iii) an indication that a stored block was generated based on the input data chunk.
  11. 11 . The apparatus of claim 1 , wherein the input data chunk is to comprise uncompressed data, wherein the circuitry returns the indication that the input data chunk will not be compressed.
  12. 12 . A method, comprising: accessing, by an accelerator device, an input data chunk to be compressed by the accelerator device; accessing, by the accelerator device, an entropy value for the input data chunk; compressing, by the accelerator device, the input data chunk or returning an indication that the input data chunk will not be compressed based on the entropy value and an entropy threshold; and generating, by the accelerator device, a stored block for the input data chunk by inserting one or more headers into the input data chunk when returning the indication that the input data chunk will not be compressed.
  13. 13 . The method of claim 12 , wherein accessing the entropy value comprises one or more of: (i) computing the entropy value by the accelerator device based on the input data chunk, or (ii) receiving, by the accelerator device, the entropy value from another source.
  14. 14 . The method of claim 12 , wherein the entropy value is computed by the accelerator based on a predetermined subset of bits of the input data chunk.
  15. 15 . The method of claim 12 , wherein a size of the input data chunk is based on a size of a buffer of the accelerator device.
  16. 16 . The method of claim 12 , wherein the input data chunk is a first input data chunk of a plurality of input data chunks received from an application, a virtual machine, or a microservice, wherein the first input data chunk is compressed by the accelerator device based on the entropy value and the entropy threshold.
  17. 17 . The method of claim 16 , further comprising: computing, by the accelerator device, an entropy value for a second input data chunk of the plurality of input data chunks; and generating, by the accelerator device, a stored block for the second input data chunk based on the entropy value for the second input data chunk and the entropy threshold.
  18. 18 . The method of claim 16 , further comprising: receiving, by the accelerator device, a second input data chunk of the plurality of input data chunks; and compressing, by the accelerator device, the second input data chunk based on the compression of the first input data chunk.
  19. 19 . The method of claim 18 , wherein an entropy value for the second input data chunk exceeds the entropy threshold, wherein the entropy value for the first input data chunk is less than the entropy threshold.
  20. 20 . The method of claim 12 , wherein the input data chunk, an indication of a lossless compression format, and the entropy threshold are received from an application, a virtual machine, or a microservice via one or more application programming interface (API) calls to a microservice of the accelerator device.

Description

BACKGROUND Often, data cannot be compressed in a manner that reduces the size of input data. However, conventional systems may use accelerator devices to compress data regardless of whether the output data is smaller than the input data. In such examples, the output data generated by the accelerator device may be larger than the input data. Doing so degrades system throughput and/or latency, as the accelerator has processed the data (even though the output is larger than the input). Further degradation to throughput and latency may occur as the output is sent to memory only to be returned to the accelerator device for further processing. BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS To easily identify the discussion of any particular element or act, the most significant digit or digits in a reference number refer to the figure number in which that element is first introduced. FIG. 1 illustrates an aspect of the subject matter in accordance with one embodiment. FIG. 2 illustrates an aspect of the subject matter in accordance with one embodiment. FIG. 3 illustrates an aspect of the subject matter in accordance with one embodiment. FIG. 4 illustrates a logic flow 400 in accordance with one embodiment. FIG. 5 illustrates a logic flow 500 in accordance with one embodiment. FIG. 6 illustrates an aspect of the subject matter in accordance with one embodiment. DETAILED DESCRIPTION Embodiments disclosed herein accelerate and achieve improved compression throughput and compression ratio performance for accelerator devices based on the entropy of data to be compressed by the accelerator devices. Generally, the accelerator device may receive a compression request including input data, a compression format, and an entropy threshold from an application. The compression format may be a lossless compression format. The accelerator device may compute an entropy value for the input data. The entropy value may be based on the entirety of the input data and/or a portion thereof. The accelerator device may compare the entropy value to the entropy threshold received from the application. If the entropy value exceeds the entropy threshold, the accelerator device may refrain from compressing the input data. In some embodiments, the accelerator may return an indication specifying that the input data will not be compressed (and can be accessed in its current memory location). In some embodiments, instead of compressing the input data, the accelerator device may generate stored blocks based on the input data and the compression format specified by the application and return the stored blocks to the application. The stored blocks (also referred to as “uncompressed blocks”) may include compression format specific blocks that contain a block header and the uncompressed data. If, however, the entropy value does not exceed the entropy threshold, the accelerator may compress the input data and return the compressed data to the application. In some embodiments, a size of the input data may exceed a size of a buffer of the accelerator device. In such embodiments, the buffer may be filled with respective portions (e.g., a data chunk) of the input data. In some such embodiments, the accelerator device may compute entropy values for the current data chunk in the buffer. The accelerator device may then compare each entropy value to the threshold. If the entropy value exceeds the threshold, the accelerator device may generate one or more stored blocks based on the data chunk. Otherwise, the accelerator device may compress the data chunk. In some embodiments, however, the accelerator device may compute an entropy value for the first data chunk, and compare the entropy value for the first data chunk to the entropy threshold. The accelerator device may compress the first data chunk or generate one or more stored blocks for the first data chunk based on the entropy value and the entropy threshold. However, the accelerator device may refrain from computing entropy values for subsequent data chunks of the input data. In such embodiments, the accelerator device performs the same operation that was performed on the first data chunk to the subsequent data chunks. Therefore, if the first data chunk is compressed, the subsequent data chunks may be compressed (even if entropy values for the subsequent blocks are greater than the threshold). Similarly, if the first data chunk is converted into stored blocks, the subsequent data chunks are converted to stored blocks (even if entropy values for the subsequent blocks are less than the threshold). Some compression formats, including lossless compression formats, may not compress data such that the output is smaller than the input (and/or such that the output is larger than the input). However, conventional systems compress data only to discover that the output is larger than the input. Advantageously, embodiments disclosed herein improve the performance of accelerator devices and/or associated computing