!3349 move the dependency of utils to core
Merge pull request !3349 from liubuyu/master
This commit is contained in:
commit
8e3d788942
|
@ -25,7 +25,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#ifndef ENABLE_ACL
|
||||
#include "mindspore/ccsrc/utils/log_adapter.h"
|
||||
#include "mindspore/core/utils/log_adapter.h"
|
||||
namespace mindspore::inference {
|
||||
#define MSI_LOG(level) MS_LOG(level)
|
||||
|
||||
|
|
|
@ -154,9 +154,11 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/base base)
|
|||
list(APPEND SUB_OBJECTS_SRC $<TARGET_OBJECTS:_mindspore_base_obj>)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/abstract abstract)
|
||||
list(APPEND SUB_OBJECTS_SRC $<TARGET_OBJECTS:_mindspore_abstract_obj>)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/utils util)
|
||||
list(APPEND SUB_OBJECTS_SRC $<TARGET_OBJECTS:_mindspore_core_utils_obj>)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/ir ir)
|
||||
list(APPEND SUB_OBJECTS_SRC $<TARGET_OBJECTS:_mindspore_ir_obj>)
|
||||
add_dependencies(_mindspore_base_obj _mindspore_ir_obj _mindspore_abstract_obj proto_input flat_input)
|
||||
add_dependencies(_mindspore_core_utils_obj _mindspore_base_obj _mindspore_ir_obj _mindspore_abstract_obj proto_input flat_input)
|
||||
|
||||
set_property(SOURCE ${SUB_OBJECTS_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_ME)
|
||||
add_library(mindspore STATIC ${SUB_OBJECTS_SRC})
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <utility>
|
||||
#include "backend/kernel_compiler/kernel.h"
|
||||
#include "ir/dtype.h"
|
||||
#include "ir/primitive.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "backend/kernel_compiler/common_utils.h"
|
||||
#include "backend/kernel_compiler/oplib/oplib.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "ir/meta_tensor.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace kernel {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <string>
|
||||
#include <memory>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "common/utils.h"
|
||||
#include "backend/kernel_compiler/oplib/opinfo.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <set>
|
||||
#include <deque>
|
||||
#include "utils/utils.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "common/utils.h"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "ir/primitive.h"
|
||||
#include "backend/optimizer/common/pass_manager.h"
|
||||
#include "backend/optimizer/common/pattern_engine.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "common/utils.h"
|
||||
#include "backend/optimizer/common/helper.h"
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include "backend/optimizer/common/visit.h"
|
||||
#include "base/base.h"
|
||||
#include "utils/log_adapter.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
|
||||
namespace mindspore {
|
||||
class CondVar;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include "base/base.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
|
||||
// namespace to support utils definition
|
||||
namespace mindspore {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <functional>
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/log_adapter.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "backend/session/kernel_graph.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "runtime/device/kernel_info.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "backend/optimizer/common/helper.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "backend/session/kernel_graph.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "ir/anf.h"
|
||||
#include "utils/convert_utils.h"
|
||||
#include "backend/optimizer/common/optimizer.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/convert_utils.h"
|
||||
#include "backend/optimizer/common/helper.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "backend/session/kernel_graph.h"
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "backend/optimizer/common/helper.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "vm/segment_runner.h"
|
||||
#include "debug/draw.h"
|
||||
#include "debug/anf_ir_dump.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace opt {
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "backend/optimizer/common/helper.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "vm/segment_runner.h"
|
||||
#include "debug/draw.h"
|
||||
#include "debug/anf_ir_dump.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace opt {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <utility>
|
||||
#include <functional>
|
||||
#include "backend/session/kernel_graph.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
#include "utils/contract.h"
|
||||
#include "utils/union_find_set.h"
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "utils/load_onnx/anf_converter.h"
|
||||
#include "backend/session/session_basic.h"
|
||||
#include "backend/session/session_factory.h"
|
||||
#include "utils/base_ref_utils.h"
|
||||
#include "base/base_ref_utils.h"
|
||||
#include "backend/kernel_compiler/oplib/oplib.h"
|
||||
|
||||
#ifdef ENABLE_D
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <unordered_set>
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/anf.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/contract.h"
|
||||
#include "runtime/device/kernel_info.h"
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "common/utils.h"
|
||||
#include "ir/dtype.h"
|
||||
#include "ir/anf.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#if (ENABLE_CPU && (ENABLE_D || ENABLE_GPU))
|
||||
#include "frontend/parallel/ps/worker.h"
|
||||
#include "frontend/parallel/ps/common.h"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "ir/primitive.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "runtime/device/kernel_info.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "backend/session/anf_runtime_algorithm.h"
|
||||
#include "frontend/parallel/ops_info/operator_info.h"
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
#include <unordered_set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/symbolic.h"
|
||||
#include "ir/meta_func_graph.h"
|
||||
#include "ir/param_value.h"
|
||||
#include "ir/tensor_py.h"
|
||||
#include "utils/tensor_py.h"
|
||||
#include "pipeline/jit/parse/python_adapter.h"
|
||||
#include "pipeline/jit/parse/resolve.h"
|
||||
#include "frontend/operator/composite/composite.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "debug/debugger/debugger.h"
|
||||
#include "proto/debug_graph.pb.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/symbolic.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "ir/meta_func_graph.h"
|
||||
#include "ir/param_value.h"
|
||||
#include "ir/primitive.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/utils.h"
|
||||
#include "frontend/operator/composite/composite.h"
|
||||
#include "ir/tensor.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "debug/anf_ir_utils.h"
|
||||
#include "proto/anf_ir.pb.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/symbolic.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -63,11 +63,6 @@ class Location {
|
|||
};
|
||||
class TraceContext;
|
||||
using TraceContextPtr = std::shared_ptr<TraceContext>;
|
||||
class FuncGraph;
|
||||
using FuncGraphPtr = std::shared_ptr<FuncGraph>;
|
||||
using FuncGraphWeakPtr = std::weak_ptr<FuncGraph>;
|
||||
class AnfNode;
|
||||
using AnfNodeWeakPtr = std::weak_ptr<AnfNode>;
|
||||
|
||||
class TraceManager {
|
||||
public:
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "ir/meta_func_graph.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "frontend/operator/composite/composite.h"
|
||||
#include "ir/tensor.h"
|
||||
#include "debug/anf_ir_utils.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <stack>
|
||||
#include <algorithm>
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
namespace mindspore {
|
||||
// namespace to support debug trace infomation
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "abstract/param_validator.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/convert_utils.h"
|
||||
#include "ir/tensor_py.h"
|
||||
#include "utils/tensor_py.h"
|
||||
|
||||
using mindspore::tensor::TensorPy;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "ir/anf.h"
|
||||
#include "ir/meta_func_graph.h"
|
||||
#include "debug/info.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "ir/manager.h"
|
||||
#include "pipeline/jit/resource.h"
|
||||
#include "pipeline/jit/parse/parse.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "ir/anf.h"
|
||||
#include "ir/meta_func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "pipeline/jit/resource.h"
|
||||
#include "frontend/optimizer/ad/adjoint.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
#include "frontend/optimizer/ad/grad.h"
|
||||
#include "frontend/optimizer/ad/dfunctor.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
#include "utils/symbolic.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace ad {
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#include "ir/anf.h"
|
||||
#include "ir/primitive_py.h"
|
||||
#include "utils/primitive_py.h"
|
||||
#include "ir/meta_func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "ir/manager.h"
|
||||
#include "pipeline/jit/resource.h"
|
||||
#include "pipeline/jit/parse/parse.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <algorithm>
|
||||
#include <string>
|
||||
#include "./common.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
namespace mindspore {
|
||||
/* namespace to support opt */
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <unordered_map>
|
||||
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/optimizer/optimizer_caller.h"
|
||||
#include "ir/pattern_matcher.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/optimizer/optimizer_caller.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "frontend/optimizer/optimizer.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace opt {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "frontend/optimizer/optimizer.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace opt {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "frontend/optimizer/optimizer.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/optimizer/optimizer_caller.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "frontend/optimizer/optimizer.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "frontend/optimizer/irpass.h"
|
||||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "frontend/operator/composite/composite.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "frontend/optimizer/anf_visitor.h"
|
||||
#include "ir/manager.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
#include "ir/anf.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "ir/primitive_py.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "utils/primitive_py.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "common/utils.h"
|
||||
|
||||
#include "pipeline/jit/parse/resolve.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "debug/draw.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace parallel {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "ir/param_value.h"
|
||||
#include "frontend/parallel/costmodel_context.h"
|
||||
#include "frontend/parallel/context.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "pipeline/jit/parse/python_adapter.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "frontend/operator/composite/composite.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "utils/symbolic.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
#include "debug/trace.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "debug/anf_ir_utils.h"
|
||||
#include "pipeline/jit/parse/parse_base.h"
|
||||
#include "pipeline/jit/parse/data_converter.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "ir/dtype.h"
|
||||
#include "pipeline/jit/parse/data_converter.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "frontend/optimizer/ad/dfunctor.h"
|
||||
#include "vm/segment_runner.h"
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <algorithm>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "abstract/utils.h"
|
||||
#include "debug/trace.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "frontend/operator/ops.h"
|
||||
#include "frontend/operator/composite/do_signature.h"
|
||||
#include "abstract/abstract_function.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/log_adapter.h"
|
||||
#include "utils/profile.h"
|
||||
#include "debug/trace.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "ir/anf.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "pipeline/jit/static_analysis/evaluator.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "frontend/operator/ops.h"
|
||||
#include "utils/symbolic.h"
|
||||
#include "ir/tensor.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "./common.h"
|
||||
#include "pipeline/jit/parse/data_converter.h"
|
||||
#include "debug/draw.h"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "utils/log_adapter.h"
|
||||
#include "ir/anf.h"
|
||||
#include "ir/primitive_py.h"
|
||||
#include "utils/primitive_py.h"
|
||||
#include "abstract/analysis_context.h"
|
||||
#include "abstract/abstract_function.h"
|
||||
#include "pipeline/jit/parse/parse.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "pybind11/pybind11.h"
|
||||
#include "ir/anf.h"
|
||||
#include "ir/primitive_py.h"
|
||||
#include "utils/primitive_py.h"
|
||||
#include "abstract/abstract_value.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "debug/trace.h"
|
||||
#include "ir/tensor_py.h"
|
||||
#include "utils/tensor_py.h"
|
||||
#include "ir/param_value.h"
|
||||
#include "utils/any.h"
|
||||
#include "utils/utils.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "pipeline/jit/parse/data_converter.h"
|
||||
#include "pipeline/jit/static_analysis/prim.h"
|
||||
#include "backend/session/session_factory.h"
|
||||
#include "ir/tensor_py.h"
|
||||
#include "utils/tensor_py.h"
|
||||
|
||||
const char SINGLE_OP_GRAPH[] = "single_op_graph";
|
||||
|
||||
|
|
|
@ -16,18 +16,8 @@
|
|||
|
||||
#include "pybind_api/export_flags.h"
|
||||
namespace mindspore {
|
||||
|
||||
const char PYTHON_PRIMITIVE_FLAG[] = "__primitive_flag__";
|
||||
const char PYTHON_CELL_AS_LIST[] = "__cell_as_list__";
|
||||
const char PYTHON_DATACLASS_FIELDS[] = "__dataclass_fields__";
|
||||
const char PYTHON_CLASS_MEMBER_NAMESPACE[] = "__class_member_namespace__";
|
||||
|
||||
// flag names
|
||||
const char GRAPH_FLAG_MIX_PRECISION_FP16[] = "fp16";
|
||||
const char GRAPH_FLAG_MIX_PRECISION_FP32[] = "fp32";
|
||||
const char GRAPH_FLAG_HAS_EFFECT[] = "has_effect";
|
||||
const char GRAPH_FLAG_EFFECT_PATIAL_ORDER[] = "_effect_patial_order";
|
||||
const char GRAPH_FLAG_RANDOM_EFFECT[] = "_random_effect";
|
||||
const char GRAPH_FLAG_SIDE_EFFECT[] = "_side_effect";
|
||||
|
||||
} // namespace mindspore
|
||||
|
|
|
@ -17,19 +17,12 @@
|
|||
#ifndef PYBIND_API_EXPORT_FLAGS_H_
|
||||
#define PYBIND_API_EXPORT_FLAGS_H_
|
||||
|
||||
#include "utils/flags.h"
|
||||
namespace mindspore {
|
||||
|
||||
extern const char PYTHON_PRIMITIVE_FLAG[];
|
||||
extern const char PYTHON_CELL_AS_LIST[];
|
||||
extern const char PYTHON_DATACLASS_FIELDS[];
|
||||
extern const char PYTHON_CLASS_MEMBER_NAMESPACE[];
|
||||
|
||||
extern const char GRAPH_FLAG_MIX_PRECISION_FP16[];
|
||||
extern const char GRAPH_FLAG_MIX_PRECISION_FP32[];
|
||||
extern const char GRAPH_FLAG_HAS_EFFECT[];
|
||||
extern const char GRAPH_FLAG_EFFECT_PATIAL_ORDER[];
|
||||
extern const char GRAPH_FLAG_RANDOM_EFFECT[];
|
||||
extern const char GRAPH_FLAG_SIDE_EFFECT[];
|
||||
} // namespace mindspore
|
||||
|
||||
#endif // PYBIND_API_EXPORT_FLAGS_H_
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "runtime/device/device_address.h"
|
||||
#include "ir/tensor.h"
|
||||
#include "utils/convert_utils.h"
|
||||
#include "predict/generator/utils/ir_model_util.h"
|
||||
#ifdef ENABLE_DUMP_E2E
|
||||
#include "debug/e2e_dump.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "utils/log_adapter.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/symbolic.h"
|
||||
#include "utils/config_manager.h"
|
||||
#include "utils/convert_utils.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "utils/base_ref_py.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
|
||||
namespace mindspore {
|
||||
class PyObjectRef : public BaseRef {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "pybind11/pybind11.h"
|
||||
#include "utils/convert_utils_base.h"
|
||||
#include "utils/any.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
#include "base/base.h"
|
||||
#include "ir/anf.h"
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ REGISTER_PYBIND_DEFINE(
|
|||
"dump_type", [](const TypePtr &t) { return t->type_id(); }, "dump type");
|
||||
(void)m_sub.def("str_to_type", &StringToType, "string to typeptr");
|
||||
(void)py::class_<Type, std::shared_ptr<Type>>(m_sub, "Type")
|
||||
.def("__eq__",
|
||||
.def("__eq__",
|
||||
[](const TypePtr &t1, const py::object &other) {
|
||||
if (!py::isinstance<Type>(other)) {
|
||||
return false;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
#include "utils/log_adapter.h"
|
||||
#include "utils/profile.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
// namespace to support intermediate representation definition
|
||||
namespace mindspore {
|
||||
|
@ -412,7 +412,7 @@ void Cloner::Lift() {
|
|||
auto sorted = BroadFirstSearchGraphUsed(*(manager_->roots().begin()));
|
||||
for (auto r_iter = sorted.rbegin(); r_iter != sorted.rend(); ++r_iter) {
|
||||
auto func_graph = *r_iter;
|
||||
auto iter = repl_func_graph_params_.find(func_graph);
|
||||
auto iter = repl_func_graph_params_.find(func_graph);
|
||||
if (iter != repl_func_graph_params_.end()) {
|
||||
auto ¶ms = iter->second;
|
||||
for (auto &cnode : func_graph->func_graph_cnodes_index()) {
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MINDSPORE_CORE_IR_FUNC_GRAPH_CLONER_H_
|
||||
#define MINDSPORE_CORE_IR_FUNC_GRAPH_CLONER_H_
|
||||
#ifndef MINDSPORE_CCSRC_UTILS_FUNC_GRAPH_CLONER_H_
|
||||
#define MINDSPORE_CCSRC_UTILS_FUNC_GRAPH_CLONER_H_
|
||||
|
||||
#include <functional>
|
||||
#include <list>
|
||||
|
@ -119,8 +119,6 @@ class Cloner {
|
|||
std::unordered_map<FuncGraphPtr, AnfNodePtrList> repl_func_graph_params_;
|
||||
};
|
||||
|
||||
FuncGraphPtr BasicClone(const FuncGraphPtr &func_graph);
|
||||
|
||||
AnfNodePtr InlineClone(const FuncGraphPtr &func_graph, const FuncGraphPtr &target_func_graph,
|
||||
const AnfNodePtrList &func_graph_args, const ScopePtr &scope = nullptr);
|
||||
|
||||
|
@ -132,4 +130,4 @@ FuncGraphPtr TransformableClone(const FuncGraphPtr &func_graph,
|
|||
const TraceInfoPtr &relation = std::make_shared<TraceTransform>());
|
||||
} // namespace mindspore
|
||||
|
||||
#endif // MINDSPORE_CORE_IR_FUNC_GRAPH_CLONER_H_
|
||||
#endif // MINDSPORE_CCSRC_UTILS_FUNC_GRAPH_CLONER_H_
|
|
@ -14,9 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ir/primitive_py.h"
|
||||
#include "utils/primitive_py.h"
|
||||
#include <mutex>
|
||||
#include <utility>
|
||||
#include "ir/signature.h"
|
||||
#include "./common.h"
|
||||
#include "pipeline/jit/parse/python_adapter.h"
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
#include <string>
|
||||
#include "pybind11/pybind11.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
#include "utils/convert_utils.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ir/tensor_py.h"
|
||||
#include "utils/tensor_py.h"
|
||||
|
||||
#include <functional>
|
||||
#include <numeric>
|
|
@ -21,6 +21,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include "ir/tensor.h"
|
||||
#include "pybind11/pybind11.h"
|
||||
#include "common/utils.h"
|
||||
#include "runtime/device/convert_tensor_utils.h"
|
||||
#include "./securec.h"
|
||||
#ifndef NO_DLIB
|
||||
|
@ -29,6 +31,7 @@
|
|||
#include "tdt/data_common.h"
|
||||
#endif
|
||||
|
||||
namespace py = pybind11;
|
||||
namespace mindspore {
|
||||
const char kShapeSeperator[] = ",";
|
||||
const char kShapeScalar[] = "[0]";
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "utils/log_adapter.h"
|
||||
#include "utils/utils.h"
|
||||
#include "ir/manager.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifdef ENABLE_GE
|
||||
#include "transform/graph_ir/convert.h"
|
||||
#endif
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
#include "debug/trace.h"
|
||||
#include "debug/anf_ir_dump.h"
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#include "ir/tensor.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "ir/manager.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "ir/primitive_py.h"
|
||||
#include "utils/func_graph_cloner.h"
|
||||
#include "utils/primitive_py.h"
|
||||
#include "utils/convert_utils.h"
|
||||
#include "utils/primitive_utils.h"
|
||||
#include "debug/draw.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "utils/log_adapter.h"
|
||||
#include "utils/hashing.h"
|
||||
#include "utils/any.h"
|
||||
#include "base/base.h"
|
||||
#include "ir/dtype.h"
|
||||
#include "ir/value.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "abstract/abstract_value.h"
|
||||
#include "utils/any.h"
|
||||
#include "utils/misc.h"
|
||||
#include "utils/convert_utils.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace abstract {
|
||||
|
|
|
@ -131,6 +131,11 @@ class AnfNode;
|
|||
using AnfNodePtr = std::shared_ptr<AnfNode>;
|
||||
using AnfNodePtrList = std::vector<AnfNodePtr>;
|
||||
using AnfNodeSet = OrderedSet<AnfNodePtr>;
|
||||
using AnfNodeWeakPtr = std::weak_ptr<AnfNode>;
|
||||
|
||||
class FuncGraph;
|
||||
using FuncGraphPtr = std::shared_ptr<FuncGraph>;
|
||||
using FuncGraphWeakPtr = std::weak_ptr<FuncGraph>;
|
||||
|
||||
namespace abstract {
|
||||
class AbstractBase;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
|
||||
namespace mindspore {
|
||||
iterator ConstIteratorCast(std::vector<BaseRef> *v, const const_iterator iter) {
|
|
@ -13,8 +13,8 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef MINDSPORE_CCSRC_UTILS_BASE_REF_H_
|
||||
#define MINDSPORE_CCSRC_UTILS_BASE_REF_H_
|
||||
#ifndef MINDSPORE_CORE_UTILS_BASE_REF_H_
|
||||
#define MINDSPORE_CORE_UTILS_BASE_REF_H_
|
||||
|
||||
#include <type_traits>
|
||||
#include <algorithm>
|
||||
|
@ -378,4 +378,4 @@ class RunFunctionRef : public BaseRef {
|
|||
};
|
||||
} // namespace mindspore
|
||||
|
||||
#endif // MINDSPORE_CCSRC_UTILS_NODE_REF_H_
|
||||
#endif // MINDSPORE_CORE_UTILS_BASE_REF_H_
|
|
@ -13,15 +13,14 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "base/base_ref_utils.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "utils/base_ref_utils.h"
|
||||
|
||||
#include "include/infer_tensor.h"
|
||||
#include "ir/tensor.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
||||
void IterateFindTensor(std::vector<tensor::TensorPtr> *msTensors, const VectorRef &ref_list) {
|
||||
for (size_t i = 0; i < ref_list.size(); ++i) {
|
||||
if (utils::isa<tensor::TensorPtr>(ref_list[i])) {
|
||||
|
@ -51,5 +50,4 @@ std::vector<tensor::TensorPtr> TransformVectorRefToMultiTensor(const VectorRef &
|
|||
}
|
||||
return msTensors;
|
||||
}
|
||||
|
||||
} // namespace mindspore
|
|
@ -16,9 +16,11 @@
|
|||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "utils/base_ref.h"
|
||||
|
||||
#include "include/infer_tensor.h"
|
||||
#include "ir/tensor.h"
|
||||
#include "base/base_ref.h"
|
||||
|
||||
|
||||
#ifndef MINDSPORE_CCSRC_UTILS_BASE_REF_UTILS_H
|
||||
#define MINDSPORE_CCSRC_UTILS_BASE_REF_UTILS_H
|
|
@ -22,8 +22,9 @@
|
|||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include "debug/trace.h"
|
||||
#include "debug/trace_base.h"
|
||||
#include "ir/manager.h"
|
||||
#include "utils/flags.h"
|
||||
#include "utils/ordered_set.h"
|
||||
#include "utils/convert_utils_base.h"
|
||||
#include "abstract/abstract_function.h"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "ir/manager.h"
|
||||
#include "utils/ordered_set.h"
|
||||
#include "utils/ordered_map.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
|
||||
namespace mindspore {
|
||||
using BaseRefCounterMap = OrderedMap<BaseRef, int, BaseRefHash>;
|
||||
|
@ -420,6 +420,8 @@ size_t NewFgSeenGeneration();
|
|||
std::shared_ptr<OrderedSet<CNodePtr>> FindRoots(const std::vector<CNodePtr> &segment);
|
||||
// Find the leaf cnodes of a segment of cnodes.
|
||||
std::shared_ptr<OrderedSet<CNodePtr>> FindLeaves(const std::vector<CNodePtr> &segment);
|
||||
|
||||
FuncGraphPtr BasicClone(const FuncGraphPtr &func_graph);
|
||||
} // namespace mindspore
|
||||
|
||||
#endif // MINDSPORE_CORE_IR_FUNC_GRAPH_H_
|
||||
|
|
|
@ -18,14 +18,11 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include "ir/manager.h"
|
||||
#include "ir/func_graph_cloner.h"
|
||||
#include "base/core_ops.h"
|
||||
#include "utils/ordered_set.h"
|
||||
#include "abstract/abstract_value.h"
|
||||
#include "debug/anf_ir_dump.h"
|
||||
#include "debug/trace.h"
|
||||
#include "debug/draw.h"
|
||||
#include "debug/label.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
@ -28,10 +28,10 @@
|
|||
#include <deque>
|
||||
#include <set>
|
||||
|
||||
#include "common/utils.h"
|
||||
#include "debug/label.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "utils/log_adapter.h"
|
||||
#include "utils/context/ms_context.h"
|
||||
|
||||
namespace mindspore {
|
||||
std::vector<AnfNodePtr> TopoSort(const AnfNodePtr &root, const SuccFunc &succ, const IncludeFunc &include) {
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
@ -31,8 +31,6 @@
|
|||
#include "debug/label.h"
|
||||
#include "utils/log_adapter.h"
|
||||
#include "common/utils.h"
|
||||
#include "pipeline/jit/parse/function_block.h"
|
||||
#include "pipeline/jit/parse/python_adapter.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace {
|
|
@ -19,12 +19,9 @@
|
|||
#include "ir/manager.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <list>
|
||||
|
||||
#include "debug/trace_base.h"
|
||||
#include "ir/func_graph.h"
|
||||
#include "utils/profile.h"
|
||||
#include "utils/convert_utils_base.h"
|
||||
#include "base/core_ops.h"
|
||||
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
#include "utils/signal.h"
|
||||
#include "utils/ordered_set.h"
|
||||
#include "utils/ordered_map.h"
|
||||
#include "utils/graph_utils.h"
|
||||
#include "ir/graph_utils.h"
|
||||
#include "utils/counter.h"
|
||||
#include "utils/hashing.h"
|
||||
#include "utils/base_ref.h"
|
||||
#include "base/base_ref.h"
|
||||
#include "ir/anf.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "base/base.h"
|
||||
#include "ir/dtype.h"
|
||||
#include "utils/convert_utils.h"
|
||||
#include "utils/convert_utils_base.h"
|
||||
#include "utils/hashing.h"
|
||||
|
||||
// brief mindspore namespace.
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
file(GLOB_RECURSE _UTIL_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
|
||||
set_property(SOURCE ${_UTIL_ALL_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_IR)
|
||||
add_library(_mindspore_core_utils_obj OBJECT ${_UTIL_ALL_SRC_FILES})
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue