TensorFlow2.4可以在MacBook Pro/Mac Pro上利用GPU做机器学习训练了

允我心安 提交于 2020-11-24 12:46:29

田海立@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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!