简体   繁体   English

在仅 CPU 的 tensorflow 上运行 DDQN,我的笔记本电脑比我的 AMD 3900 快 50 倍

[英]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 ).我在我的笔记本电脑上运行了一个示例程序(来自这里的 DDQN)。

My laptop can perform a step about every.04 seconds (Lenovo P51 running Ubuntu 18.04, 32gb of memory, ssd).我的笔记本电脑可以大约每 04 秒执行一个步骤(Lenovo P51 运行 Ubuntu 18.04,32gb 的 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.我在我的工作站上尝试了同样的程序(AMD 3900x,64GB RAM,运行 Windows 10,GNU Python 3.8),每一步需要 2-3 秒。 Both were set to use Tensorflow 2.3.1 with NO GPU (i added the extra line to the code to ensure that).两者都设置为使用 Tensorflow 2.3.1 和 NO GPU(我在代码中添加了额外的行以确保这一点)。 I also tried this on my Mac (homebrew Python 3.8) and got similar results to my workstation.我也在我的 Mac(自制 Python 3.8)上尝试了这个,并得到了与我的工作站相似的结果。 The Mac is a 2014 Macbook Pro, so I expected it to be slow, but am surprised by the results for the desktop. Mac 是 2014 年的 Macbook Pro,所以我预计它会很慢,但对台式机的结果感到惊讶。

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).我还尝试在工作站上的 Linux (Lubuntu 20.04) 上运行相同的代码并得到相同的结果(每个步骤大约 2-3 秒)。 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.我在所有平台上的安装基本上是确保安装 python 3.8,然后 pip 安装 tensorflow、Z063009 和 0BB15C812722Z1DCDF0DCDF0 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.更新:我发现笔记本电脑环境仍然指向较旧的 python (3.6),它安装了较旧的 tensorflow (1.14)。 So now my question is, why is 2.3.1 so slow on this code while 1.1.4 is so fast?所以现在我的问题是,为什么 2.3.1 在这段代码上这么慢,而 1.1.4 这么快? 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.这可能是由于很多事情发生了变化——在我的脑海中,最有可能是num_workers这是工人的数量,应该随着线程数量的增加而增加,默认为 1——将其更改为 8 或 16 并查看性能是否提高。

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.然而,这可能是由于 BLAS 的不同实现 - Tensorflow 使用英特尔 MKL 加速,在 AMD 上运行速度要慢得多(可能是英特尔的市场细分),很难说。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的 i5 笔记本电脑运行 python 脚本的速度比 Xeon 40 核心服务器的 cpu Ubuntu 18.04 快,为什么? - My i5 laptop is running python script faster than Xeon 40 core server's cpu Ubuntu 18.04, Why? GPU tensorflow 在笔记本电脑上运行速度比 CPU tensorflow 慢? - GPU tensorflow running slower than CPU tensorflow on laptop? 安装仅Tensorflow CPU的Windows 8.1 Python 3.5.2时出错 - Error installing Tensorflow CPU-only Windows 8.1 Python 3.5.2 通过conda-forge安装tensorflow-gpu会导致使用仅CPU的张量流 - Installing tensorflow-gpu via conda-forge results in using CPU-only tensorflow 无法在 tensorflow 仅 CPU 安装上加载动态库“cudart64_101.dll” - Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation Tensorflow仅CPU:TypeError:必须以变量实例作为第一个参数调用未绑定方法_as_graph_element() - Tensorflow CPU-only:TypeError: unbound method _as_graph_element() must be called with Variable instance as first argument Keras - RTX 2080 ti 训练比 CPU 和 GTX 1070 都慢? - Keras - RTX 2080 ti training slower than both CPU-only and GTX 1070? 如何通过并行运行 CPU 和 GPU 更快地训练我的神经网络 - How to train my neural network faster by running CPU and GPU in parallel 为什么我的 List 在它不应该运行的时候比 Queue 运行得快? - Why my List is running faster than Queue when it should not? Tensorflow 导入非常慢,因为它正在寻找“cudart64_110.dll”。 我没有 gpu。有 cpu-only 版本吗? - Tensorflow import is very slow because it's looking for "cudart64_110.dll". I don't have a gpu. Is there a cpu-only version?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM