Download Hybrid Static/Dynamic Activity Analysis*
Transcript
Normalized Execution Time 2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 No Activity Check Pure Dynamic (1.39) May w/o Dyn (0.79) May w/Dyn (0.98) MustMay w/Dyn (0.95) BMINSURF DAER DATR DCHQ DEDF DODC DSFD DSSC Fig. 5. Fortran results for a variety of static and/or dynamic activity analyses. May and Must-May are static analyses and Dyn indicates dynamic activity analysis. Arithmetic means are indicated within parentheses. static/dynamic activity analysis may reduce the overhead of dynamic activity checking. Since we are concentrating on forward mode AD, a must-useful vs. may-useful analysis is not exploitable. Using OpenAnalysis, we implemented the must-may activity analysis. We designed a new set of sax routines that would skip the check of the activity flag on the known must-may-active gradients. To avoid any extra checking in this regard, we re-order the arguments to the sax calls to identify by position the gradients that need to be dynamically checked and those that do not. We manually adjusted the sax calls in each benchmark’s derivative code to comply with the new interface. Then we used the must-may activity results to re-order the arguments. We anticipate that this must-may activity analysis will become an option in OpenAD, generating calls under the new interface and automatically re-arranging the arguments. 5.2 Results In Figure 5 we display the results of our hybrid static/dynamic activity analysis. All data has been normalized to the execution time of No Activity Check. The arithmetic mean per analysis run is noted in parentheses within the legend. The second bar represents Pure Dynamic activity analysis and visually shows the significant overhead (39% average) of dynamic activity checking. The third bar represents the static May activity analysis with no dynamic activity analysis and shows the advantage of pruning the derivative code at inactive variables with an average speedup of 21%. The fourth bar represents the hybrid combination of the static may activity analysis with dynamic activity analysis. In most benchmarks, the win from the static may analysis more than compensates for the overhead of dynamic checking. The fifth bar represents the hybrid combination of the static Must-May activity analysis with dynamic activity analysis. Three of the benchmarks show a decrease in execution time by using must-may activity analysis rather than may activity analysis. We anticipate that as we reduce the implementation overhead of our hybrid accumulation routines and examine complex applications where more variables can be statically identified as must-active, the benefits of our hybrid strategy will become more apparent.