将Python程序移植到Mojo,性能提升250倍、速度比C版本快20%
出品 | OSC开源社区(ID:oschina2013)
Aydyn Tairov 是一名开源作者,也是 Meta 前工程师,他此前将 GitHub 上火热的纯 C 语言实现的
llama2.c
项目移植到了 Python ——llama2.py
。Mojo 是 Modular AI 公司开发的新编程语言,它结合了 Python 的易用性以及 C 语言的可移植性和性能,目标是使其成为 AI 研究和生产的理想选择。
于是 Aydyn Tairov 马不停蹄地就开始将
llama2.py
移植到 Mojo——llama2.mojo
,结果非常出乎意料。他表示,Mojo SIMD 原语帮助将 Python 的糟糕性能提升了近 250 倍。此外,由于他使用了 matmul 的矢量化助手,经测试
llama2.py
速度比 C 版本快 20%。详情:
https://github.com/tairov/llama2.mojo
https://twitter.com/tairov/status/1701194900228764023
往期推荐
这里有最新开源资讯、软件更新、技术干货等内容
点这里 ↓↓↓ 记得 关注✔ 标星⭐ 哦
阅读原文 最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。