PlaidML on MacOSX with Radeon Pro 560X Benchmarking
Aven Le Zhou
Shanghai, Shanghai
- 0 Collaborators
I always wanted to take advantage of GPU power on MacOSX to inference or train neural networks, but with a few luck. Now using Keras with PlaidML backend just made it easy! Here are step-by-step documentation and data demonstrates the performance with plaidML/TF-CPU on CPU/GPU. ...learn more
Project status: Under Development
Intel Technologies
Intel Opt ML/DL Framework
Overview / Usage
+---------------------------------------------------------------------+
| Keras, 1024 examples with resnet/inception_v3, batch size 1|
+-----------------+-----------------+---------------------------------+
| Backend | TensorFlow | PlaidML |
+-----------------+-----------------+------------+--------------------+
| Hardware | CPU | CPU | GPU |
+-----------------+-----------------+------------+--------------------+
| |2.6 GHz 6-Core Intel Core i7| Radeon Pro 560X |
+-----------------+------------------------------+--------------------+
| | | |
+-----------------+---------------------------------------------------+
| | Inference Latency (ms) |
+-----------------+-----------------+------------+--------------------+
| | 79.85 | 192.91 | 35.59 |
| resnet +-----------------+------------+--------------------+
| | 100% | 241.59% | 44.57% |
+-----------------+-----------------+------------+--------------------+
| | 92.91 | 295.42 | 51.92 |
| inceptionV3 +-----------------+------------+--------------------+
| | 100% | 317.96% | 55.88% |
+-----------------+-----------------+------------+--------------------+
Methodology / Approach
>>
pip install plaidml-keras plaidbench
>>
pip install tensorflow
>>
plaidml-setup
- Log:
Using experimental devices can cause poor performance, crashes, and other nastiness.
Enable experimental device support? (y,n)[n]:n
Multiple devices detected (You can override by setting PLAIDML_DEVICE_IDS).
Please choose a default device:
1 : llvm_cpu.0
2 : metal_amd_radeon_pro_560x.0
3 : metal_intel(r)_uhd_graphics_630.0
Default device? (1,2,3)[1]:2
Selected device:
metal_amd_radeon_pro_560x.0
Almost done. Multiplying some matrices...
Tile code:
function (B[X,Z], C[Z,Y]) -> (A) { A[x,y : X,Y] = +(B[x,z] * C[z,y]); }
Whew. That worked.
Save settings to /Users/aven/.plaidml? (y,n)[y]:y
Success
>>
plaidbench --results tf-cpu keras --tensorflow inceptionv3
>>
plaidbench --results plaid-gpu keras --plaid inception_v3
Reconfig the plaidML backend to use CPU with
>>
plaidml-setup
>>
plaidbench --results plaid-cpu keras --plaid inception_v3