【发布时间】:2016-02-29 00:29:36
【问题描述】:
当我在一台 12 核的机器上运行 gensim 的 LdaMulticore 模型时,使用:
lda = LdaMulticore(corpus, num_topics=64, workers=10)
我收到一条日志消息,上面写着
using serial LDA version on this node
几行之后,我看到另一条日志消息显示
training LDA model using 10 processes
当我运行 top 时,我看到 11 个 python 进程已生成,但 9 个正在休眠,即只有一名工人处于活动状态。该机器有 24 个核心,无论如何都不会被压垮。为什么 LdaMulticore 不以并行模式运行?
【问题讨论】:
-
一个原因可能是slow loading of the
corpus。测试您的代码,看看需要多少时间。
标签: python multiprocessing lda gensim