mindspore 2.6.0__cp39-cp39-win_amd64.whl → 2.7.0rc1__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mindspore might be problematic. Click here for more details.

Files changed (380) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/__init__.py +1 -1
  3. mindspore/_c_dataengine.cp39-win_amd64.pyd +0 -0
  4. mindspore/_c_expression.cp39-win_amd64.pyd +0 -0
  5. mindspore/_c_mindrecord.cp39-win_amd64.pyd +0 -0
  6. mindspore/_checkparam.py +40 -9
  7. mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
  8. mindspore/_extends/optimize/cell_utils.py +96 -0
  9. mindspore/_extends/parse/__init__.py +2 -2
  10. mindspore/_extends/parse/compile_config.py +44 -22
  11. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -1
  12. mindspore/_extends/parse/parser.py +36 -61
  13. mindspore/_extends/parse/resources.py +39 -0
  14. mindspore/_extends/parse/standard_method.py +32 -13
  15. mindspore/_extends/parse/trope.py +8 -1
  16. mindspore/_extends/pijit/__init__.py +1 -2
  17. mindspore/amp.py +4 -4
  18. mindspore/avcodec-59.dll +0 -0
  19. mindspore/avdevice-59.dll +0 -0
  20. mindspore/avfilter-8.dll +0 -0
  21. mindspore/avformat-59.dll +0 -0
  22. mindspore/avutil-57.dll +0 -0
  23. mindspore/boost/adasum.py +1 -1
  24. mindspore/boost/boost_cell_wrapper.py +4 -4
  25. mindspore/common/__init__.py +27 -2
  26. mindspore/common/_grad_function.py +2 -1
  27. mindspore/common/_pijit_context.py +28 -7
  28. mindspore/common/_stub_tensor.py +1 -209
  29. mindspore/common/_tensor_cpp_method.py +1 -1
  30. mindspore/common/_tensor_docs.py +76 -15
  31. mindspore/common/api.py +193 -112
  32. mindspore/common/dtype.py +21 -11
  33. mindspore/common/dump.py +10 -15
  34. mindspore/common/generator.py +2 -3
  35. mindspore/common/hook_handle.py +11 -2
  36. mindspore/common/jit_config.py +1 -1
  37. mindspore/common/jit_trace.py +84 -105
  38. mindspore/common/parameter.py +26 -12
  39. mindspore/common/recompute.py +3 -3
  40. mindspore/common/sparse_tensor.py +0 -3
  41. mindspore/common/symbol.py +0 -1
  42. mindspore/common/tensor.py +48 -83
  43. mindspore/communication/_comm_helper.py +46 -4
  44. mindspore/communication/management.py +79 -7
  45. mindspore/context.py +38 -23
  46. mindspore/dataset/core/config.py +3 -3
  47. mindspore/dataset/engine/datasets.py +20 -7
  48. mindspore/dataset/engine/datasets_user_defined.py +32 -2
  49. mindspore/dataset/engine/iterators.py +2 -2
  50. mindspore/dataset/engine/obs/config_loader.py +2 -2
  51. mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +8 -0
  52. mindspore/dataset/transforms/py_transforms.py +7 -3
  53. mindspore/dataset/transforms/transforms.py +7 -3
  54. mindspore/dataset/vision/validators.py +1 -0
  55. mindspore/device_context/ascend/device.py +1 -1
  56. mindspore/device_context/gpu/__init__.py +2 -2
  57. mindspore/device_context/gpu/device.py +1 -1
  58. mindspore/device_context/gpu/op_precision.py +4 -2
  59. mindspore/device_context/gpu/op_tuning.py +6 -3
  60. mindspore/device_manager.py +16 -9
  61. mindspore/dnnl.dll +0 -0
  62. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +3 -5
  63. mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
  64. mindspore/experimental/optim/adadelta.py +13 -20
  65. mindspore/experimental/optim/adagrad.py +15 -22
  66. mindspore/experimental/optim/adam.py +17 -24
  67. mindspore/experimental/optim/adamax.py +14 -22
  68. mindspore/experimental/optim/adamw.py +28 -34
  69. mindspore/experimental/optim/asgd.py +15 -25
  70. mindspore/experimental/optim/lr_scheduler.py +27 -45
  71. mindspore/experimental/optim/nadam.py +14 -24
  72. mindspore/experimental/optim/optimizer.py +13 -23
  73. mindspore/experimental/optim/radam.py +18 -24
  74. mindspore/experimental/optim/rmsprop.py +14 -25
  75. mindspore/experimental/optim/rprop.py +15 -26
  76. mindspore/experimental/optim/sgd.py +9 -19
  77. mindspore/hal/__init__.py +4 -4
  78. mindspore/hal/contiguous_tensors_handle.py +2 -2
  79. mindspore/hal/memory.py +1 -0
  80. mindspore/include/api/cell.h +37 -1
  81. mindspore/include/api/delegate.h +10 -0
  82. mindspore/include/api/model.h +3 -0
  83. mindspore/include/api/types.h +2 -2
  84. mindspore/include/c_api/model_c.h +0 -58
  85. mindspore/include/c_api/tensor_c.h +0 -26
  86. mindspore/include/dataset/vision_ascend.h +1 -1
  87. mindspore/jpeg62.dll +0 -0
  88. mindspore/mindrecord/tools/cifar10.py +60 -11
  89. mindspore/mindrecord/tools/cifar10_to_mr.py +5 -0
  90. mindspore/mindspore_backend_common.dll +0 -0
  91. mindspore/mindspore_backend_manager.dll +0 -0
  92. mindspore/mindspore_common.dll +0 -0
  93. mindspore/mindspore_core.dll +0 -0
  94. mindspore/mindspore_cpu_res_manager.dll +0 -0
  95. mindspore/mindspore_dump.dll +0 -0
  96. mindspore/mindspore_frontend.dll +0 -0
  97. mindspore/mindspore_glog.dll +0 -0
  98. mindspore/mindspore_memory_pool.dll +0 -0
  99. mindspore/mindspore_ms_backend.dll +0 -0
  100. mindspore/mindspore_ops.dll +0 -0
  101. mindspore/mindspore_ops_host.dll +0 -0
  102. mindspore/mindspore_ops_kernel_common.dll +0 -0
  103. mindspore/mindspore_profiler.dll +0 -0
  104. mindspore/mindspore_pyboost.dll +0 -0
  105. mindspore/mindspore_pynative.dll +0 -0
  106. mindspore/mindspore_res_manager.dll +0 -0
  107. mindspore/mindspore_runtime_pipeline.dll +0 -0
  108. mindspore/mint/__init__.py +4 -44
  109. mindspore/mint/distributed/__init__.py +1 -0
  110. mindspore/mint/distributed/distributed.py +208 -5
  111. mindspore/mint/nn/__init__.py +1 -1
  112. mindspore/mint/nn/functional.py +53 -6
  113. mindspore/mint/nn/layer/_functions.py +164 -294
  114. mindspore/mint/nn/layer/activation.py +8 -6
  115. mindspore/mint/nn/layer/conv.py +122 -98
  116. mindspore/mint/nn/layer/normalization.py +8 -22
  117. mindspore/mint/optim/adam.py +19 -18
  118. mindspore/mint/optim/adamw.py +14 -8
  119. mindspore/mint/optim/sgd.py +5 -5
  120. mindspore/nn/cell.py +325 -499
  121. mindspore/nn/grad/cell_grad.py +11 -12
  122. mindspore/nn/layer/activation.py +32 -34
  123. mindspore/nn/layer/basic.py +67 -64
  124. mindspore/nn/layer/channel_shuffle.py +4 -4
  125. mindspore/nn/layer/combined.py +4 -2
  126. mindspore/nn/layer/conv.py +86 -85
  127. mindspore/nn/layer/dense.py +9 -7
  128. mindspore/nn/layer/embedding.py +50 -52
  129. mindspore/nn/layer/image.py +37 -39
  130. mindspore/nn/layer/math.py +111 -112
  131. mindspore/nn/layer/normalization.py +56 -44
  132. mindspore/nn/layer/pooling.py +58 -63
  133. mindspore/nn/layer/rnn_cells.py +33 -33
  134. mindspore/nn/layer/rnns.py +56 -56
  135. mindspore/nn/layer/thor_layer.py +74 -73
  136. mindspore/nn/layer/transformer.py +11 -1
  137. mindspore/nn/learning_rate_schedule.py +20 -20
  138. mindspore/nn/loss/loss.py +79 -81
  139. mindspore/nn/optim/adam.py +1 -1
  140. mindspore/nn/optim/adasum.py +2 -2
  141. mindspore/nn/optim/optimizer.py +1 -1
  142. mindspore/nn/optim/thor.py +2 -2
  143. mindspore/nn/probability/distribution/exponential.py +2 -1
  144. mindspore/nn/probability/distribution/poisson.py +2 -1
  145. mindspore/nn/sparse/sparse.py +3 -3
  146. mindspore/nn/wrap/cell_wrapper.py +34 -37
  147. mindspore/nn/wrap/grad_reducer.py +37 -37
  148. mindspore/nn/wrap/loss_scale.py +72 -74
  149. mindspore/numpy/array_creations.py +5 -5
  150. mindspore/numpy/fft.py +1 -1
  151. mindspore/numpy/math_ops.py +1 -1
  152. mindspore/opencv_core452.dll +0 -0
  153. mindspore/opencv_imgcodecs452.dll +0 -0
  154. mindspore/opencv_imgproc452.dll +0 -0
  155. mindspore/ops/_grad_experimental/grad_comm_ops.py +51 -13
  156. mindspore/ops/_grad_experimental/grad_debug_ops.py +14 -0
  157. mindspore/ops/_vmap/vmap_array_ops.py +6 -13
  158. mindspore/ops/_vmap/vmap_nn_ops.py +8 -16
  159. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +17 -8
  160. mindspore/ops/auto_generate/gen_extend_func.py +1 -51
  161. mindspore/ops/auto_generate/gen_ops_def.py +463 -257
  162. mindspore/ops/auto_generate/gen_ops_prim.py +1127 -885
  163. mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
  164. mindspore/ops/composite/__init__.py +10 -0
  165. mindspore/ops/composite/base.py +8 -4
  166. mindspore/ops/composite/multitype_ops/__init__.py +12 -1
  167. mindspore/ops/composite/multitype_ops/_compile_utils.py +132 -108
  168. mindspore/ops/composite/multitype_ops/add_impl.py +70 -2
  169. mindspore/ops/composite/multitype_ops/div_impl.py +49 -0
  170. mindspore/ops/composite/multitype_ops/floordiv_impl.py +29 -0
  171. mindspore/ops/composite/multitype_ops/getitem_impl.py +11 -0
  172. mindspore/ops/composite/multitype_ops/mod_impl.py +5 -3
  173. mindspore/ops/composite/multitype_ops/mul_impl.py +49 -0
  174. mindspore/ops/composite/multitype_ops/setitem_impl.py +57 -0
  175. mindspore/ops/composite/multitype_ops/sub_impl.py +34 -0
  176. mindspore/ops/composite/multitype_ops/zeros_like_impl.py +14 -0
  177. mindspore/ops/function/__init__.py +3 -1
  178. mindspore/ops/function/_add_attr_func.py +11 -6
  179. mindspore/ops/function/array_func.py +7 -94
  180. mindspore/ops/function/debug_func.py +4 -3
  181. mindspore/ops/function/grad/grad_func.py +1 -1
  182. mindspore/ops/function/math_func.py +21 -367
  183. mindspore/ops/function/nn_func.py +26 -41
  184. mindspore/ops/function/other_func.py +4 -1
  185. mindspore/ops/function/random_func.py +31 -4
  186. mindspore/ops/functional.py +0 -2
  187. mindspore/ops/functional_overload.py +463 -6
  188. mindspore/ops/op_info_register.py +21 -0
  189. mindspore/ops/operations/__init__.py +5 -2
  190. mindspore/ops/operations/_custom_ops_utils.py +675 -8
  191. mindspore/ops/operations/_inner_ops.py +3 -6
  192. mindspore/ops/operations/_sequence_ops.py +1 -1
  193. mindspore/ops/operations/comm_ops.py +185 -26
  194. mindspore/ops/operations/custom_ops.py +235 -172
  195. mindspore/ops/operations/debug_ops.py +55 -4
  196. mindspore/ops/operations/image_ops.py +13 -13
  197. mindspore/ops/operations/manually_defined/ops_def.py +15 -16
  198. mindspore/ops/operations/math_ops.py +3 -4
  199. mindspore/ops/operations/nn_ops.py +5 -6
  200. mindspore/ops/primitive.py +6 -10
  201. mindspore/ops/tensor_method.py +36 -4
  202. mindspore/ops_generate/api/cpp_create_prim_instance_helper_generator.py +1 -1
  203. mindspore/ops_generate/api/functional_map_cpp_generator.py +10 -9
  204. mindspore/ops_generate/api/functions_cc_generator.py +58 -10
  205. mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +1 -1
  206. mindspore/ops_generate/common/base_generator.py +14 -0
  207. mindspore/ops_generate/common/gen_constants.py +7 -2
  208. mindspore/ops_generate/common/gen_utils.py +0 -19
  209. mindspore/ops_generate/common/op_proto.py +11 -4
  210. mindspore/ops_generate/common/template.py +88 -11
  211. mindspore/ops_generate/gen_ops.py +1 -1
  212. mindspore/ops_generate/op_def/lite_ops_cpp_generator.py +4 -4
  213. mindspore/ops_generate/op_def/ops_name_h_generator.py +0 -3
  214. mindspore/ops_generate/op_def/ops_primitive_h_generator.py +0 -4
  215. mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -2
  216. mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +49 -8
  217. mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +2 -2
  218. mindspore/ops_generate/pyboost/gen_pyboost_func.py +31 -0
  219. mindspore/ops_generate/pyboost/op_template_parser.py +98 -72
  220. mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +70 -273
  221. mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +14 -6
  222. mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +316 -0
  223. mindspore/ops_generate/pyboost/pyboost_functions_py_generator.py +1 -1
  224. mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +5 -3
  225. mindspore/ops_generate/pyboost/pyboost_inner_prim_generator.py +1 -1
  226. mindspore/ops_generate/pyboost/pyboost_internal_functions_cpp_generator.py +76 -0
  227. mindspore/ops_generate/pyboost/pyboost_internal_functions_h_generator.py +76 -0
  228. mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +125 -0
  229. mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +4 -3
  230. mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +348 -61
  231. mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +1 -1
  232. mindspore/ops_generate/pyboost/pyboost_utils.py +118 -9
  233. mindspore/ops_generate/tensor_py_cc_generator.py +1 -24
  234. mindspore/parallel/_auto_parallel_context.py +4 -2
  235. mindspore/parallel/_cell_wrapper.py +106 -40
  236. mindspore/parallel/_parallel_serialization.py +1 -1
  237. mindspore/parallel/_ps_context.py +4 -6
  238. mindspore/parallel/_tensor.py +167 -12
  239. mindspore/parallel/_transformer/moe.py +1 -1
  240. mindspore/parallel/_transformer/transformer.py +13 -8
  241. mindspore/parallel/auto_parallel.py +12 -5
  242. mindspore/parallel/checkpoint_convert.py +3 -3
  243. mindspore/parallel/checkpoint_transform.py +3 -1
  244. mindspore/parallel/cluster/process_entity/_api.py +84 -48
  245. mindspore/parallel/cluster/process_entity/_utils.py +95 -7
  246. mindspore/parallel/cluster/run.py +43 -4
  247. mindspore/parallel/function/__init__.py +8 -1
  248. mindspore/parallel/function/reshard_func.py +1 -1
  249. mindspore/parallel/nn/__init__.py +15 -2
  250. mindspore/parallel/nn/parallel_cell_wrapper.py +9 -10
  251. mindspore/parallel/nn/parallel_grad_reducer.py +7 -6
  252. mindspore/parallel/shard.py +2 -2
  253. mindspore/parallel/transform_safetensors.py +462 -174
  254. mindspore/profiler/__init__.py +2 -1
  255. mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -7
  256. mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +3 -0
  257. mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +3 -0
  258. mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +3 -3
  259. mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
  260. mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +4 -4
  261. mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +3 -3
  262. mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +4 -1
  263. mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +2 -1
  264. mindspore/profiler/analysis/task_manager.py +1 -1
  265. mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +5 -1
  266. mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +2 -1
  267. mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +42 -22
  268. mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +3 -2
  269. mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +9 -5
  270. mindspore/profiler/analysis/viewer/ms_operator_details_viewer.py +132 -0
  271. mindspore/profiler/common/constant.py +16 -0
  272. mindspore/profiler/common/profiler_context.py +25 -27
  273. mindspore/profiler/common/profiler_info.py +0 -16
  274. mindspore/profiler/common/profiler_op_analyse.py +235 -0
  275. mindspore/profiler/common/profiler_output_path.py +23 -8
  276. mindspore/profiler/common/profiler_parameters.py +128 -35
  277. mindspore/profiler/dynamic_profile/__init__.py +0 -0
  278. mindspore/profiler/dynamic_profile/dynamic_monitor_proxy.py +39 -0
  279. mindspore/profiler/dynamic_profile/dynamic_profiler_config_context.py +666 -0
  280. mindspore/profiler/dynamic_profile/dynamic_profiler_utils.py +62 -0
  281. mindspore/profiler/dynamic_profiler.py +305 -314
  282. mindspore/profiler/envprofiler.py +12 -7
  283. mindspore/profiler/experimental_config.py +96 -6
  284. mindspore/profiler/mstx.py +33 -12
  285. mindspore/profiler/platform/__init__.py +2 -3
  286. mindspore/profiler/platform/npu_profiler.py +29 -19
  287. mindspore/profiler/profiler.py +35 -19
  288. mindspore/profiler/profiler_action_controller.py +64 -76
  289. mindspore/profiler/schedule.py +10 -4
  290. mindspore/rewrite/common/config.py +1 -0
  291. mindspore/rewrite/common/namer.py +1 -0
  292. mindspore/rewrite/common/namespace.py +1 -0
  293. mindspore/rewrite/node/node.py +31 -11
  294. mindspore/rewrite/parsers/assign_parser.py +1 -1
  295. mindspore/rewrite/symbol_tree/symbol_tree.py +1 -1
  296. mindspore/run_check/_check_version.py +7 -10
  297. mindspore/runtime/__init__.py +5 -5
  298. mindspore/runtime/event.py +10 -4
  299. mindspore/runtime/executor.py +60 -45
  300. mindspore/runtime/memory.py +21 -30
  301. mindspore/runtime/thread_bind_core.py +298 -164
  302. mindspore/safeguard/rewrite_obfuscation.py +12 -13
  303. mindspore/swresample-4.dll +0 -0
  304. mindspore/swscale-6.dll +0 -0
  305. mindspore/tinyxml2.dll +0 -0
  306. mindspore/train/_utils.py +6 -2
  307. mindspore/train/amp.py +43 -20
  308. mindspore/train/callback/__init__.py +5 -5
  309. mindspore/train/callback/_checkpoint.py +3 -6
  310. mindspore/train/callback/_flops_collector.py +1 -1
  311. mindspore/train/callback/_landscape.py +0 -1
  312. mindspore/train/callback/_train_fault_tolerance.py +71 -13
  313. mindspore/train/data_sink.py +11 -2
  314. mindspore/train/dataset_helper.py +9 -0
  315. mindspore/train/model.py +51 -33
  316. mindspore/train/serialization.py +133 -111
  317. mindspore/train/summary/summary_record.py +13 -2
  318. mindspore/turbojpeg.dll +0 -0
  319. mindspore/utils/__init__.py +3 -2
  320. mindspore/utils/dryrun.py +0 -6
  321. mindspore/utils/runtime_execution_order_check.py +162 -78
  322. mindspore/utils/sdc_detect.py +68 -0
  323. mindspore/utils/utils.py +6 -9
  324. mindspore/version.py +1 -1
  325. {mindspore-2.6.0.dist-info → mindspore-2.7.0rc1.dist-info}/METADATA +5 -4
  326. {mindspore-2.6.0.dist-info → mindspore-2.7.0rc1.dist-info}/RECORD +329 -367
  327. mindspore/_deprecated/jit.py +0 -198
  328. mindspore/experimental/es/__init__.py +0 -22
  329. mindspore/experimental/es/embedding_service.py +0 -891
  330. mindspore/experimental/es/embedding_service_layer.py +0 -581
  331. mindspore/profiler/parser/__init__.py +0 -14
  332. mindspore/profiler/parser/aicpu_data_parser.py +0 -272
  333. mindspore/profiler/parser/ascend_analysis/__init__.py +0 -14
  334. mindspore/profiler/parser/ascend_analysis/constant.py +0 -71
  335. mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -180
  336. mindspore/profiler/parser/ascend_analysis/function_event.py +0 -185
  337. mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +0 -136
  338. mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +0 -131
  339. mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +0 -104
  340. mindspore/profiler/parser/ascend_analysis/path_manager.py +0 -313
  341. mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +0 -123
  342. mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +0 -86
  343. mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +0 -75
  344. mindspore/profiler/parser/ascend_cluster_generator.py +0 -116
  345. mindspore/profiler/parser/ascend_communicate_generator.py +0 -314
  346. mindspore/profiler/parser/ascend_flops_generator.py +0 -116
  347. mindspore/profiler/parser/ascend_fpbp_generator.py +0 -82
  348. mindspore/profiler/parser/ascend_hccl_generator.py +0 -271
  349. mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
  350. mindspore/profiler/parser/ascend_memory_generator.py +0 -185
  351. mindspore/profiler/parser/ascend_msprof_exporter.py +0 -282
  352. mindspore/profiler/parser/ascend_msprof_generator.py +0 -187
  353. mindspore/profiler/parser/ascend_op_generator.py +0 -334
  354. mindspore/profiler/parser/ascend_steptrace_generator.py +0 -94
  355. mindspore/profiler/parser/ascend_timeline_generator.py +0 -545
  356. mindspore/profiler/parser/base_timeline_generator.py +0 -483
  357. mindspore/profiler/parser/container.py +0 -229
  358. mindspore/profiler/parser/cpu_gpu_timeline_generator.py +0 -697
  359. mindspore/profiler/parser/flops_parser.py +0 -531
  360. mindspore/profiler/parser/framework_enum.py +0 -111
  361. mindspore/profiler/parser/framework_parser.py +0 -464
  362. mindspore/profiler/parser/framework_struct.py +0 -61
  363. mindspore/profiler/parser/gpu_analysis/__init__.py +0 -14
  364. mindspore/profiler/parser/gpu_analysis/function_event.py +0 -44
  365. mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +0 -89
  366. mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +0 -72
  367. mindspore/profiler/parser/hccl_parser.py +0 -573
  368. mindspore/profiler/parser/hwts_log_parser.py +0 -122
  369. mindspore/profiler/parser/integrator.py +0 -526
  370. mindspore/profiler/parser/memory_usage_parser.py +0 -277
  371. mindspore/profiler/parser/minddata_analyzer.py +0 -800
  372. mindspore/profiler/parser/minddata_parser.py +0 -186
  373. mindspore/profiler/parser/minddata_pipeline_parser.py +0 -299
  374. mindspore/profiler/parser/op_intermediate_parser.py +0 -149
  375. mindspore/profiler/parser/optime_parser.py +0 -250
  376. mindspore/profiler/parser/profiler_info.py +0 -213
  377. mindspore/profiler/parser/step_trace_parser.py +0 -666
  378. {mindspore-2.6.0.dist-info → mindspore-2.7.0rc1.dist-info}/WHEEL +0 -0
  379. {mindspore-2.6.0.dist-info → mindspore-2.7.0rc1.dist-info}/entry_points.txt +0 -0
  380. {mindspore-2.6.0.dist-info → mindspore-2.7.0rc1.dist-info}/top_level.txt +0 -0
