/** * Copyright 2019 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PARALLEL_STEP_AUTO_PARALLEL_H_ #define PARALLEL_STEP_AUTO_PARALLEL_H_ #include #include #include #include #include "frontend/optimizer/opt.h" #include "frontend/parallel/status.h" #include "ir/anf.h" #include "pipeline/jit/pipeline.h" namespace mindspore { namespace parallel { // main step of Auto-parallel bool StepAutoParallel(const FuncGraphPtr &func_graph, const opt::OptimizerPtr &optimizer); bool IsSplittableOperator(const std::string &); bool IsAutoParallelCareNode(const CNodePtr &); void InitCostGraph(); Status ConstructCostGraphNodesByUniqueId(const std::vector &all_nodes, const FuncGraphPtr &root); Status ConstructCostGraphNodesByUniqueIdTC(const std::vector &all_nodes, const FuncGraphPtr &root); void ConstructCostGraphEdges(const std::vector &all_nodes); void AugmentCostGraph(const std::vector &all_nodes); Status ParallelStrategySearch(const std::vector &all_nodes, const FuncGraphPtr &root); Status ParallelStrategyRecSearch(const std::vector &all_nodes, const FuncGraphPtr &root); std::vector> RecInputTensorNames(const std::map::iterator &it, std::vector> input_tensor_names); CNodePtr GetInternalOperatorInfo(const CNodePtr &cnode, const ValueNodePtr &prim_anf_node); void ModifyInputsTensorNameListIfOperatorInfoCreated(const std::string &name, const std::string &uniqueid); } // namespace parallel } // namespace mindspore #endif // PARALLEL_STEP_AUTO_PARALLEL_H_