Embodiments generally relate to artificial intelligence (AI) computing architectures. More particularly, embodiments relate to sparse index generators in AI computing architectures.
Deep neural networks (DNNs) typically have heavy computational requirements/demand. Accordingly, recent developments in DNNs have focused on using pruning and/or quantization techniques to reduce computational requirements, wherein these techniques tend to introduce sparsity (e.g., a large percentage of zeros) in the data to be processed. Conventional solutions may rely on compression of the data into a dense format for storage and the use of non-zero element indices to decompress the data for processing. Solutions that store the non-zero element indices tend to increase memory requirements.
The various advantages of the embodiments will become apparent to one skilled in the art by reading the following specification and appended claims, and by referencing the following drawings, in which:
With continuing reference to
Storing the vector output 32 (e.g., the indices of non-zero elements) grows with the increase in non-zero elements. This increase can occupy a significant portion of memory in the case of larger networks. Accordingly, embodiments bypass storage of the vector output 32 and the offset. Additionally, the generation of the vector output 32 and the offset is relatively fast (e.g., on a per bitmask iteration basis in a single cycle) without incurring a high penalty of area, which in turn avoids underutilization of resources.
Turning now to
For example,
For example, a data structure 64 for a proof of concept (POC) vector may include two parallel vectors (“Mask0” and “Mask1”) for a bitmask of 10110110 to be processed (e.g., after performing an AND operation between bitmasks A and B). In the illustrated example, Mask0 signals a first non-zero position 68 in the bitmask and Mask1 signals a second non-zero position 70 in the bitmask. As best shown in
Turning now to
The bitmask decoder 84 can generate indices of all non-zero elements in the bitmask 80 without storing the indices in the memory 82. For compression, the sparse data is encoded into a bitmask value 88 (e.g., dense bitmask) representing one bit per element of the bitmask 80, wherein the bitmask value 88 is stored in the memory 82 along with the non-zero elements. For decompression of sparse data, the bitmask value 88 may be divided/partitioned into multiple segments, with the segments being decoded in parallel and the indices of each segment being combined using shift operations. The division of the bitmask value 88 provides a flexibility to scale the hardware for any vector size. In one example, decoding of the bitmask value 88 is achieved using a chained multiplexer (mux) structure along with bit wise addition operations. The final output provides a vector (e.g., vector output) with all indices of non-zero elements and an offset to indicate where the indices start in the array. Accordingly, the number of indices can be read from the vector output vector and used based on the compute requirement.
More particularly, elements of vector A have non-zero elements A0, A1, A2 and A3 at locations 0, 1, 2 and 7 of the vector, respectively. Similarly, for vector B non-zero elements B0, B1, B2 and B3 are at locations 1, 2, 5 and 7 of the vector, respectively. To determine the match between the two operands that will contribute to the outcome, the two operand are AND′ ed together to generate the bitmask 80. The non-zero count hardware 84a counts the number of ones in the bitmask 80 for processing. These values are passed to the sparse index generator 84b to obtain the valid index 86 values of A and B that will contribute to the final outcome.
In general, the illustrated solution enables hardware to scale depending on how many non-zero elements are involved based on available compute resources, without increasing latency. The illustrated solution also does not incur any additional memory storage costs and provides a faster solution compared to CSR and CSC, without storing the non-zero indices in the memory 82. The illustrated solution also solves the underutilization issues caused due to slower index generation (e.g., two index generation/cycle case), direct indexing and step indexing solutions with low latency advantages. Additionally, the illustrated solution does not depend on the number of non-zero elements in the bitmask 80. Rather, the solution involves overall two adder structures and a mux chain to obtain indices of all non-zero elements in the bitmask 80. In an embodiment, this hardware requires a minimal increase in synthesis gates.
Non-zero count hardware 90a uses a plurality of adders 98 to add all ones (zeros) and determine the number of zeros in the bitmask. This number of zeros acts as an offset 94 to start reading non-zero indices in the vector output 92 generated by the sparse index generator 90b.
Computer program code to carry out operations shown in the method 110 can be written in any combination of one or more programming languages, including an object oriented programming language such as JAVA, SMALLTALK, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. Additionally, logic instructions might include assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, state-setting data, configuration data for integrated circuitry, state information that personalizes electronic circuitry and/or other structural components that are native to hardware (e.g., host processor, central processing unit/CPU, microcontroller, etc.).
Illustrated processing block 112 provides for generating a vector output based on a bitmask, wherein the vector output includes non-zero bit indices in a first portion of the vector output, and wherein the non-zero bit indices correspond to non-zero values in the bitmask. In one example, the vector output further includes zeros in a second portion of the vector output. Moreover, block 112 may generate the vector output via a multiplexer chain. Block 114 generates an offset based on the bitmask, wherein the offset indicates a start position in the vector output for the non-zero bit indices. In an embodiment, block 114 includes counting a number of zeros in the bitmask. Moreover, block 114 may generate the offset via a plurality of adders. In one example, the method 110 generates the vector output and the offset on a per bitmask iteration basis. Additionally, the method 110 may bypass a storage of the vector output and the offset.
The method 110 therefore enhances performance at least to the extent that the vector output and the offset identify non-zero elements with minimum latency. The method 110 also enhances performance by reducing memory usage/area, improving compute resource utilization and/or decreasing power consumption.
Illustrated processing block 122 provides for partitioning the bitmask into a plurality of segments. Block 124 generates the vector output and the offset in parallel for the plurality of segments to obtain a plurality of vector outputs. In an embodiment, block 126 combines the plurality of vector outputs into a final vector output, wherein the final vector output includes non-zero bit indices in a first portion of the final vector output. In the illustrated example, the non-zero bit indices in the first portion of the final vector output correspond to the non-zero values in the bitmask.
Turning now to
In the illustrated example, the system 280 includes a host processor 282 (e.g., CPU) having an integrated memory controller (IMC) 284 that is coupled to a system memory 286 (e.g., dual inline memory module/DIMM). In an embodiment, an IO (input/output) module 288 is coupled to the host processor 282. The illustrated IO module 288 communicates with, for example, a display 290 (e.g., touch screen, liquid crystal display/LCD, light emitting diode/LED display), mass storage 302 (e.g., hard disk drive/HDD, optical disc, solid state drive/SSD) and a network controller 292 (e.g., wired and/or wireless). The host processor 282 may be combined with the IO module 288, a graphics processor 294, and an AI accelerator 296 into a system on chip (SoC) 298.
In an embodiment, the AI accelerator 296 includes logic 300 to perform one or more aspects of the method 110 (
The logic 354 may be implemented at least partly in configurable or fixed-functionality hardware. In one example, the logic 354 includes transistor channel regions that are positioned (e.g., embedded) within the substrate(s) 352. Thus, the interface between the logic 354 and the substrate(s) 352 may not be an abrupt junction. The logic 354 may also be considered to include an epitaxial layer that is grown on an initial wafer of the substrate(s) 352.
The processor core 400 is shown including execution logic 450 having a set of execution units 455-1 through 455-N. Some embodiments may include a number of execution units dedicated to specific functions or sets of functions. Other embodiments may include only one execution unit or one execution unit that can perform a particular function. The illustrated execution logic 450 performs the operations specified by code instructions.
After completion of execution of the operations specified by the code instructions, back end logic 460 retires the instructions of the code 413. In one embodiment, the processor core 400 allows out of order execution but requires in order retirement of instructions. Retirement logic 465 may take a variety of forms as known to those of skill in the art (e.g., re-order buffers or the like). In this manner, the processor core 400 is transformed during execution of the code 413, at least in terms of the output generated by the decoder, the hardware registers and tables utilized by the register renaming logic 425, and any registers (not shown) modified by the execution logic 450.
Although not illustrated in
Referring now to
The system 1000 is illustrated as a point-to-point interconnect system, wherein the first processing element 1070 and the second processing element 1080 are coupled via a point-to-point interconnect 1050. It should be understood that any or all of the interconnects illustrated in
As shown in
Each processing element 1070, 1080 may include at least one shared cache 1896a, 1896b. The shared cache 1896a, 1896b may store data (e.g., instructions) that are utilized by one or more components of the processor, such as the cores 1074a, 1074b and 1084a, 1084b, respectively. For example, the shared cache 1896a, 1896b may locally cache data stored in a memory 1032, 1034 for faster access by components of the processor. In one or more embodiments, the shared cache 1896a, 1896b may include one or more mid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, a last level cache (LLC), and/or combinations thereof.
While shown with only two processing elements 1070, 1080, it is to be understood that the scope of the embodiments are not so limited. In other embodiments, one or more additional processing elements may be present in a given processor. Alternatively, one or more of processing elements 1070, 1080 may be an element other than a processor, such as an accelerator or a field programmable gate array. For example, additional processing element(s) may include additional processors(s) that are the same as a first processor 1070, additional processor(s) that are heterogeneous or asymmetric to processor a first processor 1070, accelerators (such as, e.g., graphics accelerators or digital signal processing (DSP) units), field programmable gate arrays, or any other processing element. There can be a variety of differences between the processing elements 1070, 1080 in terms of a spectrum of metrics of merit including architectural, micro architectural, thermal, power consumption characteristics, and the like. These differences may effectively manifest themselves as asymmetry and heterogeneity amongst the processing elements 1070, 1080. For at least one embodiment, the various processing elements 1070, 1080 may reside in the same die package.
The first processing element 1070 may further include memory controller logic (MC) 1072 and point-to-point (P-P) interfaces 1076 and 1078. Similarly, the second processing element 1080 may include a MC 1082 and P-P interfaces 1086 and 1088. As shown in
The first processing element 1070 and the second processing element 1080 may be coupled to an I/O subsystem 1090 via P-P interconnects 10761086, respectively. As shown in
In turn, I/O subsystem 1090 may be coupled to a first bus 1016 via an interface 1096. In one embodiment, the first bus 1016 may be a Peripheral Component Interconnect (PCI) bus, or a bus such as a PCI Express bus or another third generation I/O interconnect bus, although the scope of the embodiments are not so limited.
As shown in
Note that other embodiments are contemplated. For example, instead of the point-to-point architecture of
Example 1 includes a performance-enhanced computing system comprising a converter to generate a bitmask and an index generator coupled to the converter, wherein the index generator includes logic coupled to one or more substrates, the logic to generate a vector output based on the bitmask, wherein the vector output includes non-zero bit indices in a first portion of the vector output, and wherein the non-zero bit indices correspond to non-zero values in the bitmask, and generate an offset based on the bitmask, wherein the offset indicates a start position in the vector output for the non-zero bit indices, and a plurality of processing elements to operate on a plurality of input vectors based on the vector output and the offset.
Example 2 includes the computing system of Example 1, wherein the logic is further to partition the bitmask into a plurality of segments, generate the vector output and the offset in parallel for the plurality of segments to obtain a plurality of vector outputs, and combine the plurality of vector outputs into a final vector output, wherein the final vector output includes non-zero bit indices in a first portion of the final vector output, and wherein the non-zero bit indices in the first portion of the final vector output correspond to the non-zero values in the bitmask.
Example 3 includes the computing system of Example 1, wherein the vector output further includes zeros in a second portion of the vector output.
Example 4 includes the computing system of Example 1, wherein the logic includes a multiplexer chain to generate the vector output.
Example 5 includes the computing system of Example 1, wherein to generate the offset, the logic is to count a number of zeros in the bitmask.
Example 6 includes the computing system of Example 1, wherein the logic includes a plurality of adders to generate the offset.
Example 7 includes the computing system of Example 1, wherein the vector output and the offset are to be generated on a per bitmask iteration basis.
Example 8 includes the computing system of any one of Examples 1 to 7, wherein the logic is further to bypass a storage of the vector output and the offset.
Example 9 includes a semiconductor apparatus comprising one or more substrates, and logic coupled to the one or more substrates, wherein the logic is implemented at least partly in one or more of configurable or fixed-functionality hardware, the logic to generate a vector output based on a bitmask, wherein the vector output includes non-zero bit indices in a first portion of the vector output, and wherein the non-zero bit indices correspond to non-zero values in the bitmask, and generate an offset based on the bitmask, wherein the offset indicates a start position in the vector output for the non-zero bit indices.
Example 10 includes the semiconductor apparatus of Example 9, wherein the logic is further to partition the bitmask into a plurality of segments, generate the vector output and the offset in parallel for the plurality of segments to obtain a plurality of vector outputs, and combine the plurality of vector outputs into a final vector output, wherein the final vector output includes non-zero bit indices in a first portion of the final vector output, and wherein the non-zero bit indices in the first portion of the final vector output correspond to the non-zero values in the bitmask.
Example 11 includes the semiconductor apparatus of Example 9, wherein the vector output further includes zeros in a second portion of the vector output.
Example 12 includes the semiconductor apparatus of Example 9, wherein the logic includes a multiplexer chain to generate the vector output.
Example 13 includes the semiconductor apparatus of Example 9, wherein to generate the offset, the logic is to count a number of zeros in the bitmask.
Example 14 includes the semiconductor apparatus of Example 9, wherein the logic includes a plurality of adders to generate the offset.
Example 15 includes the semiconductor apparatus of Example 9, wherein the vector output and the offset are to be generated on a per bitmask iteration basis.
Example 16 includes the semiconductor apparatus of any one of Examples 9 to 15, wherein the logic is further to bypass a storage of the vector output and the offset.
Example 17 includes the semiconductor apparatus of any one of Examples 9 to 16, wherein the logic coupled to the one or more substrates includes transistor channel regions that are positioned within the one or more substrates.
Example 18 includes a method of operating a performance-enhanced computing system, the method comprising generating a vector output based on a bitmask, wherein the vector output includes non-zero bit indices in a first portion of the vector output, and wherein the non-zero bit indices correspond to non-zero values in the bitmask, and generating an offset based on the bitmask, wherein the offset indicates a start position in the vector output for the non-zero bit indices.
Example 19 includes the method of Example 18, further including partitioning the bitmask into a plurality of segments, generating the vector output and the offset in parallel for the plurality of segments to obtain a plurality of vector outputs, and combining the plurality of vector outputs into a final vector output, wherein the final vector output includes non-zero bit indices in a first portion of the final vector output, and wherein the non-zero bit indices in the first portion of the final vector output correspond to the non-zero values in the bitmask.
Example 20 includes the method of Example 18, wherein the vector output further includes zeros in a second portion of the vector output.
Example 21 includes the method of Example 18, wherein the vector output is generated via a multiplexer chain.
Example 22 includes the method of Example 18, wherein generating the offset includes counting a number of zeros in the bitmask.
Example 23 includes the method of Example 18, wherein the offset is generated via a plurality of adders.
Example 24 includes the method of Example 18, wherein the vector output and the offset are generated on a per bitmask iteration basis.
Example 25 includes the method of any one of Examples 18 to 24, further including bypassing a storage of the vector output and the offset.
Example 26 includes an apparatus comprising means for performing the method of any one of Examples 18 to 25.
The technology described herein therefore finds the indices of all non-zero elements for sparse DNN applications with minimum (e.g., single cycle) latency without storing the indices in the memory. The technology therefore also utilizes compute resources to the fullest extent. Further, this capability is achieved without encountering a negative impact in terms of performance, area and/or power.
Embodiments are applicable for use with all types of semiconductor integrated circuit (“IC”) chips. Examples of these IC chips include but are not limited to processors, controllers, chipset components, programmable logic arrays (PLAs), memory chips, network chips, systems on chip (SoCs), SSD/NAND controller ASICs, and the like. In addition, in some of the drawings, signal conductor lines are represented with lines. Some may be different, to indicate more constituent signal paths, have a number label, to indicate a number of constituent signal paths, and/or have arrows at one or more ends, to indicate primary information flow direction. This, however, should not be construed in a limiting manner. Rather, such added detail may be used in connection with one or more exemplary embodiments to facilitate easier understanding of a circuit. Any represented signal lines, whether or not having additional information, may actually comprise one or more signals that may travel in multiple directions and may be implemented with any suitable type of signal scheme, e.g., digital or analog lines implemented with differential pairs, optical fiber lines, and/or single-ended lines.
Example sizes/models/values/ranges may have been given, although embodiments are not limited to the same. As manufacturing techniques (e.g., photolithography) mature over time, it is expected that devices of smaller size could be manufactured. In addition, well known power/ground connections to IC chips and other components may or may not be shown within the figures, for simplicity of illustration and discussion, and so as not to obscure certain aspects of the embodiments. Further, arrangements may be shown in block diagram form in order to avoid obscuring embodiments, and also in view of the fact that specifics with respect to implementation of such block diagram arrangements are highly dependent upon the computing system within which the embodiment is to be implemented, i.e., such specifics should be well within purview of one skilled in the art. Where specific details (e.g., circuits) are set forth in order to describe example embodiments, it should be apparent to one skilled in the art that embodiments can be practiced without, or with variation of, these specific details. The description is thus to be regarded as illustrative instead of limiting.
The term “coupled” may be used herein to refer to any type of relationship, direct or indirect, between the components in question, and may apply to electrical, mechanical, fluid, optical, electromagnetic, electromechanical or other connections. In addition, the terms “first”, “second”, etc. may be used herein only to facilitate discussion, and carry no particular temporal or chronological significance unless otherwise indicated.
As used in this application and in the claims, a list of items joined by the term “one or more of” may mean any combination of the listed terms. For example, the phrases “one or more of A, B or C” may mean A; B; C; A and B; A and C; B and C; or A, B and C.
Those skilled in the art will appreciate from the foregoing description that the broad techniques of the embodiments can be implemented in a variety of forms. Therefore, while the embodiments have been described in connection with particular examples thereof, the true scope of the embodiments should not be so limited since other modifications will become apparent to the skilled practitioner upon a study of the drawings, specification, and following claims.