@@ -29,7 +29,7 @@ from common.gen_utils import save_file
29
29
  from common.op_proto import OpProto
30
30
  from common.base_generator import BaseGenerator
31
31
  from pyboost import pyboost_utils
32
- from pyboost.pyboost_utils import get_convert_type_str, is_optional_param, is_op_multi_output, get_input_args_type_str, is_tensor_list
32
+ from pyboost.pyboost_utils import get_convert_type_str, is_optional_param
33
33
 
34
34
  from .op_template_parser import OpTemplateParser
35
35
 
@@ -48,28 +48,16 @@ class PyboostFunctionsGenerator(BaseGenerator):
48
48
  self.pyboost_func_include_header_template = Template(
49
49
  f'#include "{K.MS_PYBOOST_BASE_PATH}/auto_generate/${{operator_name}}.h"\n'
50
50
  )
51
- self.convert_optional_to_value_template = Template(
52
- "auto ${output} = PyNativeAlgo::PyBoost::OptionalToValue(${input});\n"
53
- )
54
- self.convert_to_tensor_template = Template(
55
- 'auto ${output} = PyNativeAlgo::Common::ConvertStubNodeToTensor(${input}, ${need_contiguous}, '
56
- 'op_run_info->requires_grad);\n'
57
- )
58
- self.convert_to_tensor_list_template = Template(
59
- 'auto ${output} = PyNativeAlgo::Common::ConvertStubNodeToValueTuple(${input}, ${need_contiguous}, '
60
- 'op_run_info->requires_grad);\n'
61
- )
62
51
  self.convert_template = Template("auto $arg_name = converter.${convert_func}(args, $arg_index);\n")
