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.
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.
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.