diff options
author | Jongsoo Park <jongsoo@fb.com> | 2018-10-03 17:06:40 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2018-10-03 17:12:23 -0700 |
commit | 557015fd930640e53a763e12e833a26020476db4 (patch) | |
tree | 84aeaef01ac84e62e7013c68552a6b6439ce5b50 /binaries | |
parent | 6b9afc894ba9a5ac6f766763ce81b3c62430f250 (diff) | |
download | pytorch-557015fd930640e53a763e12e833a26020476db4.tar.gz pytorch-557015fd930640e53a763e12e833a26020476db4.tar.bz2 pytorch-557015fd930640e53a763e12e833a26020476db4.zip |
wipe cache with writes (#12279)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12279
By some reason if we don't write to the wipe buffer, it doesn't really wipe out everything from caches in x86.
We also need to wipe out cache after initializing input blobs.
Reviewed By: Maratyszcza
Differential Revision: D10161211
fbshipit-source-id: c34414dd8b83947805010d7d57e4134d56de1430
Diffstat (limited to 'binaries')
-rw-r--r-- | binaries/benchmark_helper.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/binaries/benchmark_helper.cc b/binaries/benchmark_helper.cc index e512b13c1e..53a1ee2c6b 100644 --- a/binaries/benchmark_helper.cc +++ b/binaries/benchmark_helper.cc @@ -260,6 +260,9 @@ void runNetwork( for (int i = 0; i < iter; ++i) { caffe2::ObserverConfig::initSampleRate(1, 1, 1, 0, warmup); fillInputBlob(workspace, tensor_protos_map, i); + if (wipe_cache) { + caffe2::wipe_cache(); + } CAFFE_ENFORCE(net->Run(), "Main run ", i, " has failed."); if (wipe_cache) { caffe2::wipe_cache(); @@ -267,9 +270,6 @@ void runNetwork( if (run_individual) { caffe2::ObserverConfig::initSampleRate(1, 1, 1, 1, warmup); CAFFE_ENFORCE(net->Run(), "Main run ", i, " with operator has failed."); - if (wipe_cache) { - caffe2::wipe_cache(); - } } } } |