Compression techniques
Methods and apparatus relating to techniques for data compression. In an example, an apparatus comprises a processor receive a data compression instruction for a memory segment; and in response to the data compression instruction, compress a sequence of identical memory values in response to a determination that the sequence of identical memory values has a length which exceeds a threshold. Other embodiments are also disclosed and claimed.
1. A general-purpose graphics processing device comprising:
a general-purpose graphics processing compute block comprising a plurality of processing resources;
a computer-readable memory communicatively coupled to the plurality of processing resources;
a memory interface communicatively coupled to the computer-readable memory to generate memory access requests to the computer-readable memory; and
a data compression device communicatively coupled to the computer-readable memory, the data compression unit comprising a hardware processor to:
receive a data compression instruction for a memory segment of the computer-readable memory; and
in response to the data compression instruction, compress a sequence of identical memory values in response to a determination that the sequence of identical memory values has a length which exceeds a threshold, wherein the threshold varies as a function of a size of a layer of neural networking model to which the data applies.
2. The general-purpose graphics processing device of claim 1 , wherein the threshold is set dynamically in response to operating conditions of the apparatus.
3. The general-purpose graphics processing device of claim 2 , the processor to:
replace the sequence of identical memory values with a single instance of a memory value and a metadata tag identifying the length of the sequence to generate a compressed data sequence.
4. The general-purpose graphics processing device of claim 3 , the processor to:
store the metadata tag adjacent the single instance of the memory value.
5. The general-purpose graphics processing device of claim 4 , the processor to:
receive a data decompression instruction directed to the memory segment; and
in response to the data decompression instruction, replace the single instance of the memory value with a sequence of identical memory values having a length equal to the length specified in the metadata tag.
6. The general-purpose graphics processing device of claim 5 , the processor to:
receive, from a requestor, a read operation directed to the memory segment; and
in response to the read operation, transmit the compressed data sequence to the requestor.
7. A processor-implemented method comprising:
providing:
a general-purpose graphics processing compute block comprising a plurality of processing resources;
a computer-readable memory communicatively coupled to the plurality of processing resources;
a memory interface communicatively coupled to the computer-readable memory to generate memory access requests to the computer-readable memory; and
a data compression device communicatively coupled to the computer-readable memory, the data compression unit comprising a hardware processor to perform operations comprising:
receiving a data compression instruction for a memory segment of the computer-readable memory; and
in response to the data compression instruction, compressing a sequence of identical memory values in response to a determination that the sequence of identical memory values has a length which exceeds a threshold, wherein the threshold varies as a function of a size of a layer of neural networking model to which the data applies.
8. The method of claim 7 , wherein the threshold is set dynamically in response to operating conditions of the apparatus.
9. The method of claim 8 , further comprising:
replacing the sequence of identical memory values with a single instance of a memory value and a metadata tag identifying the length of the sequence to generate a compressed data sequence.
10. The method of claim 9 , further comprising:
storing the metadata tag adjacent the single instance of the memory value.
11. The method of claim 10 , further comprising:
receiving a data decompression instruction directed to the memory segment; and
in response to the data decompression instruction, replacing the single instance of the memory value with a sequence of identical memory values having a length equal to the length specified in the metadata tag.
12. The method of claim 11 , further comprising:
receive, from a requestor, a read operation directed to the memory segment; and
in response to the read operation, transmit the compressed data sequence to the requestor.
13. A non-transitory computer-readable medium comprising one or more instructions that when executed on at least one processor configure the at least one processor to:
provide:
a general-purpose graphics processing compute block comprising a plurality of processing resources;
a computer-readable memory communicatively coupled to the plurality of processing resources;
a memory interface communicatively coupled to the computer-readable memory to generate memory access requests to the computer-readable memory; and
a data compression device communicatively coupled to the computer-readable memory, the data compression unit comprising a hardware processor to:
receive a data compression instruction for a memory segment of the computer-readable memory; and
in response to the data compression instruction, compress a sequence of identical memory values in response to a determination that the sequence of identical memory values has a length which exceeds a threshold, wherein the threshold varies as a function of a size of a layer of neural networking model to which the data applies.
14. The computer-readable medium of claim 13 , wherein the threshold is set dynamically in response to operating conditions of the apparatus.
15. The computer-readable medium of claim 14 , further comprising one or more instructions that when executed on at least one processor configure the at least one processor to:
replace the sequence of identical memory values with a single instance of a memory value and a metadata tag identifying the length of the sequence to generate a compressed data sequence.
16. The computer-readable medium of claim 15 , further comprising one or more instructions that when executed on at least one processor configure the at least one processor to:
store the metadata tag adjacent the single instance of the memory value.
17. The computer-readable medium of claim 16 , further comprising one or more instructions that when executed on at least one processor configure the at least one processor to:
receive a data decompression instruction directed to the memory segment; and
in response to the data decompression instruction, replace the single instance of the memory value with a sequence of identical memory values having a length equal to the length specified in the metadata tag.
18. The computer-readable medium of claim 17 , further comprising one or more instructions that when executed on at least one processor configure the at least one processor to:
receive, from a requestor, a read operation directed to the memory segment; and
in response to the read operation, transmit the compressed data sequence to the requestor.