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.

action.h 2.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 MINDSPORE_CCSRC_PIPELINE_JIT_ACTION_H_
  17. #define MINDSPORE_CCSRC_PIPELINE_JIT_ACTION_H_
  18. #include <vector>
  19. #include <functional>
  20. #include <utility>
  21. #include <string>
  22. #include "pipeline/jit/resource.h"
  23. #include "vm/segment_runner.h"
  24. namespace mindspore {
  25. extern const char kMsConvert[];
  26. namespace pipeline {
  27. using ActionItem = std::pair<std::string, std::function<bool(ResourcePtr)>>;
  28. bool ParseAction(const ResourcePtr &res);
  29. bool SymbolResolveAction(const ResourcePtr &res);
  30. bool AbstractSpecializeAction(const ResourcePtr &res);
  31. bool GeOptimizeAction(const ResourcePtr &res);
  32. bool VmOptimizeAction(const ResourcePtr &res);
  33. bool PynativeOptimizeAction(const ResourcePtr &res);
  34. bool PynativeElimOpt(const ResourcePtr &res);
  35. bool TaskEmitAction(const ResourcePtr &res);
  36. bool ExecuteAction(const ResourcePtr &res);
  37. bool StartPSWorkerAction(const ResourcePtr &res);
  38. bool StartPSServerAction(const ResourcePtr &res);
  39. bool StartPSSchedulerAction(const ResourcePtr &res);
  40. std::vector<ActionItem> GePipeline();
  41. std::vector<ActionItem> VmPipeline();
  42. std::vector<ActionItem> PServerPipeline();
  43. std::vector<ActionItem> PSchedulerPipeline();
  44. abstract::AnalysisResult AbstractAnalyze(const ResourcePtr &res, const FuncGraphPtr &func_graph,
  45. const abstract::AbstractBasePtrList &args_spec, bool clear = false);
  46. FuncGraphPtr ProgramSpecialize(const ResourcePtr &res, const FuncGraphPtr &func_graph,
  47. const abstract::AnalysisContextPtr &context);
  48. FuncGraphPtr Renormalize(const ResourcePtr &res, const FuncGraphPtr &func_graph,
  49. const abstract::AbstractBasePtrList &args_spec);
  50. } // namespace pipeline
  51. } // namespace mindspore
  52. #endif // MINDSPORE_CCSRC_PIPELINE_JIT_ACTION_H_