Skip to main content

Graph Mining and Machine Learning for Shader Codes Analysis to Accelerate GPU Tuning

  • Conference paper
  • First Online:
Complex Networks and Their Applications XI (COMPLEX NETWORKS 2016 2022)

Part of the book series: Studies in Computational Intelligence ((SCI,volume 1077))

Included in the following conference series:

  • 1662 Accesses

Abstract

The graphics processing unit (GPU) has become one of the most important computing technologies. Disassembly shader codes, which are machine-level codes, are important for GPU designers (e.g., AMD, Intel, NVIDIA) to tune the hardware, including customization of clock speeds and voltages. Due to many use-cases of modern GPUs, engineers generally find it difficult to manually inspect a large number of shader codes emerging from these applications. To this end, we develop a framework that converts shader codes into graphs, and employs sophisticated graph mining and machine learning techniques over a number of applications to simplify shader graphs analysis in an effective and explainable manner, aiming at accelerating the whole debugging process and improving the overall hardware performance. We study shader codes’ evolution via temporal graph analysis and structure mining with frequent subgraphs. Using them as the underlying tools, we conduct a frame’s scene detection and representative frames selection. We group the scenes (applications) to identify the representative scenes, and predict a new application’s inefficient shaders. We empirically demonstrate the effectiveness of our solution and discuss future directions.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 349.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 449.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 449.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Huang, S., Xiao, S., Feng, W.-c.: On the energy efficiency of graphics processing units for scientific computing. In: IPDPS (2009)

    Google Scholar 

  2. Owens, J.D., Houston, M., Luebke, D., Green, S., Stone, J.E., Phillips, J.C.: GPU computing. Proc. IEEE 96(5), 879–899 (2008)

    Article  Google Scholar 

  3. AMD.: How to Tune GPU Performance Using Radeon Software (n.d.). https://www.amd.com/en/support/kb/faq/dh2-020

  4. Foster, I., Kesselman, C., Nick, J., Tuecke, S.: The Physiology of the Grid: an Open Grid Services Architecture for Distributed Systems Integration. Technical Report, Global Grid Forum (2002)

    Google Scholar 

  5. Zandbergen, P.: Machine Code and High-level Languages: Using Interpreters and Compilers (2022). https://study.com/academy/lesson/machine-code-andhigh-level-languages-using-interpreters-and-compilers.html/

  6. Pipelines and Shaders with Direct3D 12 (2021). https://docs.microsoft.com/enus/windows/win32/direct3d12/pipelines-and-shaders-with-directx-12

  7. de La Lama, C.S., Jääskeläinen, P., Kultala, H., Takala, J.: Programmable and scalable architecture for graphics processing units. Trans. High Perform. Embed. Archit. Compil. 5(2019), 21–38 (2019)

    Google Scholar 

  8. Fam, S.T., Sowerby, A.: Shader Program Profiler (2015). https://patents.google.com/patent/US9799087B2

  9. Ren, X., Lis, M.: CHOPIN: scalable graphics rendering in multi-GPU systems via parallel image composition. In: IEEE International Symposium on High-Performance Computer Architecture, HPCA, pp. 709–722. IEEE (2021)

    Google Scholar 

  10. Zaidi, S.I., Fam, S.T., Lotfi, P., Indukuru, V.R., Pan, J., Sowerby, A.M., Duprat, J.-L.: Shader Profiler (2018)

    Google Scholar 

  11. Karlsson, B.: RenderDoc (2021). https://renderdoc.org/docs/index.html

  12. Gascon, H., Yamaguchi, F., Arp, D., Rieck, K.: Structural detection of android malware using embedded call graphs. In AISec (2013)

    Google Scholar 

  13. Alanazi, R., Gharibi, G., Lee, Y.: Facilitating program comprehension with call graph multilevel hierarchical abstractions. J. Syst. Softw. 176(2021), 110945 (2021)

    Article  Google Scholar 

  14. Tekin, U., Buzluca, F.: A graph mining approach for detecting identical design structures in object-oriented design models. Sci. Comput. Program. 95(2014), 406–425 (2014)

    Article  Google Scholar 

  15. Greenspector (2021). https://greenspector.com/en/home/

  16. Allamanis, M., Brockschmidt, M., Khademi, M.: Learning to represent programs with graphs. In: ICLR (2018)

    Google Scholar 

  17. Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: ICLR (2017)

    Google Scholar 

  18. Zhao, L., Khan, A., Luo, R.: Our Code and Datasets (2022). https://github.com/forest2022/graphForest

  19. Radeon\(^{{\rm TM}}\) GPU Analyzer (2021). https://gpuopen.com/rga/

  20. Leskovec, J., Rajaraman, A., Ullman, J.D.: Mining of Massive Datasets, 2nd edn. Cambridge University Press (2014)

    Google Scholar 

  21. Shervashidze, N., Schweitzer, P., Leeuwen, E.J.V., Mehlhorn, K., Borgwardt, K.M.: Weisfeiler-Lehman graph kernels. J. Mach. Learn. Res. 12(2011), 2539–2561 (2011)

    Google Scholar 

  22. Siglidis, G., Nikolentzos, G., Limnios, S., Giatsidis, C., Skianis, K., Vazirgiannis, M.: GraKeL: a graph kernel library in Python. J. Mach. Learn. Res. 21(54), 1–5 (2020)

    Google Scholar 

  23. Hamilton, W.L., Ying, Z., Leskovec, J.: Inductive representation learning on large graphs. In: NeurIPS (2017)

    Google Scholar 

  24. Selvaraju, R.R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., Batra, D.: Grad-CAM: visual explanations from deep networks via gradient-based localization. In: ICCV (2017)

    Google Scholar 

  25. Yan, X., Han, J.: gSpan: graph-based substructure pattern mining. In: ICDM (2002)

    Google Scholar 

  26. Lin, X., Yang, X., Li, Y.: A deep clustering algorithm based on gaussian mixture model. J. Phys.: Conf. Ser. 1302, 032012 (August 2019)

    Google Scholar 

  27. Zhang, T., Ramakrishnan, R., Livny, M.: BIRCH: a new data clustering algorithm and its applications. Data Min. Knowl. Discov. 1, 141–182 (June 1997)

    Google Scholar 

  28. Schaa, D., Kaeli, D.R.: Exploring the multiple-GPU design space. In: IPDPS (2009)

    Google Scholar 

  29. Moya, V., Gonzalez, C., Roca, J., Fernandez, A., Espasa, R.: Shader performance analysis on a modern GPU architecture. In: MICRO (2005)

    Google Scholar 

  30. NVIDIA Performance Analysis Tools (2021). https://developer.nvidia.com/ performance-analysis-tools

  31. Radeon\(^{{\rm TM}}\) Developer Tool Suite (2021). https://gpuopen.com/

  32. Welton, B., Miller, B.P.: Diogenes: Looking for an Honest CPU/GPU Performance Measurement Tool (n.d.)

    Google Scholar 

  33. Zhou, K., Adhianto, L., Anderson, J., Cherian, A., Grubisic, D., Krentel, M., Liu, Y., Meng, X., Mellor-Crummey, J.: Measurement and analysis of GPU accelerated applications with HPCToolkit. Parallel Comput. 108(2021), 102837 (2021)

    Article  Google Scholar 

  34. Baddouh, C.A., Khairy, M., Green, R.N., Payer, M., Rogers, T.G.: Principal kernel analysis: a tractable methodology to simulate scaled GPU workloads. In: MICRO (2021)

    Google Scholar 

  35. Huang, J.-C., Nai, L., Kim, H., Lee, H.-H.S.: TBPoint: reducing simulation time for large-scale GPGPU kernels. In: IPDPS (2014)

    Google Scholar 

  36. Kambadur, M., Hong, S., Cabral, J., Patil, H., Luk, C., Sajid, S., Kim, M.A.: Fast computational GPU design with GT-pin. In: IISWC (2015)

    Google Scholar 

  37. Yu, Z., Eeckhout, L., Goswami, N., Li, T., John, L.K., Jin, H., Xu, C.-Z., Wu, J.: GPGPU-MiniBench: accelerating GPGPU micro-architecture simulation. IEEE Trans. Computers 64(11), 3153–3166 (2015)

    Google Scholar 

  38. Sadyrin, D., Dergachev, A., Loginov, I., Korenkov, I.N., Ilina, A.: Application of graph databases for static code analysis of web-applications. In: MICSECS (2019)

    Google Scholar 

  39. Liu, J.: Enabling Static Program Analysis Using a Graph Database. Ph.D. Dissertation. Wright State University (2020)

    Google Scholar 

  40. Nair, A., Roy, A., Meinke, K.: FuncGNN: a graph neural network approach to program similarity. In: ESEM (2020)

    Google Scholar 

  41. Phan, A.V., Nguyen, M.L., Bui, L.T.: Convolutional neural networks over control flow graphs for software defect prediction. In: ICTAI (2017)

    Google Scholar 

  42. Wang, A.Z., You, J., Leskovec, J.: Frequent subgraph mining by walking in order embedding space. In: GRL Workshop (2020)

    Google Scholar 

  43. Thorndike, R.L.: Who belongs in the family? Psychometrika 18(1953), 267–276 (1953)

    Article  Google Scholar 

  44. Unreal Engine (2021). https://www.unrealengine.com/en-US/

  45. Zhao, L., Khan, A., Luo, R.: ShaderNet: graph-based shader code analysis to accelerate GPU’s performance improvement (Demonstration). In: GRADES-NDA workshop (2022)

    Google Scholar 

Download references

Acknowledgement

This research is supported by Novo Nordisk Foundation grant NNF22OC0072415 and Singapore MOE tier-2 grant 2019-T2-2-042. Lin Zhao acknowledges support from Nanyang Technologies University, Advanced Micro Devices Co., Ltd.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lin Zhao .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhao, L., Khan, A., Luo, R., Yeo, C.K. (2023). Graph Mining and Machine Learning for Shader Codes Analysis to Accelerate GPU Tuning. In: Cherifi, H., Mantegna, R.N., Rocha, L.M., Cherifi, C., Miccichè, S. (eds) Complex Networks and Their Applications XI. COMPLEX NETWORKS 2016 2022. Studies in Computational Intelligence, vol 1077. Springer, Cham. https://doi.org/10.1007/978-3-031-21127-0_35

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-21127-0_35

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-21126-3

  • Online ISBN: 978-3-031-21127-0

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics