Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

paddle 版本1.6 cpu 多核无法同时处理任务,只能单个核跑。

Open gzu-hmjiang opened this issue 6 years ago • 5 comments

程序代码中已设置os.environ['CPU_NUM'] = str(2) def main(use_cuda, is_local): """ main: train and infer """ if use_cuda and not fluid.core.is_compiled_with_cuda(): return os.environ['CPU_NUM'] = str(2) # Directory for saving the inference model save_dirname = "./output/model/" if not os.path.isdir(save_dirname): os.makedirs(save_dirname) train(use_cuda, save_dirname, is_local) # infer(use_cuda, save_dirname)

if name == 'main': use_cuda = os.getenv("PADDLE_USE_GPU", "0") == "1" is_local = True # os.getenv("PADDLE_IS_LOCAL", "0") == "1" main(use_cuda, is_local) 但是开发机上还是跑的单核 cpu,另一个 cpu 的利用率一直没上去。如何解决?

gzu-hmjiang avatar Dec 16 '19 10:12 gzu-hmjiang

方便贴一下您的相关代码么,我本地复现一下。

JepsonWong avatar Dec 16 '19 13:12 JepsonWong

上面写的就是本地代码,数据你随便找一个就可以撒。

gzu-hmjiang avatar Dec 17 '19 05:12 gzu-hmjiang

train 的接口实现的就是训练的过程。

gzu-hmjiang avatar Dec 17 '19 05:12 gzu-hmjiang

train 的接口实现的就是训练的过程。

我想问的是train里面代码是如何实现的,使用的ParallelExecutor还是Executor。

JepsonWong avatar Dec 17 '19 07:12 JepsonWong

Since you haven't replied for more than a year, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过一年未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

paddle-bot-old avatar Jan 12 '21 03:01 paddle-bot-old