簡易檢索 / 詳目顯示

研究生: 楊孟勳
Yang, Meng-Hsun
論文名稱: 應用社群偵測演算法之程式碼佈局最佳化
Code Layout Optimization Applying Community Detection Algorithm
指導教授: 李哲榮
Lee, Che-Rung
口試委員: 徐慰中
Hsu, Wei-Chung
鍾葉青
Chung, Yeh-Ching
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊系統與應用研究所
Institute of Information Systems and Applications
論文出版年: 2017
畢業學年度: 105
語文別: 英文
論文頁數: 28
中文關鍵詞: 社群偵測程式碼佈局指令區域性Louvain方法Pettis-Hansen
外文關鍵詞: Community Detection, Code Layout, Instruction Locality, Louvain method, Pettis-Hansen
相關次數: 點閱:2下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 由於處理器速度的成長與記憶體速度的成長差距持續擴大,指令快取(instruction cache)成了熱門的最佳化標的。程式碼佈局最佳化(code layout optimization)是一種優化區域性(locality)與減少快取失誤(cache miss)的優化技巧。過去已有些研究提出以函示為單位的程式碼佈局最佳化,大部分都延伸於 Pettis-Hansen 的方法。然而就我們所知,目前並沒有應用社群偵測於程式碼佈局最佳化的研究。
    在此篇論文中,我們將社群結構(community structure)的概念導入程式碼佈局最佳化分析。在我們的實驗中,我們的方法可以平均提升 10.69% 的效能,在最佳的測試中,效能提升高至 12.71%。相較於純粹應用 Pettis-Hansen 的方法,我們的平均效能提升多了 3.19%。此外,分析 LLVM 的呼叫圖來產生最佳化程式碼佈局的計算時間測試中,我們的方法約比 Pettis-Hansen 的方法快至 33 倍,如此一來可以讓程式碼佈局最佳化應用於當代大型系統軟體中更加可行。


    Due to the continuous growing of the gap between processor and memory speed, the instruction cache is a popular target for optimization. Code layout optimization is a technique to improve the locality and reduce the instruction cache miss. Numbers of previous research have worked on code layout optimization. Most of their approaches are based on Pettis-Hansen’s method while there is no attempt to use community detection techniques.
    In this thesis, we introduce the concept of community structure to optimize code layout and improve the locality. In our experiments, our approach can reach up to 12.71% of performance improvement rate over the baseline and 10.69% on average, which outperforms Pettis-Hansen’s method by 3.19%. Furthermore, the execution time of our approach to generate an optimal code layout from LLVM’s weighted call graph is 33 times faster than Pettis-Hansen’s method, which can make code layout optimization in modern large-scale system software more practical.

    Chapter 1 Introduction 6 Chapter 2 Background And Related Work 8 2.1 Code Layout Optimization 9 2.2 Community Detection 11 Chapter 3 Proposed Approach 15 3.1 Community Detecting 16 3.2 In-Community Procedure Reordering 16 Chapter 4 Evaluation 18 4.1 Exeperimental Environment 18 4.2 Evaluation on Layout Generation Time 19 4.2.1 Evaluation Datasets 20 4.2.2 Results 20 4.3 Evaluation on Performance Improvement 21 4.3.1 Evaluation Datasets 22 4.3.2 Results 22 Chapter 5 Conclusions and Future Work 25 REFERENCES 26

    [1] LLVM. Available: http://llvm.org/
    [2] QEMU. Available: http://www.qemu.org/
    [3] igraph. Available: http://igraph.org/
    [4] NetwrokX. Available: https://networkx.github.io/
    [5] SNAP. Available: http://snap.stanford.edu/
    [6] E. Petrank and D. Rawitz, “The Hardness of Cache Conscious
    Data Placement,” in Proceedings of the ACM Symposium on
    Principles of Programming Languages, 2002, pp. 101–112.
    [7] K. Pettis and R. C. Hansen, “Profile Guided Code Positioning,”
    in Proceedings of the ACM Conference on Programming Language
    Design and Implementation, 1990, pp. 16–27.
    [8] V.D. Blondel, J.-L. Guillaume, and R. Lambiotte, E. Lefebvre, “Fast Unfolding of Communities in Large Networks,” J. Stat. Mech. 2008, P10008
    [9] Hatfield and Gerald, “Program Restructuring for Virtual Memory,” IBM Systems Journal, Vol. 10, No. 3, 1971, pp. 168-192.
    [10] Ferrari, “Improving Locality by Critical Working Sets,” CACM, Vol. 17, No. 11, November 1974, pp. 614-620.
    [11] McFarling, ‘Program Optimization for Instruction Caches,” Third International Conference on Architectural Support for Programming Languages and Operating Systems, April 1989, pp. 183-191.
    [12] Hwu and Chang, “Achieving High Instruction Cache Performance with an Optimizing Compiler,” Proc. 16th Sym. on Computer Architecture, Jerusalem, Israel, May 1989, pp. 242-250.
    [13] N. Gloy, T. Blackwell, B. D. Smith, and B. Calder, “Procedure Placement Using Temporal Ordering Information,” Proceedings of the 30th Annual ACM/IEEE Intl. Symposiumon Microarchitecture, Dec. 1997, pp. 303-313
    [14] G. Ottoni and B. Maher, “Optimizing function placement for large-scale data-center applications,” 2017 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), Austin, TX, 2017, pp. 233-244.
    [15] Yuan Hao, “Profile Based Trace Selection of Code Layout Optimizations in Open64 Compiler,” M.S. thesis, CSIE, NTHU, Taiwan, R.O.C., 2008
    [16] R. V. Batchu and D. A. Jimenez, “Exploiting Procedure Level Locality to Reduce Instruction Cache Misses,” 8th Workshop on Interaction between Compilers and Computer Architectures, 2004. INTERACT-8 2004., 2004, pp. 75-84.
    [17] M. Girvan and M. E. J. Newman, “Community Structure in Social and Biological Networks,” in Proceedings of the National Academy of Sciences of the United States of America,Vol. 99, No. 12, pp. 7821-7826, 2002.
    [18] Clauset, Aaron, Mark EJ Newman, and Cristopher Moore, “Finding Community Structure in Very Large Networks,” Physical review E 70.6 (2004): 066111.
    [19] M. E. J. Newman and M. Girvan, “Finding and Evaluating Community Structure in Networks,” Phys. Rev. E 69, 026113, 2004.
    [20] J. Yang, J. McAuley, and J. Leskovec, “Detecting Cohesive and 2-mode Communities Indirected and Undirected Networks,” in Proceedings of the 7th ACM Intl. Conference on Web Search and Data Mining, ACM, 2014, pp. 323-332
    [21] Rosvall, Martin, and C. T. Bergstrom, “Maps of Random Walks on Complex Networks Reveal Community Structure,” in Proceedings of the National Academy of Sciences 105.4, 2008, pp. 1118-1123.
    [22] S. Gregory, “A Fast Algorithm to Find Overlapping Communities in Networks,” in Proceedings of Machine Learning and Knowledge Discovery in Databases, 2008, pp. 408-423.
    [23] X. Huang, B. T. Lewis, and K. S. McKinley, “Dynamic Code Management: Improving Whole Program Code Locality in Managed Runtimes,” in Proceedings of the 2nd Intl. Conference on Virtual Execution Environments, ACM, 2006, pp. 133-143.

    QR CODE