3

I am working on a ML project with conda, python==3.6.8 and mkl==2019.1. I have set the seed and running the code multiple times on an Intel Pentium G4560, I get the exact same results. However, running the same code under an identical environment on an Intel i5-8257U I get slightly different results, from 3rd/2nd decimal place. On the i5-8257U I do get the same result if I run the code multiple times. G4560 is running Ubuntu 18.04 and while i5-8257U is running macOS, I am running the code in a Debian based Docker container.

After reading a bit online I found out about the reproducibility flags for MKL and set MKL_CBWR=SSE4_2, MKL_NUM_THREADS=1 and MKL_DYNAMIC=FALSE (since G4560 supports only SSE4.2) but the results on the i5-8257U are still the old ones.

Anyone else experiencing the same thing? I am trying to find a way for my code to be reproducible among computer setups. Thanks!

th3owner
  • 31
  • 1
  • did you set seeds for python using the env variable PYTHONHASHSEED=0 and set seed for all the libraries involved in your computation (NumPy and ml libraries) – ESDAIRIM Nov 19 '20 at 22:15
  • Yes I set `PTYHONHASHSEED=0` and also set the global seed for Numpy, python and Tensorflow. Indeed, when running the code on the same machine multiple times, the result is always the same down to 7 decimal places, which is enough for my usecase. – th3owner Nov 20 '20 at 08:47

0 Answers0