tf-coriander icon indicating copy to clipboard operation
tf-coriander copied to clipboard

Execution speed is much slower than CPU in MacBook Pro?

Open elife33 opened this issue 7 years ago • 5 comments

In my MacBook Pro(Mid 2015), Execution speed in AMD Radeon R9 M370X Compute Engine is much slower than CPU(2.5 GHz Intel Core i7). Is this normal?

elife33 avatar Oct 16 '17 07:10 elife33

GPU:

  • python multilayer_perceptron.py Extracting /tmp/data/train-images-idx3-ubyte.gz Extracting /tmp/data/train-labels-idx1-ubyte.gz Extracting /tmp/data/t10k-images-idx3-ubyte.gz Extracting /tmp/data/t10k-labels-idx1-ubyte.gz OpenCL platform: Apple OpenCL device: AMD Radeon R9 M370X Compute Engine I tensorflow/core/common_runtime/gpu/gpu_device.cc:989] Found device 0 with properties: name: AMD Radeon R9 M370X Compute Engine major: -1 minor: -1 memoryClockRate (GHz) 800 pciBusID 0000.0000 Total memory: 2.00GiB Free memory: 512.00MiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:877] cannot enable peer access from device ordinal 0 to device ordinal 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:1011] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:1021] 0: N I tensorflow/core/common_runtime/gpu/gpu_device.cc:1083] Creating TensorFlow device (/gpu:0) -> (device: 0, name: AMD Radeon R9 M370X Compute Engine, pci bus id: 0000.0000) cl_driver DeviceAllocate 327155712 Epoch: 0001 cost= 168.817177381 Epoch: 0002 cost= 41.912425166 Epoch: 0003 cost= 26.223643868 Optimization Finished! Accuracy: 0.913713 epoch_times [14.012919187545776, 12.755515336990356, 12.597593069076538] average_epoch_times= 12.676554203 kernel_compile_time 1.33636498451

real 0m42.142s user 0m31.954s sys 0m18.096s

CPU: QiangdeMacBook-Pro:3_NeuralNetworks elife$ time python multilayer_perceptron.py Extracting /tmp/data/train-images-idx3-ubyte.gz Extracting /tmp/data/train-labels-idx1-ubyte.gz Extracting /tmp/data/t10k-images-idx3-ubyte.gz Extracting /tmp/data/t10k-labels-idx1-ubyte.gz 2017-10-16 15:53:15.945534: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-10-16 15:53:15.945553: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-10-16 15:53:15.945568: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-10-16 15:53:15.945572: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. Epoch: 0001 cost=333.116085219 Epoch: 0002 cost=97.091073028 Epoch: 0003 cost=71.633393175 Epoch: 0004 cost=58.102855900 Epoch: 0005 cost=48.550296390 Epoch: 0006 cost=43.879424709 Epoch: 0007 cost=38.416489090 Epoch: 0008 cost=35.230118899 Epoch: 0009 cost=32.181227765 Epoch: 0010 cost=30.920996809 Epoch: 0011 cost=28.272015703 Epoch: 0012 cost=26.596986358 Epoch: 0013 cost=25.029801500 Epoch: 0014 cost=23.558648788 Epoch: 0015 cost=22.414703977 Optimization Finished! Accuracy: 0.8971

real 0m32.758s user 2m15.099s sys 0m10.327s

elife33 avatar Oct 16 '17 08:10 elife33

Bitcoin mining Data courtesy CompuBench Radeon R9 M370X Mac 111.14 mHash/s

CompuBench 1.5 (Bitcoin mining) Data courtesy CompuBench Core i7 4870HQ 30.62 mHash/s

elife33 avatar Oct 16 '17 08:10 elife33

Face detection Data courtesy CompuBench Radeon R9 M370X Mac 25.65 mPixels/s

CompuBench 1.5 (Face detection) Core i7 4870HQ 18.08 mPixels/s

elife33 avatar Oct 16 '17 08:10 elife33

It is. Since all convolutions are running on the CPU currently. I never quite got around to attaching https://github.com/hughperkins/coriander-dnn to tf-coriander, so convolutions are on the cpu currently. If someone has a moment, would be good to get that working. Happy to provide guidance, meet in Google Hangouts etc, if anyone wants to take a look at that.

hughperkins avatar Oct 16 '17 09:10 hughperkins

@hughperkins, I'm open to try as i'm working to get a 560 running on high sierra via gpu

datatalking avatar Jan 04 '23 01:01 datatalking