田海立@CSDN 2020-11-21

之前MacBook上TensorFlow只能利用CPU做训练,TF2.4开始可以利用GPU做训练了,并且不管是M1的MacBook Pro,还是Intel架构的MacBook Pro还是Mac Pro都是支持的。Apple披露这一信息,并且po出性能对比数据

 

MacBook Pro上利用GPU训练

看下面的性能数据,对比了CPU数据、Intel架构的MacBook Pro以及M1架构的MacBook Pro:

Shows a chart that compares three models. One that uses half a million utterances, another that uses one million utterances, and a third that uses five million utterances. The accuracy increases with the number of utterances. The three accuracies are 99 point forty six percent, 99 point 62 percent, and 99 point 85 percent.

结果显示:M1架构的训练性能比CPU提升了7倍;Intel架构的没那么明显。

其中的机器及软件配置:

  • CPU是13-inch Intel架构的Macbook Pro,跑的是TF2.3
  • Intel架构的GPU加速机器以及M1芯片的GPU加速机器跑的是TF2.4 prerelease
  • Intel架构的13-inch Macbook Pro的配置:1.7GHz 4核 i7 CPU + Intel Iris Plus Graphics 645 GPU + 16GB内存 + 2TB SSD硬盘
  •  M1芯片的13-inch Macbook Pro的配置:M1(4核高性能+4核高效能CPU + 8核GPU + 16核Neural Engine)+ 16GB内存 + 256GB SSD硬盘

只是,M1里有NPU,这个有利用NPU吗,还是仅仅GPU?Apple没过多披露,字里行间也只提到了GPU,保留关注。

 

Mac Pro上利用GPU训练

Mac Pro上CPU与GPU训练的数据如下:

Shows a chart that compares three models. One that uses half a million utterances, another that uses one million utterances, and a third that uses five million utterances. The accuracy increases with the number of utterances. The three accuracies are 99 point forty six percent, 99 point 62 percent, and 99 point 85 percent.

这个看起来GPU效果还是比CPU有极大提升的。

当然Mac Pro仅有Intel架构的机器,其中的机器及软件配置:

  • CPU数据跑的是TF2.3
  • GPU数据跑的是TF2.4 prerelease
  • 机器配置:3.2GHz 16核 Intel Xeon W-based + 32GB内存 + AMD Radeon Pro Vega II Duo GPU (64GB HBM2显存) + 256GB SSD硬盘

看来想利用Intel架构的MacBook Pro来跑机器学习训练任务提升有限;用M1的MacBook Pro或Mac Pro可以跑机器学习训练任务了。

 


来源参考

Leveraging ML Compute for Accelerated Training on Mac https://machinelearning.apple.com/updates/ml-compute-training-on-mac

GitHub 加速计划 / te / tensorflow
184.55 K
74.12 K
下载
一个面向所有人的开源机器学习框架
最近提交(Master分支:2 个月前 )
a49e66f2 PiperOrigin-RevId: 663726708 3 个月前
91dac11a This test overrides disabled_backends, dropping the default value in the process. PiperOrigin-RevId: 663711155 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