摘 要: 对CUDA核函数(CUDA Kernel Function)在静态下的评估预测是任务调度与程序优化的一个关键组成部分。文章通过对CUDA核函数的PTX(Parallel Thread Execution)进行代码分析和特性建模,精心设计了一个时间预测模型。该模型基于指令流水线的原理,可以在不执行程序的情况下,预测核函数在给定硬件环境下的执行时间。实验结果表明,该模型在预测CUDA核函数执行时间上的平均百分比误差为22.87%。这意味着该模型能够相对准确地预测核函数的执行时间,为任务调度系统提供参考,并辅助开发人员对程序进行优化。 |
关键词: CUDA;时间预测;静态;PTX;流水线 |
中图分类号: TP391
文献标识码: A
|
|
Time Prediction Model for CUDA Kernel Function Based on Instruction Pipeline |
ZHANG Jianding, CHEN Genlang, MING Zongyu
|
(School of Arti f icial Intelligence, Zhejiang Sci-Tech University, Hangzhou 310018, China)
202130504207@mails.zstu.edu.cn; cgl@zju.edu.cn; 202220601008@mails.zstu.edu.cn
|
Abstract: Static evaluation and prediction of CUDA kernel functions are key components in task scheduling and program optimization. This paper proposes to carefully devise a time prediction model through the analysis of PTX (Parallel Thread Execution) code and feature modeling of CUDA kernel functions. Based on the principles of instruction pipeline, the model can predict the execution time of kernel functions in a given hardware environment without executing the program. Experimental results indicate that the model achieves an average percentage error of 22.87% in predicting the execution time of CUDA kernel functions. This means the model can relatively accurately predict the execution time of kernel functions, providing a reference for task scheduling systems and assisting developers in program optimization. |
Keywords: CUDA; time prediction; static; PTX; pipeline |