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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Huang, S., Xiao, S., Feng, W.-c.: On the energy efficiency of graphics processing units for scientific computing. In: IPDPS (2009)
Owens, J.D., Houston, M., Luebke, D., Green, S., Stone, J.E., Phillips, J.C.: GPU computing. Proc. IEEE 96(5), 879–899 (2008)
AMD.: How to Tune GPU Performance Using Radeon Software (n.d.). https://www.amd.com/en/support/kb/faq/dh2-020
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)
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/
Pipelines and Shaders with Direct3D 12 (2021). https://docs.microsoft.com/enus/windows/win32/direct3d12/pipelines-and-shaders-with-directx-12
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)
Fam, S.T., Sowerby, A.: Shader Program Profiler (2015). https://patents.google.com/patent/US9799087B2
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)
Zaidi, S.I., Fam, S.T., Lotfi, P., Indukuru, V.R., Pan, J., Sowerby, A.M., Duprat, J.-L.: Shader Profiler (2018)
Karlsson, B.: RenderDoc (2021). https://renderdoc.org/docs/index.html
Gascon, H., Yamaguchi, F., Arp, D., Rieck, K.: Structural detection of android malware using embedded call graphs. In AISec (2013)
Alanazi, R., Gharibi, G., Lee, Y.: Facilitating program comprehension with call graph multilevel hierarchical abstractions. J. Syst. Softw. 176(2021), 110945 (2021)
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)
Greenspector (2021). https://greenspector.com/en/home/
Allamanis, M., Brockschmidt, M., Khademi, M.: Learning to represent programs with graphs. In: ICLR (2018)
Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: ICLR (2017)
Zhao, L., Khan, A., Luo, R.: Our Code and Datasets (2022). https://github.com/forest2022/graphForest
Radeon\(^{{\rm TM}}\) GPU Analyzer (2021). https://gpuopen.com/rga/
Leskovec, J., Rajaraman, A., Ullman, J.D.: Mining of Massive Datasets, 2nd edn. Cambridge University Press (2014)
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)
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)
Hamilton, W.L., Ying, Z., Leskovec, J.: Inductive representation learning on large graphs. In: NeurIPS (2017)
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)
Yan, X., Han, J.: gSpan: graph-based substructure pattern mining. In: ICDM (2002)
Lin, X., Yang, X., Li, Y.: A deep clustering algorithm based on gaussian mixture model. J. Phys.: Conf. Ser. 1302, 032012 (August 2019)
Zhang, T., Ramakrishnan, R., Livny, M.: BIRCH: a new data clustering algorithm and its applications. Data Min. Knowl. Discov. 1, 141–182 (June 1997)
Schaa, D., Kaeli, D.R.: Exploring the multiple-GPU design space. In: IPDPS (2009)
Moya, V., Gonzalez, C., Roca, J., Fernandez, A., Espasa, R.: Shader performance analysis on a modern GPU architecture. In: MICRO (2005)
NVIDIA Performance Analysis Tools (2021). https://developer.nvidia.com/ performance-analysis-tools
Radeon\(^{{\rm TM}}\) Developer Tool Suite (2021). https://gpuopen.com/
Welton, B., Miller, B.P.: Diogenes: Looking for an Honest CPU/GPU Performance Measurement Tool (n.d.)
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)
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)
Huang, J.-C., Nai, L., Kim, H., Lee, H.-H.S.: TBPoint: reducing simulation time for large-scale GPGPU kernels. In: IPDPS (2014)
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)
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)
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)
Liu, J.: Enabling Static Program Analysis Using a Graph Database. Ph.D. Dissertation. Wright State University (2020)
Nair, A., Roy, A., Meinke, K.: FuncGNN: a graph neural network approach to program similarity. In: ESEM (2020)
Phan, A.V., Nguyen, M.L., Bui, L.T.: Convolutional neural networks over control flow graphs for software defect prediction. In: ICTAI (2017)
Wang, A.Z., You, J., Leskovec, J.: Frequent subgraph mining by walking in order embedding space. In: GRL Workshop (2020)
Thorndike, R.L.: Who belongs in the family? Psychometrika 18(1953), 267–276 (1953)
Unreal Engine (2021). https://www.unrealengine.com/en-US/
Zhao, L., Khan, A., Luo, R.: ShaderNet: graph-based shader code analysis to accelerate GPU’s performance improvement (Demonstration). In: GRADES-NDA workshop (2022)
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
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)