大数据 爬虫Python AI SqlPython小哥哥

硬件的AI性能测试Python库发布!

2019-07-01  本文已影响1人  14e61d025165

目前人工智能技术发展速度很快,也很吸引眼球。但是对于各种多如牛毛的方法,目前并米有一个可靠的精准的基准来衡量各项硬件在不同算法训练和推理的性能。

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1561967685156 ql-align-center" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; text-align: left; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

Python学习交流群:1004391443

现在,不用愁了。国外的一个哥们, Andrey Ignatov发布了一个python库。大家可以利用这个python库测试自己硬件的性能!

AI Benchmark Alpha是一个开源python库,用于评估各种硬件平台的AI性能,包括CPU,GPU和TPU。 该基准测试依赖于TensorFlow机器学习库,并提供精确轻量级的解决方案,用于评估关键深度学习模型的推理和训练速度。 AI Benchmark目前作为Python pip包发布,可以下载到运行Windows,Linux或macOS的任何系统。

这个包在6月26日发布了两个版本,一个是0.1.0一个是0.1.1。

目前,支持如下算法的性能测试:

● Section 1: MobileNet-V2, Classification

● Section 2: Inception-V3, Classification

● Section 3: Inception-V4, Classification

● Section 4: Inception-ResNet-V2, Classification

● Section 5: ResNet-V2-50, Classification

● Section 6: ResNet-V2-152, Classification

● Section 7: VGG-16, Classification

● Section 8: SRCNN 9-5-5, Image-to-Image Mapping

● Section 9: VGG-19, Image-to-Image Mapping

● Section 10: ResNet-SRGAN, Image-to-Image Mapping

● Section 11: ResNet-DPED, Image-to-Image Mapping

● Section 12: U-Net, Image-to-Image Mapping

● Section 13: Nvidia-SPADE, Image-to-Image Mapping

● Section 14: ICNet, Image Segmentation

● Section 15: PSPNet, Image Segmentation

● Section 16: DeepLab, Image Segmentation

● Section 17: Pixel-RNN, Image Inpainting

● Section 18: LSTM, Sentence Sentiment Analysis

● Section 19: GNMT, Text Translation

同时,作者也给出了一些测试结果。非常有意思:

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1561967685163 ql-align-center" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; text-align: left; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

目前最强的桌面GPU当属于GeForce GTX 1080 Ti了。其次是TITAN Xp CE和GeForce GTX TITAN X。

使用这个库也很简单,大家可以先pip install ai-benchmark。注意,需要安装tensorflow才能运行。

使用方法如下:

<pre spellcheck="false" style="box-sizing: border-box; margin: 5px 0px; padding: 5px 10px; border: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-weight: 400; font-stretch: inherit; font-size: 16px; line-height: inherit; font-family: inherit; vertical-align: baseline; cursor: text; counter-reset: list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0; background-color: rgb(240, 240, 240); border-radius: 3px; white-space: pre-wrap; color: rgb(34, 34, 34); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">from ai_benchmark import AIBenchmark
results = AIBenchmark().run()
</pre>

我自己也测试了一下,非常容易:

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1561967685167 ql-align-center" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; text-align: left; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

可以看到,我的硬件在MobieNet-V2算法的训练速度大约是27688±741ms,推理速度大约是2747±119ms。这速度惨不忍睹啊。各位可以自己去看看自己的成绩。

上一篇 下一篇

猜你喜欢

热点阅读