63
- self.input_args_template = Template(" const ${arg_type}& ${arg_name},")
64
- self.PYBOOST_FUNCTION_TEMPLATE = template.PYBOOST_FUNCTION_TEMPLATE
65
- self.PYBOOST_COMM_FUNCTION_TEMPLATE = template.PYBOOST_COMM_FUNCTION_TEMPLATE
66
- self.PYBOOST_FUNCTION_DYNAMIC_OUTPUT_TEMPLATE = template.PYBOOST_FUNCTION_DYNAMIC_OUTPUT_TEMPLATE
52
+ self.PYBOOST_REGISTRY_BODY_CC_TEMPLATE = template.PYBOOST_REGISTRY_BODY_CC_TEMPLATE
67
53
  self.REGISTER_DEFINE_TEMPLATE = template.REGISTER_DEFINE_TEMPLATE
68
54
  self.REGISTER_TEMPLATE = template.REGISTER_TEMPLATE
69
- self.PYBOOST_HEADER_TEMPLATE = template.PYBOOST_FUNCTIONS_CC_TEMPLATE
55
+ self.PYBOOST_REGISTRY_CC_TEMPLATE = template.PYBOOST_REGISTRY_CC_TEMPLATE
70
56
  self.TENSOR_FUNC_CLASS_REG = template.TENSOR_FUNC_CLASS_REG
71
57
  self.OP_DEF_INC_HEAD_TEMPLATE = template.OP_DEF_INC_HEAD_TEMPLATE
72
58
 
59
+ self.pyboost_api_body_template = template.PYBOOST_API_BODY_CC_TEMPLATE
60
+
73
61
  def generate(self, work_path, op_protos):
74
62
  """
75
63
  Generates the C++ PyBoost functions and writes them to the specified files.
@@ -85,49 +73,18 @@ class PyboostFunctionsGenerator(BaseGenerator):
85
73
  Returns:
86
74
  None
87
75
  """
88
- pyboost_func_str = ''
76
+ pyboost_registry_body_str = ''
89
77
  pyboost_func_pybind_def = ''
90
78
  pyboost_func_include_headers_str = ''
91
79
  ops_inc_head_set = set()
92
80
  for op_proto in op_protos:
93
81
  if op_proto.op_dispatch is None or not op_proto.op_dispatch.enable:
94
82
  continue
83
+
84
+ pyboost_registry_body_str += self._get_pyboost_registry_body_str(op_proto)
85
+ pyboost_registry_body_str += template.NEW_LINE + template.NEW_LINE
86
+
95
87
  op_parser = OpTemplateParser(op_proto)
96
- op_pyboost_func_name = op_parser.get_pyboost_func_name()
97
- op_def_name_str = op_parser.get_op_def_name_str()
98
- type_num, same_type = op_parser.gen_signature_same_type_table()
99
- parser_body_str = self._generate_parser_func(op_proto)
100
- op_args_str = [op_arg.arg_name for op_arg in op_proto.op_args]
101
- convert_stub_str = self._get_convert_stub_str(op_proto)
102
- optional_to_value_str = self._get_optional_to_value_str(op_proto)
103
- call_args_str = self._get_call_args_str(op_proto)
104
- grad_args_str = self._get_grad_args_str(op_proto)
105
- cast_args_str = self._get_cast_to_value_str(op_proto)
106
- view_arg_str = self._get_first_str(op_proto.op_view, grad_args_str)
107
- op_input_args_str = self._get_input_args_str(op_proto)
108
- view_arg_str = ", " + view_arg_str if view_arg_str else ''
109
- multi_ouptut_str = 'Multi' if is_op_multi_output(op_proto.op_returns) else ''
110
- output_num_str = len(op_proto.op_returns)
111
- function_tpl = self._get_function_tpl(op_proto)
112
- pyboost_func_str += function_tpl.replace(func_name=op_pyboost_func_name,
113
- op_def_name=op_def_name_str,
114
- type_num=type_num,
115
- same_type=same_type,
116
- input_args=op_input_args_str,
117
- parser_body=parser_body_str,
118
- op_name=op_proto.op_class.name,
119
- class_name=op_proto.op_class.name,
120
- op_args=op_args_str,
121
- convert_stub=convert_stub_str,
122
- optional_to_value=optional_to_value_str,
123
- call_args=call_args_str,
124
- grad_args=grad_args_str,
125
- cast_args=cast_args_str,
126
- view_arg=view_arg_str,
127
- is_multi=multi_ouptut_str,
128
- output_num=output_num_str,
129
- operator_name=op_proto.op_name)
130
- pyboost_func_str = pyboost_func_str + template.NEW_LINE + template.NEW_LINE
131
88
  pyboost_op_name = op_parser.get_pyboost_name()
