Skip to content

Commit

Permalink
Merge pull request #11464 from tensor-tang/set_nthreads
Browse files Browse the repository at this point in the history
initial with only 1 mkl/openblas threads for each pthreads
  • Loading branch information
luotao1 authored Jun 14, 2018
2 parents 0b3d7f1 + d0fb00d commit 8f266e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/fluid/framework/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License. */

#include "paddle/fluid/framework/init.h"
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/operators/math/blas.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/string/piece.h"
Expand Down Expand Up @@ -113,6 +114,9 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
}
places.emplace_back(platform::CPUPlace());
platform::DeviceContextPool::Init(places);
#ifndef PADDLE_WITH_MKLDNN
operators::math::SetNumThreads(1);
#endif
}

void InitGLOG(const std::string &prog_name) {
Expand Down

0 comments on commit 8f266e2

Please sign in to comment.