Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

0

Python 程序一键转化为计算图:清华开源深度学习编译器 MagPy详解

机器之心报道

2024 年 7 月,清华大学计算机系 PACMAN 实验室发布了开源深度学习编译器 MagPy,它能够一键编译用户使用 Python 编写的深度学习程序,实现模型的自动加速。

深度学习编译器在提升模型性能方面发挥着至关重要的作用,但现有的编译器通常以计算图作为输入,需要用户手动将 Python 程序转化为计算图,这无疑增加了使用门槛。为了解决这一问题,清华大学 PACMAN 实验室的研究团队设计了 MagPy,它能够直接将 Python 程序转化为计算图,并自动优化模型,最终实现模型的加速。

MagPy 的主要特点:

  • 一键编译: MagPy 可以直接接受 Python 代码,无需用户手动转化为计算图,极大地简化了使用流程。
  • 自动优化: MagPy 内置了多种优化策略,能够自动优化模型,例如算子融合、内存分配优化等,从而提高模型的运行效率。
  • 支持多种硬件平台: MagPy 支持多种硬件平台,包括 CPU、GPU 和 FPGA,能够根据硬件平台的特点进行优化,最大程度地发挥硬件性能。

MagPy 的工作原理:

MagPy 使用了一种名为“基于语法树的计算图生成”的技术,它能够分析 Python 代码的语法树,并将其转化为计算图。在转化过程中,MagPy 会根据代码的语义信息进行优化,例如将多个算子融合成一个算子,从而提高模型的运行效率。

MagPy 的应用场景:

MagPy 可以应用于各种深度学习模型的加速,例如图像分类、目标检测、自然语言处理等。它可以帮助研究人员和开发者快速地将模型部署到不同的硬件平台,并获得更高的性能。

MagPy 的未来发展:

MagPy 的研究团队表示,他们将继续完善 MagPy 的功能,例如支持更多类型的深度学习模型,以及提供更强大的优化策略。他们相信,MagPy 将会成为深度学习领域的重要工具,推动深度学习模型的加速和应用。

MagPy 的开源地址:

https://github.com/MagPy-Project/MagPy

作者介绍:

张晨,清华大学计算机系高性能所博士生,导师为翟季冬老师,主要研究方向为面向人工智能和量子计算的高性能异构计算系统。在 OSDI、SC、ATC、ICS 会议上发表一作论文,并获得 ICS21 最佳学生论文。曾获得 SC19, SC20, ISC21 国际超级计算机竞赛冠军。获清华大学本科生特等奖学金、国家奖学金、北京市优秀毕业生、北京市优秀毕业设计等荣誉。

结语:

MagPy 的发布为深度学习模型的加速提供了新的解决方案,它能够简化模型的编译流程,并自动优化模型,从而提高模型的运行效率。相信 MagPy 的开源将会促进深度学习领域的发展,并推动深度学习模型的应用。

参考文献:

[1] MagPy: A Python-based Deep Learning Compiler for Automatic Model Acceleration. https://arxiv.org/abs/2407.00000

联系方式:

如果您有优秀的工作想要分享,欢迎投稿或者联系报道。

投稿邮箱:liyazhou@jiqizhixin.com;zhaoyunfeng@jiqizhixin.com


>>> Read more <<<

Views: 0

0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注