Set mkl thread locally (#62891)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62891
Fixes #60469
We want to land this PR before next release, so soliciting the idea from raven38 in https://github.com/pytorch/pytorch/pull/60471. And, add corresponding test to verify the result.
- Before this PR using this test:
![image](https://user-images.githubusercontent.com/68879799/128542334-1b899be5-2b6e-4c03-8ac0-568fb15470b8.png)
- After this PR the test passed without Error.
Test Plan: Imported from OSS
Reviewed By: VitalyFedyunin
Differential Revision: D30161483
Pulled By: ejguan
fbshipit-source-id: 800f7204e0e1a19c492b2e556c92a91115f1b69b