OpenCL PyTorch的实现方法

By linking the OpenCL operator library and kernel function library on OpenCL devices, the problem of PyTorch framework being unable to train models on OpenCL devices is solved, realizing a complete deep learning framework that supports model training and deployment according to the OpenCL programming standard.

CN116976430BActive Publication Date: 2026-07-17NANKAI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANKAI UNIV
Filing Date
2023-07-17
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

The existing PyTorch framework cannot directly train models on OpenCL devices. It can only convert the trained model into a PyTorch Mobile-compatible model to perform model inference on OpenCL devices. It cannot implement an OpenCL version of the PyTorch framework.

Method used

By implementing an OpenCL operator library based on the OpenCL standard, a link is established between the OpenCL operator library and the OpenCL kernel function library. Based on the OpenCL operator library, the PyTorch framework calls the OpenCL kernel function library, including obtaining operator call information, determining the calculation steps and target kernel function, encapsulating the data to be calculated, and calling the target kernel function in the OpenCL kernel function library to perform the calculation.

Benefits of technology

It implements complete deep learning model training and deployment of the PyTorch framework on OpenCL devices, covering approximately 400 commonly used operators, and enhances the portability and adaptability of the OpenCL backend.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116976430B_ABST
    Figure CN116976430B_ABST
Patent Text Reader

Abstract

本公开公开了OpenCL PyTorch的实现方法,涉及机器学习技术领域。主要技术方案包括:首先,基于OpenCL标准实现可在OpenCL设备中运算的OpenCL算子库;其中,所述OpenCL算子库用于接收PyTorch框架发送的算子调用信息;其次,建立所述OpenCL算子库与OpenCL核函数库之间的链接;其中,所述OpenCL核函数库包含至少一个用户开发的OpenCL核函数接口或开源OpenCL计算库的核函数接口;最后,基于所述OpenCL算子库,实现PyTorch框架对所述OpenCL核函数库的调用。通过将PyTorch框架的OpenCL算子调用需求进行分解,并基于OpenCL核函数库调用OpenCL设备进行执行计算;PyTorch框架可以利用支持OpenCL标准的设备训练和部署深度学习模型,实现了可支持OpenCL编程标准的完整深度学习框架。
Need to check novelty before this filing date? Find Prior Art