132
89
  pyboost_func_name = op_parser.get_pyboost_func_name()
133
90
  pyboost_func_pybind_def += self.REGISTER_DEFINE_TEMPLATE.replace(
@@ -139,21 +96,64 @@ class PyboostFunctionsGenerator(BaseGenerator):
139
96
  ops_inc_head_set.add(self.OP_DEF_INC_HEAD_TEMPLATE.replace(prefix_char=op_proto.op_class.name[0].lower()))
140
97
  register_func_str = self.REGISTER_TEMPLATE.replace(register_func=pyboost_func_pybind_def)
141
98
  function_class_register = self._get_function_class_register(op_protos)
142
- pyboost_func_file = self.PYBOOST_HEADER_TEMPLATE.replace(ops_inc=list(sorted(ops_inc_head_set)),
143
- include_op_header=pyboost_func_include_headers_str,
144
- function_body=pyboost_func_str,
145
- register_function_body=register_func_str,
146
- function_class_register=function_class_register)
99
+ pyboost_registry_file \
100
+ = self.PYBOOST_REGISTRY_CC_TEMPLATE.replace(ops_inc=list(sorted(ops_inc_head_set)),
101
+ include_op_header=pyboost_func_include_headers_str,
102
+ function_body=pyboost_registry_body_str,
103
+ register_function_body=register_func_str,
104
+ function_class_register=function_class_register)
147
105
  save_path = os.path.join(work_path, K.PIPELINE_PYBOOST_FUNC_GEN_PATH)
148
- file_name = "pyboost_functions.cc"
149
- save_file(save_path, file_name, pyboost_func_file)
106
+ file_name = "pyboost_registry.cc"
107
+ save_file(save_path, file_name, pyboost_registry_file)
108
+
109
+ pyboost_function_base_str = self.get_pyboost_api_body_str(op_protos)
110
+ save_path = os.path.join(work_path, K.PIPELINE_PYBOOST_FUNC_GEN_PATH)
111
+ file_name = "pyboost_api.cc"
112
+ save_file(save_path, file_name, pyboost_function_base_str)
113
+
114
+ def get_pyboost_api_body_str(self, op_protos):
115
+ """
116
+ Generates pyboost function base string.
150
117
 
151
- def _get_cast_args_with_type_str(self, op_proto, cast_args_str):
152
- args_with_type = []
153
- for op_arg, cast_args_name in zip(op_proto.op_args, cast_args_str):
154
- input_dtype = get_input_dtype(op_arg.arg_dtype, is_optional_param(op_arg))
155
- args_with_type.append("const " + input_dtype + " &" + cast_args_name)
156
- return list(args_with_type)
118
+ Args:
119
+ op_protos (list): A list of tensor op prototypes.
120
+
121
+ Returns:
122
+ str: pyboost function base string.
123
+ """
124
+ pyboost_api_cc_tpl = template.PYBOOST_API_CC_TEMPLATE
125
+ pyboost_api_body_str = ''
126
+ ops_inc_head_set = set()
127
+ for op_proto in op_protos:
128
+ if op_proto.op_dispatch is None or not op_proto.op_dispatch.enable:
129
+ continue
130
+ op_parser = OpTemplateParser(op_proto)
131
+ op_pyboost_func_name = op_parser.get_pyboost_func_name()
132
+ op_def_name_str = op_parser.get_op_def_name_str()
133
+ parser_body_str = self._generate_parser_func(op_proto)
134
+ op_args_str = [op_arg.arg_name for op_arg in op_proto.op_args]
135
+ pyboost_api_body_str += self.pyboost_api_body_template.replace(func_name=op_pyboost_func_name,
136
+ op_def_name=op_def_name_str,
137
+ parser_body=parser_body_str,
138
+ class_name=op_proto.op_class.name,
139
+ op_args=op_args_str)
140
+
141
+ ops_inc_head_set.add(self.OP_DEF_INC_HEAD_TEMPLATE.replace(prefix_char=op_proto.op_class.name[0].lower()))
142
+
143
+ return pyboost_api_cc_tpl.replace(pyboost_api_body=pyboost_api_body_str)
144
+
145
+ def _get_pyboost_registry_body_str(self, op_proto):
146
+ op_parser = OpTemplateParser(op_proto)
147
+ op_pyboost_func_name = op_parser.get_pyboost_func_name()
148
+ op_def_name_str = op_parser.get_op_def_name_str()
149
+ parser_body_str = self._generate_parser_func(op_proto)
150
+ op_args_str = [op_arg.arg_name for op_arg in op_proto.op_args]
151
+ registry_body_tpl = self.get_pyboost_registry_body_cc_tpl(op_proto)
152
+ return registry_body_tpl.replace(func_name=op_pyboost_func_name,
153
+ op_def_name=op_def_name_str,
154
+ parser_body=parser_body_str,
155
+ class_name=op_proto.op_class.name,
156
+ op_args=op_args_str)
157
157
 
158
158
  def _get_function_class_register(self, op_protos) -> str:
159
159
  """
@@ -192,216 +192,13 @@ class PyboostFunctionsGenerator(BaseGenerator):
192
192
  for index, op_arg in enumerate(op_proto.op_args):
193
193
  is_optional = is_optional_param(op_arg)
194
194
  if op_arg.is_type_id:
195
- convert_type_str = get_convert_type_str('type', is_optional)
195
+ convert_type_str = get_convert_type_str('type', is_optional, op_proto.op_view)
196
196
  else:
197
- convert_type_str = get_convert_type_str(op_arg.arg_dtype, is_optional)
197
+ convert_type_str = get_convert_type_str(op_arg.arg_dtype, is_optional, op_proto.op_view)
198
198
 
199
199
  parser_func_str += self.convert_template.replace(arg_name=op_arg.arg_name, convert_func=convert_type_str,
200
200
  arg_index=pyboost_utils.get_index(index))
201
201
  return parser_func_str
202
202
 
203
-
204
- def _get_input_args_str(self, op_proto: OpProto) -> str:
205
- """
206
- Generates the input arguments list for the pyboost operator.
207
-
208
- Args:
209
- op_proto (OpProto): The operator prototype containing the argument information.
210
-
211
- Returns:
212
- str: The generated input arguments list as a string.
213
- """
214
- parser_func_str = ''
215
- for _, op_arg in enumerate(op_proto.op_args):
216
- is_optional = is_optional_param(op_arg)
217
- if op_arg.is_type_id:
218
- arg_type_str = get_input_args_type_str('type', is_optional)
219
- else:
220
- arg_type_str = get_input_args_type_str(op_arg.arg_dtype, is_optional)
221
- parser_func_str += self.input_args_template.replace(arg_name=op_arg.arg_name, arg_type=arg_type_str)
222
- return parser_func_str[:-1]
223
-
224
-
225
- def _get_convert_stub_str(self, op_proto: OpProto):
226
- """
227
- Generates the conversion stub code for the operator's arguments.
228
-
229
- This method creates code for converting operator arguments to tensor format, depending on whether they
230
- are view operations or standard tensor operations.
231
-
232
- Args:
233
- op_proto (OpProto): The operator prototype containing the argument information.
234
-
235
- Returns:
236
- str: The generated conversion stub code as a string.
237
- """
238
- convert_stub_str = ''
239
- need_contiguous = 'true'
240
- if op_proto.op_view:
241
- # View/ACLNN op does not need to convert to contiguous tensor.
242
- need_contiguous = 'false'
243
- for op_arg in op_proto.op_args:
244
- if pyboost_utils.is_tensor(op_arg):
245
- convert_stub_output_name = op_arg.arg_name + '_optional' if is_optional_param(op_arg) \
246
- else op_arg.arg_name + "_tensor"
247
- convert_stub_str += self.convert_to_tensor_template.replace(input=op_arg.arg_name,
248
- output=convert_stub_output_name,
249
- need_contiguous=need_contiguous)
250
- elif pyboost_utils.is_tensor_list(op_arg):
251
- # To adapt the cases where TensorList is optional.
252
- convert_stub_output_name = op_arg.arg_name + '_optional' if is_optional_param(op_arg) \
253
- else op_arg.arg_name + "_tensor_list"
254
- convert_stub_str += self.convert_to_tensor_list_template.replace(input=op_arg.arg_name,
255
- output=convert_stub_output_name,
256
- need_contiguous=need_contiguous)
257
- return convert_stub_str
258
-
259
- def _get_optional_to_value_str(self, op_proto: OpProto):
260
- """
261
- Generates the code for converting optional arguments to their corresponding values.
262
-
263
- This method constructs code to handle optional arguments and converts them to their actual values,
264
- ensuring proper handling for tensors and lists.
265
-
266
- Args:
267
- op_proto (OpProto): The operator prototype containing the argument information.
268
-
269
- Returns:
270
- str: The generated code for converting optional arguments to values as a string.
271
- """
272
- optional_to_value_str = ''
273
- for op_arg in op_proto.op_args:
274
- if is_optional_param(op_arg):
275
- if pyboost_utils.is_tensor(op_arg) or pyboost_utils.is_tensor_list(op_arg):
276
- convert_stub_output_name = op_arg.arg_name + '_optional'
277
- cast_output = 'cast_' + convert_stub_output_name
278
- convert_optional_to_value_name = op_arg.arg_name + '_value'
279
- optional_to_value_str += \
280
- self.convert_optional_to_value_template.replace(input=cast_output,
281
- output=convert_optional_to_value_name)
282
- else:
283
- call_arg = op_arg.arg_name
284
- convert_optional_to_value_name = op_arg.arg_name + '_value'
285
- optional_to_value_str += \
286
- self.convert_optional_to_value_template.replace(input=call_arg,
287
- output=convert_optional_to_value_name)
288
- return optional_to_value_str
289
-
290
- def _get_call_args_str(self, op_proto: OpProto):
291
- """
292
- Generates the list of call arguments for the operator.
293
-
294
- This method constructs a list of argument names for the function call, adapting the names for
295
- optional tensors and tensor lists as needed.
296
-
297
- Args:
298
- op_proto (OpProto): The operator prototype containing the argument information.
299
-
300
- Returns:
301
- list: A list of formatted argument names for the function call.
302
- """
303
- call_args_str = []
304
- for op_arg in op_proto.op_args:
305
- if pyboost_utils.is_tensor(op_arg):
306
- convert_stub_output_name = op_arg.arg_name + '_optional' if is_optional_param(op_arg) \
307
- else op_arg.arg_name + "_tensor"
308
- call_arg = convert_stub_output_name
309
- elif pyboost_utils.is_tensor_list(op_arg):
310
- convert_stub_output_name = op_arg.arg_name + '_optional' if is_optional_param(op_arg) \
311
- else op_arg.arg_name + "_tensor_list"
312
- call_arg = convert_stub_output_name
313
- else:
314
- call_arg = op_arg.arg_name
315
- call_args_str.append(call_arg)
316
- return call_args_str
317
-
318
- def _get_grad_args_str(self, op_proto: OpProto):
319
- """
320
- Generates the list of gradient arguments for the operator.
321
-
322
- This method constructs a list of argument names used for computing gradients, adapting for
323
- optional tensors and tensor lists as necessary.
324
-
325
- Args:
326
- op_proto (OpProto): The operator prototype containing the argument information.
327
-
328
- Returns:
329
- list: A list of formatted gradient argument names.
330
- """
331
- grad_args_str = []
332
- for op_arg in op_proto.op_args:
333
- if pyboost_utils.is_tensor(op_arg):
334
- grad_arg = op_arg.arg_name + "_value" if is_optional_param(op_arg) else \
335
- f"cast_" + op_arg.arg_name + "_tensor"
336
- elif pyboost_utils.is_tensor_list(op_arg):
337
- if is_optional_param(op_arg):
338
- # To adapt the cases where TensorList is optional.
339
- convert_optional_to_value_name = op_arg.arg_name + "_value"
340
- grad_arg = convert_optional_to_value_name
341
- else:
342
- convert_stub_output_name = op_arg.arg_name + "_tensor_list"
343
- grad_arg = "cast_" + convert_stub_output_name
344
- else:
345
- grad_arg = "cast_" + op_arg.arg_name
346
- if is_optional_param(op_arg):
347
- convert_optional_to_value_name = op_arg.arg_name + "_value"
348
- grad_arg = convert_optional_to_value_name
349
- grad_args_str.append(grad_arg)
350
- return grad_args_str
351
-
352
- def _get_cast_to_value_str(self, op_proto: OpProto):
353
- """
354
- Generates the list of cast arguments for the operator.
355
-
356
- This method constructs a list of argument names that need to be cast to their corresponding types.
357
-
358
- Args:
359
- op_proto (OpProto): The operator prototype containing the argument information.
360
-
361
- Returns:
362
- list: A list of formatted cast argument names.
363
- """
364
- cast_args_str = []
365
- for op_arg in op_proto.op_args:
366
- cast_str = 'cast_'
367
- if pyboost_utils.is_tensor(op_arg):
368
- convert_stub_output_name = op_arg.arg_name + '_optional' if is_optional_param(op_arg) \
369
- else op_arg.arg_name + "_tensor"
370
- cast_arg = cast_str + convert_stub_output_name
371
- elif pyboost_utils.is_tensor_list(op_arg):
372
- # To adapt the cases where TensorList is optional.
373
- convert_stub_output_name = op_arg.arg_name + '_optional' if is_optional_param(op_arg) \
374
- else op_arg.arg_name + "_tensor_list"
375
- cast_arg = cast_str + convert_stub_output_name
376
- else:
377
- cast_arg = cast_str + op_arg.arg_name
378
- cast_args_str.append(cast_arg)
379
- return cast_args_str
380
-
381
- def _get_first_str(self, is_view_or_inplace: bool, grad_args: list):
382
- """
383
- Generates the view base str of arguments for the operator.
384
-
385
- This method constructs a list of argument names that need to be cast to their corresponding types.
386
-
387
- Args:
388
- is_view_or_inplace (bool): Whether the op is view op or inplace op.
389
- grad_args (list): grad args
390
-
391
- Returns:
392
- str: Formatted view or inplace first argument names.
393
- """
394
- arg_str = ''
395
- for i, grad_arg in enumerate(grad_args):
396
- if is_view_or_inplace and i == 0:
397
- arg_str = grad_arg
398
- break
399
- return arg_str
400
-
401
-
402
- def _get_function_tpl(self, op_proto: OpProto):
403
- if len(op_proto.op_returns) == 1 and is_tensor_list(op_proto.op_returns[0]):
404
- # op output size is unknown
405
- return self.PYBOOST_FUNCTION_DYNAMIC_OUTPUT_TEMPLATE
406
- return self.PYBOOST_COMM_FUNCTION_TEMPLATE \
407
- if op_proto.op_dispatch.is_comm_op else self.PYBOOST_FUNCTION_TEMPLATE
203
+ def get_pyboost_registry_body_cc_tpl(self, op_proto: OpProto):
204
+ return self.PYBOOST_REGISTRY_BODY_CC_TEMPLATE
@@ -42,11 +42,13 @@ class PyboostFunctionsHeaderGenerator(BaseGenerator):
42
42
  """Initializes the PyboostFunctionsHeaderGenerator with the necessary templates."""
43
43
  self.PYBOOST_FUNCTION_HEADER_TEMPLATE = template.PYBOOST_FUNCTION_HEADER_TEMPLATE
44
44
 
45
+ self.PYBOOST_CORE_HEADER_TEMPLATE = template.PYBOOST_CORE_HEADER_TEMPLATE
46
+
45
47
  self.pyboost_func_template = Template(
46
48
  'py::object PYNATIVE_EXPORT ${func_name}_Base(const PrimitivePtr &prim, const py::list &args);'
47
49
  )
48
50
  self.pyboost_op_func_template = Template(
49
- 'py::object ME_EXPORT ${func_name}_OP(const PrimitivePtr &prim, '
51
+ 'py::object PYNATIVE_EXPORT ${func_name}_OP(const PrimitivePtr &prim, '
50
52
  'const std::vector<ops::OP_DTYPE>& source_type, ${input_args});'
51
53
  )
52
54
  self.input_args_template = Template(" const ${arg_type}& ${arg_name},")
@@ -73,12 +75,18 @@ class PyboostFunctionsHeaderGenerator(BaseGenerator):
73
75
  prim_func_list.append(self.pyboost_func_template.replace(func_name=op_pyboost_func_name))
74
76
  op_func_list_str.append(self.pyboost_op_func_template.replace(func_name=op_pyboost_func_name,
75
77
  input_args=op_input_args_str))
76
- pyboost_func_h_str = self.PYBOOST_FUNCTION_HEADER_TEMPLATE.replace(prim_func_list=prim_func_list,
77
- op_func_list=op_func_list_str)
78
+ pyboost_func_h_str = self.PYBOOST_FUNCTION_HEADER_TEMPLATE.replace(prim_func_list=prim_func_list)
78
79
  save_path = os.path.join(work_path, K.PIPELINE_PYBOOST_FUNC_GEN_PATH)
79
- file_name = "pyboost_functions.h"
80
+ file_name = "pyboost_api.h"
80
81
  save_file(save_path, file_name, pyboost_func_h_str)
81
82
 
83
+ # impl header
84
+ pyboost_core_header_str = self.PYBOOST_CORE_HEADER_TEMPLATE.replace(op_func_list=op_func_list_str)
85
+ save_path = os.path.join(work_path, K.PIPELINE_PYBOOST_FUNC_GEN_PATH)
86
+ file_name = "pyboost_core.h"
87
+ save_file(save_path, file_name, pyboost_core_header_str)
88
+
89
+
82
90
  def _get_input_args_str(self, op_proto: OpProto) -> str:
83
91
  """
84
92
  Generates the input arguments list for the pyboost operator.
@@ -93,8 +101,8 @@ class PyboostFunctionsHeaderGenerator(BaseGenerator):
93
101
  for _, op_arg in enumerate(op_proto.op_args):
94
102
  is_optional = is_optional_param(op_arg)
95
103
  if op_arg.is_type_id:
96
- arg_type_str = get_input_args_type_str('type', is_optional)
104
+ arg_type_str = get_input_args_type_str('type', is_optional, op_proto.op_view)
97
105
  else:
98
- arg_type_str = get_input_args_type_str(op_arg.arg_dtype, is_optional)
106
+ arg_type_str = get_input_args_type_str(op_arg.arg_dtype, is_optional, op_proto.op_view)
99
107
  parser_func_str += self.input_args_template.replace(arg_name=op_arg.arg_name, arg_type=arg_type_str)
100
108
  return parser_func_str[:-1]