You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2015/08/13 07:50:22 UTC
[1/2] incubator-singa git commit: SINGA-45 Set openblas num threads
in job configuration
Repository: incubator-singa
Updated Branches:
refs/heads/master 2c7edd73c -> da844afd1
SINGA-45 Set openblas num threads in job configuration
Add a configuration field (openblas_num_threads) in JobProto which specifies the num of threads used by openblas, default to 1.
If multiple workers/servers are launched in one process, this field must be set to 1 (according to openblas wiki page).
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/2da5e23e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/2da5e23e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/2da5e23e
Branch: refs/heads/master
Commit: 2da5e23e6d5f5a5728243d8ece4c4d48dc28db29
Parents: 7a61a68
Author: Wei Wang <wa...@comp.nus.edu.sg>
Authored: Wed Aug 12 19:29:50 2015 +0800
Committer: Wei Wang <wa...@comp.nus.edu.sg>
Committed: Wed Aug 12 19:33:45 2015 +0800
----------------------------------------------------------------------
include/singa.h | 7 ++++++-
src/proto/job.proto | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/2da5e23e/include/singa.h
----------------------------------------------------------------------
diff --git a/include/singa.h b/include/singa.h
index 6eca6c4..c8984e5 100644
--- a/include/singa.h
+++ b/include/singa.h
@@ -2,6 +2,7 @@
#define SINGA_SINGA_H_
#include <gflags/gflags.h>
#include <glog/logging.h>
+#include <cblas.h>
#include "utils/common.h"
#include "proto/job.pb.h"
@@ -24,9 +25,13 @@ void SubmitJob(int job, bool resume, const JobProto& jobConf) {
if (singaConf.has_log_dir())
SetupLog(singaConf.log_dir(),
std::to_string(job) + "-" + jobConf.model().name());
+ if (jobConf.num_openblas_threads() != 1)
+ LOG(WARNING) << "openblas is set with " << jobConf.num_openblas_threads()
+ << " threads";
+ openblas_set_num_threads(jobConf.num_openblas_threads());
Trainer trainer;
trainer.Start(job, resume, jobConf, singaConf);
}
-} /* singa */
+} // namespace singa
#endif // SINGA_SINGA_H_
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/2da5e23e/src/proto/job.proto
----------------------------------------------------------------------
diff --git a/src/proto/job.proto b/src/proto/job.proto
index 3b22470..09d8e9f 100644
--- a/src/proto/job.proto
+++ b/src/proto/job.proto
@@ -3,6 +3,7 @@ package singa;
message JobProto {
required ClusterProto cluster = 1;
required ModelProto model = 2;
+ optional int32 num_openblas_threads = 3 [default = 1];
}
message ClusterProto {
[2/2] incubator-singa git commit: SINGA-45 Set openblas num threads
in job configuration
Posted by wa...@apache.org.
SINGA-45 Set openblas num threads in job configuration
test and merge to master
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/da844afd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/da844afd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/da844afd
Branch: refs/heads/master
Commit: da844afd1229494684338b865c4d8f570370ab27
Parents: 2da5e23 2c7edd7
Author: wang sheng <wa...@gmail.com>
Authored: Thu Aug 13 13:44:30 2015 +0800
Committer: wang sheng <wa...@gmail.com>
Committed: Thu Aug 13 13:44:30 2015 +0800
----------------------------------------------------------------------
bin/singa-cleanup.sh | 2 +-
bin/singa-console.sh | 14 ++--
bin/singa-env.sh | 13 ++++
bin/singa-run.sh | 46 +++++++-----
bin/singa-stop.sh | 2 +-
examples/cifar10/job.conf | 1 +
include/utils/cluster_rt.h | 4 +-
src/main.cc | 6 +-
src/proto/job.proto | 2 +-
src/proto/singa.proto | 4 +-
src/utils/cluster_rt.cc | 7 +-
src/utils/tool.cc | 159 ++++++++++++++++++++++++----------------
12 files changed, 156 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/da844afd/src/proto/job.proto
----------------------------------------------------------------------