17

TensorFlow 2.4 Mac 优化版:性能大幅提升,可在最新的 M1 芯片上运行

 3 years ago
source link: https://www.infoq.cn/article/cuRuULlc0KX1PtN91W14
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

通过 TensorFlow 2 在各种不同的平台、设备和硬件上提供一流的训练性能,使开发人员、工程师和研究人员能够在他们喜欢的平台上工作。TensorFlow 用户现在可以在搭载 Intel CPU 的 Mac 或搭载 Apple 新芯片 M1 的 Mac 上使用 TensorFlow 2.4 Mac 优化版 和新的 ML Compute(机器学习计算)框架进行加速训练。这些改进,加上 Apple 开发人员可以通过 TensorFlow Lite 在 iOS 上执行 TensorFlow,继续展示了 TensorFlow 在 Apple 硬件上支持高性能机器学习执行的广度和深度。

使用 ML Compute 在 Mac 上的性能

Mac 一直是开发人员、工程师和研究人员所喜爱的平台。随着 Apple 上周 宣布 推出一系列采用新芯片 M1 的 Mac 计算机,TensorFlow 2.4 Mac 优化版充分利用了 Mac 的全部能力,在性能上有了巨大的飞跃。

ML Compute 是 Apple 推出的新框架,它支持在 Mac 上进行 TensorFlow 模型的训练,现在你可以在搭载 M1 或 Intel CPU 的 Mac 计算机上利用加速的 CPU 和 GPU 进行训练。

例如,M1 芯片包含了一个强大的新 8 核 CPU 和多达 8 核的 GPU,这些都是针对 Mac 计算机上的机器学习训练任务而优化的。在下面的图表中,你可以看到 TensorFlow 2.4 Mac 优化版在流行的搭载 M1 和 Intel CPU 的 Mac 上如何实现巨大的性能提升的。

6VvuAnY.jpg!mobile

在搭载 M1 和 Intel CPU 的 13 英寸 MacBook Pro 上,使用 ML Compute 的常见机型的训练效果以秒为单位显示,数字越小表明训练时间越短。

ARN3Ery.jpg!mobile

在搭载 Intel CPU 的 MacPro 2019 款上使用 ML Compute 对常见机型的训练效果以秒为单位显示,数字越小表明训练时间越短。

TensorFlow Apple Mac 优化版入门

用户无需对现有的 TensorFlow 脚本进行任何更改,就可以使用 ML Compute 作为 TensorFlow 和 TensorFlow 插件的后端。

首先,请访问 Apple 的 GitHub 仓库 ,了解如何下载并安装 TensorFlow 2.4 Apple Mac 优化版分叉(fork)的说明。

在不久的将来,Apple 将通过分叉版本集成到 TensorFlow 主分支 中,使这样的更新更容易让用户获得这些性能数据。

你可以在 Apple 的机器学习网站 上了解更多关于 ML Compute 框架的信息。

原文链接:

https://blog.tensorflow.org/2020/11/accelerating-tensorflow-performance-on-mac.html


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK