pytorch/caffe2/predictor
Tristan Rice 0c9787c758 caffe2: use at::mt19937 instead of std::mt19937 (10x speedup) (#43987)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/43987

This replaces the caffe2 CPU random number (std::mt19937) with at::mt19937 which is the one currently used in pytorch. The ATen RNG is 10x faster than the std one and appears to be more robust given bugs in the std (https://fburl.com/diffusion/uhro7lqb)

For large embedding tables (10GB+) we see UniformFillOp taking upwards of 10 minutes as we're bottlenecked on the single threaded RNG. Swapping to at::mt19937 cuts that time to 10% of the current.

Test Plan: Ran all relevant tests + CI. This doesn't introduce new features (+ is a core change) so existing tests+CI should be sufficient to catch regressions.

Reviewed By: dzhulgakov

Differential Revision: D23219710

fbshipit-source-id: bd16ed6415b2933e047bcb283a013d47fb395814
2020-10-16 16:08:35 -07:00
..
emulator Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
CMakeLists.txt Back out "Open-source ThreadSafeActivationCleaningPredictor" 2018-09-19 21:26:51 -07:00
InferenceGraph.h [caffe2][redo] Reimplement RemoveOpsByType with SSA (#41606) 2020-07-17 16:06:43 -07:00
predictor_config.cc Make C10_MOBILE consistent with how feature macros are usually used (#17481) 2019-02-27 17:57:51 -08:00
predictor_config.h Removing cyclic dependency (#20511) 2019-05-14 18:55:19 -07:00
predictor_test.cc caffe2: use at::mt19937 instead of std::mt19937 (10x speedup) (#43987) 2020-10-16 16:08:35 -07:00
predictor_utils.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
predictor_utils.h
predictor.cc Removing cyclic dependency (#20511) 2019-05-14 18:55:19 -07:00
predictor.h Make predictor base class 2019-02-01 20:59:19 -08:00
ThreadLocalPtr.cc BlackBoxPredictor OSS part N: ThreadLocalPtr, InferenceGraph (#23257) 2019-07-24 14:35:30 -07:00
ThreadLocalPtr.h BlackBoxPredictor OSS part N: ThreadLocalPtr, InferenceGraph (#23257) 2019-07-24 14:35:30 -07:00
transforms.cc [caffe2] Do not run RemoveOpsByType on recurrent networks (#45986) 2020-10-07 14:07:52 -07:00
transforms.h [caffe2][redo] Reimplement RemoveOpsByType with SSA (#41606) 2020-07-17 16:06:43 -07:00