简体   繁体   中英

Running a DDQN on CPU-only tensorflow, my laptop is 50x faster than my AMD 3900

I was running a sample program on my laptop (DDQN from here ).

My laptop can perform a step about every.04 seconds (Lenovo P51 running Ubuntu 18.04, 32gb of memory, ssd). I tried this same program on my workstation (AMD 3900x with 64GB of RAM running Windows 10, GNU Python 3.8) and it was taking 2-3 seconds per step. Both were set to use Tensorflow 2.3.1 with NO GPU (i added the extra line to the code to ensure that). I also tried this on my Mac (homebrew Python 3.8) and got similar results to my workstation. The Mac is a 2014 Macbook Pro, so I expected it to be slow, but am surprised by the results for the desktop.

I also tried to run the same code on Linux (Lubuntu 20.04) on the workstation and got the same results (about 2-3 seconds for each step). This makes me think that I may have a hardware issue, but I ran a number of benchmarks on the workstation and nothing came back as problematic.

I'm really looking for any ideas on how to troubleshoot this because it seems like it could be hardware, but maybe something is configured 'right' on my Lenovo laptop that hasn't been set on the other two platforms.

My install on all platforms has essentially been to make sure python 3.8 is installed, then pip install tensorflow, keras, and gym. No other tweaks or adjustments are made as far as I know.

UPDATE : I found that the laptop environment was still pointing at an older python (3.6) which had an older tensorflow (1.14) installed. So now my question is, why is 2.3.1 so slow on this code while 1.1.4 is so fast? I'll google more, but suggestions are appreciated.

This could be due to a change in a large number of things - off the top of my head, the most likely is num_workers - this is the number of workers and is supposed to increase as the number of threads increase, and defaults to 1 - change this to 8 or 16 and see if performance increases.

However, this could be due to different implementations of BLAS - Tensorflow uses Intel MKL accelerations which runs much slower on AMD (likely market segmentation by Intel), it's difficult to tell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM