Embodiments generally relate to neural networks. More particularly, embodiments relate to a neural network based power and performance model for versatile processing units (VPUs).
A PnP (Power and Performance) model is a software component that predicts the performance (e.g., in terms of clock cycles) and power consumption (e.g., in milliWatts/mW) for a given neural network workload/layer. Conventional solutions to performing PnP predictions may encounter challenges in terms of complexity, scalability and/or stability.
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:
Technology described herein provides an innovative, data driven way of improving PnP prediction of workloads for VPUs (versatile processing units) that are integrated into SoCs (systems on chip).
Having an accurate PnP model is advantageous across the entire software stack, since model accuracy enables increased accuracy of pre-silicon network PnP KPI (key performance indicator) estimations and improved performance of neural networks on the device (e.g., providing the compiler scheduler with an accurate PnP model to correctly understand the consequences of scheduling decisions). An accurate PnP model also enables operating system (OS)-based dynamic voltage and frequency scaling (DVFS) optimization. For example, the cost model can be used to decide whether to throttle the VPU voltage and/or frequency to reduce dynamic power consumption. Additionally, an accurate PnP enables network architecture search (NAS) decisions to use machine learning to train a neural network topology alongside the weights of the neural network. Indeed, an accurate cost model in combination with NAS allows enables the creation of networks that are highly tailored and optimized for the VPU hardware.
Previous solutions to predicting power and performance may have used an equation-based solution such as, for example, ArchBench, to perform PnP predictions for KPI estimation. ArchBench is a tool that encodes the hardware performance into a set of simple equations. These equations can be used to estimate the performance of each workload/layer and summed in order to recover the entire network performance. Since ArchBench is not production-grade software, compiler and OS integration have previously not been possible.
Three main disadvantages to the previous equation-driven approach are:
Complexity:
This effect can be seen further in
Scalability:
Stability: It may also not be possible to leverage the existing PnP model in production directly, because of code compatibility (e.g., ArchBench is written in PYTHON, while the compiler/OS driver may require C++), scope (e.g., ArchBench is mostly a tool for early stage “what if” analysis) and performance estimation. Accordingly, the findings and knowledge that the engineers feed into this tool are not usable immediately by other individuals.
Technology described herein provides for “VPUNN” (Neural Network Based Power and Performance Model for VPUs), which is a data driven PnP model where a neural network is trained with real world performance data from the VPU to have higher accuracy than conventional solutions. The model is accurate, fast, straightforward to update from new workloads and can be used and deployed at all levels of the software stack.
The accuracy of performance prediction is much higher than previous solutions, providing realistically achievable targets for products at a much earlier stage than before. The major advantages (e.g., business impacts) of the technology described herein are enablement of high-confidence performance estimates for more networks in a pre-silicon timeframe, improving accuracy of (e.g., KPI estimates), and assistance in closing the gap between pre-silicon and post-silicon performance estimates. Other advantages of the technology include enablement of quick insights of the performance of new network topologies and enablement of advanced compiler schedule optimizations, which further increase the performance of neural networks. Indeed, the technology described herein enables optimizations in different areas such as, for example, optimizing power usage instead of performance and restricting power to within an allowed envelope.
Embodiments include a software library capable of predicting the PnP of individual workloads and layers of a network. The core of the library is a neural network that is trained from real world data profiled directly from the hardware or from RTL (register-transfer level) simulations.
Complexity
The algorithmic cost function 42 is much simpler than what is implanted in ArchBench and does not consider second order effects or nonlinearities. Additionally, the complexity and the nonlinear hardware behavior are trained from real HWP (hardware profiler) data into the weights of the neural network and does not require manual finetuning. Moreover, the PnP model can be inspected to understand details of the hardware behavior and examine shortcomings between theoretical calculations and actual results.
Scalability
Adding new workloads to the database is comparatively easier than having engineers fixing the cost model manually. In addition, the training process is fully automatic, with the neural network being trained, for example, nightly with the latest items profiled from the hardware.
Portability
The model 40 can be deployed and used by all tools/compilers/drivers at various levels of the stack. In one example, a neural network compiler targeting a VPU workload can use the model 40 and be immediately up to speed.
A second variant 62 is an accuracy optimized version in which the model generates a workload embedding/descriptor. An embedding is an N-dimensional vector that represents/maps the workload into an abstract embedding space. The embedding representation of a workload can be used to fetch and interpolate the closest items in the database using, for example, cosine similarity or L2 distance (e.g., calculated as the square root of the sum of squared vector values). This approach is more accurate, but the performance grows linearly with the size of the database. Accordingly, the second variant 62 may be better suited for KPI estimation and DVFS scenarios that have less stringent requirements in terms of prediction latency.
Computer program code to carry out operations shown in the method 70 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 71 provides for training a neural network based cost model based on one or more of hardware profile data or register-transfer level (RTL) data. Block 72 determines a complexity of a task associated with a neural network workload (e.g., VPU workload). A determination is made at block 74 as to whether the complexity of the task exceeds a threshold. If so, block 76 generates a hardware efficiency estimate for the task via the neural network based cost model. As already noted, the neural network based cost model may be accuracy optimized or latency optimized. When the neural network based cost model is accuracy optimized, the hardware efficiency estimate may include a vector that embeds the task into an abstract embedding space. In such a case, block 76 may also fetch a database entry based on the vector. When the neural network based cost model is latency optimized, the hardware efficiency estimate may include a hardware utilization prediction.
Block 78 may generate one or more system management decisions based on the hardware efficiency estimate. For example, if the neural network based cost model is accuracy optimized, block 78 might involve generating one or more of a DVFS decision (e.g., throttle decision) and/or a KPI decision (e.g., mean time to resolve/MTTR decision) based on the hardware efficiency estimate. If, on the other hand, the network based cost model is latency optimized, block 78 may generate a compiler decision (e.g., scheduling decision), a driver decision (e.g., component enablement/disablement decision) and/or an NAS decision (e.g., topology selection) based on the hardware efficiency estimate.
If it is determined at block 74 that the complexity of the task does not exceed the threshold, block 80 generates the hardware efficiency estimate via a cost function (e.g., theoretical/simple cost model). In an embodiment, the cost function generates the hardware efficiency estimate independently of second order effects and nonlinearities associated with the task. As already noted, block 78 may generate one or more system management decisions based on the hardware efficiency estimate. Block 82 determines whether a retraining of the neural network based cost model is appropriate (e.g., periodic retraining, switch between latency optimized and accuracy optimized, etc.). If so, the method 70 returns to block 71. Otherwise, the method 70 may return to block 72 for the next task in the neural network workload. The method 70 therefore enhances performance at least to the extent that the cost function reduces complexity for relatively simple tasks, the neural network based cost model improves scalability for more complex tasks and/or the hybrid model improves portability.
Results:
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/I-EDD, 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 artificial intelligence (AI) accelerator 296 into a system on chip (SoC) 298.
In an embodiment, the host processor 282 and/or the AI accelerator 296 executes a set of program instructions 300 retrieved from the mass storage 302 and/or the system memory 286 to perform one or more aspects of the method 70 (
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 network controller, a processor coupled to the network controller, and a memory coupled to the processor, the memory including a set of instructions, which when executed by the processor, cause the processor to determine a complexity of a task associated with a neural network workload and generate a hardware efficiency estimate for the task, wherein the hardware efficiency estimate is generated via a neural network if the complexity exceeds a threshold, and wherein the hardware efficiency estimate is generated via a cost function if the complexity does not exceed the threshold.
Example 2 includes the computing system of Example 1, wherein the instructions, when executed, further cause the processor to train the neural network based cost model based on one or more of hardware profile data or register-transfer level data.
Example 3 includes the computing system of any one of Examples 1 to 2, wherein the neural network based cost model is to be accuracy optimized, wherein the hardware efficiency estimate is to include a vector that embeds the task into an abstract embedding space, and wherein the instructions, when executed, further cause the processor to fetch a database entry based on the vector.
Example 4 includes the computing system of Example 3, wherein the instructions, when executed, further cause the processor to generate one or more of a dynamic voltage and frequency scaling decision or a key performance indicator decision based on the hardware efficiency estimate.
Example 5 includes the computing system of any one of Examples 1 to 2, wherein the neural network based cost model is to be latency optimized, wherein the hardware efficiency estimate is to include a hardware utilization prediction, and wherein the instructions, when executed, further cause the processor to generate one or more of a compiler decision, a driver decision or a network architecture search decision based on the hardware efficiency estimate.
Example 6 includes at least one computer readable storage medium comprising a set of instructions, which when executed by a computing system, cause the computing system to determine a complexity of a task associated with a neural network workload, and generate a hardware efficiency estimate for the task, wherein the hardware efficiency estimate is generated via a neural network based cost model if the complexity exceeds a threshold, and wherein the hardware efficiency estimate is generated via a cost function if the complexity does not exceed the threshold.
Example 7 includes the at least one computer readable storage medium of Example 6, wherein the instructions, when executed, further cause the computing system to train the neural network based cost model based on one or more of hardware profile data or register-transfer level data.
Example 8 includes the at least one computer readable storage medium of any one of Examples 6 to 7, wherein the neural network based cost model is to be accuracy optimized, wherein the hardware efficiency estimate is to include a vector that embeds the task into an abstract embedding space, and wherein the instructions, when executed, further cause the computing system to fetch a database entry based on the vector.
Example 9 includes the at least one computer readable storage medium of Example 8, wherein the instructions, when executed, further cause the computing system to generate one or more of a dynamic voltage and frequency scaling decision or a key performance indicator decision based on the hardware efficiency estimate.
Example 10 includes the at least one computer readable storage medium of any one of Examples 6 to 7, wherein the neural network based cost model is to be latency optimized, and wherein the hardware efficiency estimate is to include a hardware utilization prediction.
Example 11 includes the at least one computer readable storage medium of Example 10, wherein the instructions, when executed, further cause the computing system to generate one or more of a compiler decision, a driver decision or a network architecture search decision based on the hardware efficiency estimate.
Example 12 includes the at least one computer readable storage medium of Example 6, wherein the cost function is to generate the hardware efficiency estimate independently of second order effects and nonlinearities associated with the task.
Example 13 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 determine a complexity of a task associated with a neural network workload, and generate a hardware efficiency estimate for the task, wherein the hardware efficiency estimate is generated via a neural network based cost model if the complexity exceeds a threshold, and wherein the hardware efficiency estimate is generated via a cost function if the complexity does not exceed the threshold.
Example 14 includes the semiconductor apparatus of Example 13, wherein the logic is further to train the neural network based cost model based on one or more of hardware profile data or register-transfer level data.
Example 15 includes the semiconductor apparatus of any one of Examples 13 to 14, wherein the neural network based cost model is to be accuracy optimized, wherein the hardware efficiency estimate is to include a vector that embeds the task into an abstract embedding space, and wherein the logic is further to fetch a database entry based on the vector.
Example 16 includes the semiconductor apparatus of Example 15, wherein the logic is further to generate one or more of a dynamic voltage and frequency scaling decision or a key performance indicator decision based on the hardware efficiency estimate.
Example 17 includes the semiconductor apparatus of any one of Examples 13 to 14, wherein the neural network based cost model is to be latency optimized, and wherein the hardware efficiency estimate is to include a hardware utilization prediction.
Example 18 includes the semiconductor apparatus of Example 17, wherein the logic is further to generate one or more of a compiler decision, a driver decision or a network architecture search decision based on the hardware efficiency estimate.
Example 19 includes the semiconductor apparatus of Example 13, wherein the cost function is to generate the hardware efficiency estimate independently of second order effects and nonlinearities associated with the task.
Example 20 includes the semiconductor apparatus of Example 13, wherein the logic coupled to the one or more substrates includes transistor channel regions that are positioned within the one or more substrates.
Example 21 includes a method of operating a performance-enhanced computing system, the method comprising determining a complexity of a task associated with a neural network workload, and generating a hardware efficiency estimate for the task, wherein the hardware efficiency estimate is generated via a neural network based cost model if the complexity exceeds a threshold, and wherein the hardware efficiency estimate is generated via a cost function if the complexity does not exceed the threshold.
Example 22 includes the method of Example 21, further including training the neural network based cost model based on one or more of hardware profile data or register-transfer level data.
Example 23 includes the method of any one of Examples 21 to 22, wherein the neural network based cost model is accuracy optimized, and wherein the hardware efficiency estimate includes a vector that embeds the task into an abstract embedding space, the method further including fetching a database entry based on the vector.
Example 24 includes the method of Example 23, further including generating one or more of a dynamic voltage and frequency scaling decision or a key performance indicator decision based on the hardware efficiency estimate.
Example 25 includes the method of any one of Examples 21 to 22, wherein the neural network based cost model is latency optimized, and wherein the hardware efficiency estimate includes a hardware utilization prediction, the method further including generating one or more of a compiler decision, a driver decision or a network architecture search decision based on the hardware efficiency estimate.
Example 26 includes an apparatus comprising means for performing the method of any one of Examples 21 to 25.
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.
This patent application claims the benefit of priority to U.S. Provisional Patent Application No. 63/326,412, filed on Apr. 1, 2022.
Number | Date | Country | |
---|---|---|---|
63326412 | Apr 2022 | US |