arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2005.06727cs.LGcs.DCstat.ML
收藏

一种高效的共享内存并行Sinkhorn-Knopp算法计算单词移动器距离

An Efficient Shared-memory Parallel Sinkhorn-Knopp Algorithm to Compute the Word Mover's Distance

Parallel Computing Labs(并行计算实验室);Intel(英特尔公司)

Jesmin Jahan Tithi, Fabrizio Petrini

摘要:

词移动器距离(WMD)是通过计算将源/查询文档的所有词最优地移动到目标文档的最相似词的成本来测量两个文本文档之间的语义不相似性的度量。计算两个文档之间的WMD是昂贵的,因为它需要解决花费\(O(V^3log(V))\)的优化问题,其中\(V\)是文档中唯一单词的数量。幸运的是,大规模杀伤性武器可以被定义为地球移动者距离(EMD)(也称为最佳运输距离),已经表明,通过向优化问题添加熵惩罚,算法复杂度可以降低到\(O(V^2)\),并且类似的想法可以适用于有效地计算大规模杀伤性武器。另外,可以通过一次针对多个目标文档计算单个查询文档的WMD(例如,发现给定的推文是否与一天中发生的任何其他推文相似)。本文采用\(O(V^2)\) EMD算法,提出了一种共享内存并行Sinkhorn-Knopp算法来计算一个文档对多个文档的WMD。我们使用算法转换将原始的密集计算内核更改为稀疏计算内核,并在最先进的英特尔\textregistered{} 4插槽Cascade Lake机器w.r. t上使用\(96\)内核获得\(67\times\)加速。其连续运行。我们的并行算法比内部使用优化矩阵库调用的朴素并行Python代码快\(700\times\)。

英文摘要:

The Word Mover's Distance (WMD) is a metric that measures the semantic dissimilarity between two text documents by computing the cost of moving all words of a source/query document to the most similar words of a target document optimally. Computing WMD between two documents is costly because it requires solving an optimization problem that costs \(O(V^3log(V))\) where \(V\) is the number of unique words in the document. Fortunately, the WMD can be framed as the Earth Mover's Distance (EMD) (also known as the Optimal Transportation Distance) for which it has been shown that the algorithmic complexity can be reduced to \(O(V^2)\) by adding an entropy penalty to the optimization problem and a similar idea can be adapted to compute WMD efficiently. Additionally, the computation can be made highly parallel by computing WMD of a single query document against multiple target documents at once (e.g., finding whether a given tweet is similar to any other tweets happened in a day). In this paper, we present a shared-memory parallel Sinkhorn-Knopp Algorithm to compute the WMD of one document against many other documents by adopting the \(O(V^2)\) EMD algorithm. We used algorithmic transformations to change the original dense compute-heavy kernel to a sparse compute kernel and obtained \(67\times\) speedup using \(96\) cores on the state-of-the-art of Intel\textregistered{} 4-sockets Cascade Lake machine w.r.t. its sequential run. Our parallel algorithm is over \(700\times\) faster than the naive parallel python code that internally uses optimized matrix library calls.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