Browse Source

modify timeout of version check subprocess to 3s

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
tags/v1.1.0
zhoufeng 5 years ago
parent
commit
ad1e49b7a3
6 changed files with 18 additions and 4 deletions
  1. +1
    -0
      include/api/graph.h
  2. +10
    -4
      mindspore/_check_version.py
  3. +1
    -0
      mindspore/ccsrc/cxx_api/context.cc
  4. +2
    -0
      mindspore/ccsrc/cxx_api/graph/graph.cc
  5. +2
    -0
      mindspore/ccsrc/cxx_api/graph/graph_data.cc
  6. +2
    -0
      mindspore/ccsrc/cxx_api/graph/graph_data.h

+ 1
- 0
include/api/graph.h View File

@@ -30,6 +30,7 @@ class MS_API Graph {
class GraphData;
explicit Graph(const std::shared_ptr<GraphData> &graph_data);
explicit Graph(std::shared_ptr<GraphData> &&graph_data);
~Graph();

enum ModelType ModelType() const;



+ 10
- 4
mindspore/_check_version.py View File

@@ -190,15 +190,21 @@ class AscendEnvChecker(EnvChecker):
"match, reference to the match info on: https://www.mindspore.cn/install")

def check_deps_version(self):
# in order to update the change of 'LD_LIBRARY_PATH' env, run a sub process
"""
te, topi, hccl wheel package version check
in order to update the change of 'LD_LIBRARY_PATH' env, run a sub process
"""
input_args = ["--mindspore_version=" + __version__]
for v in self.version:
input_args.append("--supported_version=" + v)
deps_version_checker = os.path.join(os.path.split(os.path.realpath(__file__))[0], "_check_deps_version.py")
call_cmd = [sys.executable, deps_version_checker] + input_args
process = subprocess.run(call_cmd, timeout=300, text=True, capture_output=True, check=False)
if process.stdout.strip() != "":
logger.warning(process.stdout.strip())
try:
process = subprocess.run(call_cmd, timeout=3, text=True, capture_output=True, check=False)
if process.stdout.strip() != "":
logger.warning(process.stdout.strip())
except subprocess.TimeoutExpired:
logger.warning("Package te, topi, hccl version check timed out, skip.")

def set_env(self):
if not self.tbe_path:


+ 1
- 0
mindspore/ccsrc/cxx_api/context.cc View File

@@ -20,6 +20,7 @@ namespace mindspore::api {
class Context::ContextImpl {
public:
ContextImpl() : device_target_("NotSet"), device_id_(0) {}
~ContextImpl() = default;
const std::string &GetDeviceTarget() const { return device_target_; }
void SetDeviceTarget(std::string_view device_target) { device_target_ = device_target; }
uint32_t GetDeviceID() const { return device_id_; }


+ 2
- 0
mindspore/ccsrc/cxx_api/graph/graph.cc View File

@@ -22,6 +22,8 @@ Graph::Graph(const std::shared_ptr<GraphData> &graph_data) : graph_data_(graph_d

Graph::Graph(std::shared_ptr<GraphData> &&graph_data) : graph_data_(graph_data) {}

Graph::~Graph() {}

ModelType Graph::ModelType() const {
MS_EXCEPTION_IF_NULL(graph_data_);
return graph_data_->ModelType();


+ 2
- 0
mindspore/ccsrc/cxx_api/graph/graph_data.cc View File

@@ -53,6 +53,8 @@ Graph::GraphData::GraphData(Buffer om_data, enum ModelType model_type)
#endif
}

Graph::GraphData::~GraphData() {}

FuncGraphPtr Graph::GraphData::GetFuncGraph() const {
if (model_type_ != ModelType::kMindIR) {
MS_LOG(ERROR) << "Invalid ModelType " << model_type_;


+ 2
- 0
mindspore/ccsrc/cxx_api/graph/graph_data.h View File

@@ -33,6 +33,8 @@ class Graph::GraphData {

GraphData(Buffer om_data, enum ModelType model_type);

~GraphData();

enum ModelType ModelType() const { return model_type_; }

FuncGraphPtr GetFuncGraph() const;


Loading…
Cancel
Save