You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

step_auto_parallel.h 2.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Copyright 2019 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef PARALLEL_STEP_AUTO_PARALLEL_H_
  17. #define PARALLEL_STEP_AUTO_PARALLEL_H_
  18. #include <map>
  19. #include <memory>
  20. #include <string>
  21. #include <vector>
  22. #include "frontend/optimizer/opt.h"
  23. #include "frontend/parallel/status.h"
  24. #include "ir/anf.h"
  25. #include "pipeline/jit/pipeline.h"
  26. namespace mindspore {
  27. namespace parallel {
  28. // main step of Auto-parallel
  29. bool StepAutoParallel(const FuncGraphPtr &func_graph, const opt::OptimizerPtr &optimizer);
  30. bool IsSplittableOperator(const std::string &);
  31. bool IsAutoParallelCareNode(const CNodePtr &);
  32. void InitCostGraph();
  33. Status ConstructCostGraphNodesByUniqueId(const std::vector<AnfNodePtr> &all_nodes, const FuncGraphPtr &root);
  34. Status ConstructCostGraphNodesByUniqueIdTC(const std::vector<AnfNodePtr> &all_nodes, const FuncGraphPtr &root);
  35. void ConstructCostGraphEdges(const std::vector<AnfNodePtr> &all_nodes);
  36. void AugmentCostGraph(const std::vector<AnfNodePtr> &all_nodes);
  37. Status ParallelStrategySearch(const std::vector<AnfNodePtr> &all_nodes, const FuncGraphPtr &root);
  38. Status ParallelStrategyRecSearch(const std::vector<AnfNodePtr> &all_nodes, const FuncGraphPtr &root);
  39. std::vector<std::vector<std::string>> RecInputTensorNames(const std::map<std::string, std::string>::iterator &it,
  40. std::vector<std::vector<std::string>> input_tensor_names);
  41. CNodePtr GetInternalOperatorInfo(const CNodePtr &cnode, const ValueNodePtr &prim_anf_node);
  42. void ModifyInputsTensorNameListIfOperatorInfoCreated(const std::string &name, const std::string &uniqueid);
  43. } // namespace parallel
  44. } // namespace mindspore
  45. #endif // PARALLEL_STEP_AUTO_PARALLEL_H_