Fasttext: Not thread-safe on multi-thread version?

Created on 17 Aug 2017  路  2Comments  路  Source: facebookresearch/fastText

I have read the code, and find out that the memory which pointed by member variable input_ and output_ in FastText class will be modified by multiple worker threads.
So, we need a thread-safe Matrix implementation.

Most helpful comment

Hi @zhanglistar,

This is on purpose. FastText is using hogwild (https://arxiv.org/abs/1106.5730), which is a pretty well known method for parallelizing stochastic gradient descent. So, no need for thread safe matrix implementation ;)

Best,
Edouard.

All 2 comments

But, it's wired that the trained result not bad. I don't know why.

Hi @zhanglistar,

This is on purpose. FastText is using hogwild (https://arxiv.org/abs/1106.5730), which is a pretty well known method for parallelizing stochastic gradient descent. So, no need for thread safe matrix implementation ;)

Best,
Edouard.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loretoparisi picture loretoparisi  路  3Comments

pengyu picture pengyu  路  3Comments

ragvri picture ragvri  路  3Comments

loretoparisi picture loretoparisi  路  3Comments

flybirp picture flybirp  路  4Comments