mindspore 2.4.1__cp310-none-any.whl → 2.4.10__cp310-none-any.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 (242) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/_c_dataengine.cpython-310-aarch64-linux-gnu.so +0 -0
  3. mindspore/_c_expression.cpython-310-aarch64-linux-gnu.so +0 -0
  4. mindspore/_c_mindrecord.cpython-310-aarch64-linux-gnu.so +0 -0
  5. mindspore/bin/cache_server +0 -0
  6. mindspore/common/api.py +1 -4
  7. mindspore/common/file_system.py +2 -0
  8. mindspore/common/parameter.py +1 -14
  9. mindspore/communication/_comm_helper.py +5 -0
  10. mindspore/context.py +7 -2
  11. mindspore/dataset/engine/datasets_standard_format.py +17 -0
  12. mindspore/dataset/engine/datasets_user_defined.py +27 -1
  13. mindspore/experimental/llm_boost/__init__.py +2 -2
  14. mindspore/experimental/llm_boost/atb/boost_base.py +240 -64
  15. mindspore/experimental/llm_boost/atb/llama_boost.py +46 -29
  16. mindspore/experimental/llm_boost/atb/qwen_boost.py +47 -24
  17. mindspore/include/api/context.h +1 -1
  18. mindspore/include/dataset/constants.h +2 -2
  19. mindspore/lib/libavcodec.so.59 +0 -0
  20. mindspore/lib/libavdevice.so.59 +0 -0
  21. mindspore/lib/libavfilter.so.8 +0 -0
  22. mindspore/lib/libavformat.so.59 +0 -0
  23. mindspore/lib/libavutil.so.57 +0 -0
  24. mindspore/lib/libmindspore_backend.so +0 -0
  25. mindspore/lib/libmindspore_common.so +0 -0
  26. mindspore/lib/libmindspore_core.so +0 -0
  27. mindspore/lib/libmindspore_gpr.so.15 +0 -0
  28. mindspore/lib/libmindspore_grpc++.so.1 +0 -0
  29. mindspore/lib/libmindspore_grpc.so.15 +0 -0
  30. mindspore/lib/libmindspore_ops.so +0 -0
  31. mindspore/lib/libswresample.so.4 +0 -0
  32. mindspore/lib/libswscale.so.6 +0 -0
  33. mindspore/lib/plugin/ascend/custom_aicore_ops/op_proto/libop_proto.so +0 -0
  34. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
  35. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
  36. mindspore/lib/plugin/ascend/custom_ascendc_910/framework/npu_supported_ops.json +10 -0
  37. mindspore/lib/plugin/ascend/custom_ascendc_910/op_api/lib/libcust_opapi.so +0 -0
  38. mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910}/op_impl/ai_core/tbe/config/ascend910/aic-ascend910-ops-info.json +0 -42
  39. mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl → custom_ascendc_910/op_impl/ai_core/tbe/custom_ascendc_910_impl}/dynamic/decoder_kv_cache.py +51 -16
  40. mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl → custom_ascendc_910/op_impl/ai_core/tbe/custom_ascendc_910_impl}/dynamic/prompt_kv_cache.py +51 -16
  41. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.json +158 -0
  42. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.o +0 -0
  43. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.json +158 -0
  44. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.o +0 -0
  45. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.json +158 -0
  46. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.o +0 -0
  47. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.json +158 -0
  48. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.o +0 -0
  49. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.json +158 -0
  50. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.o +0 -0
  51. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.json +158 -0
  52. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.o +0 -0
  53. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.json +158 -0
  54. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.o +0 -0
  55. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.json +158 -0
  56. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.o +0 -0
  57. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.json +167 -0
  58. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.o +0 -0
  59. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.json +167 -0
  60. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.o +0 -0
  61. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.json +167 -0
  62. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.o +0 -0
  63. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.json +167 -0
  64. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.o +0 -0
  65. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.json +167 -0
  66. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.o +0 -0
  67. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.json +167 -0
  68. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.o +0 -0
  69. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.json +167 -0
  70. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.o +0 -0
  71. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.json +167 -0
  72. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/ascend910/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.o +0 -0
  73. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/config/ascend910/binary_info_config.json +302 -0
  74. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/config/ascend910/decoder_kv_cache.json +892 -0
  75. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/kernel/config/ascend910/prompt_kv_cache.json +892 -0
  76. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so +0 -0
  77. mindspore/lib/plugin/ascend/custom_ascendc_910/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
  78. mindspore/lib/plugin/ascend/custom_ascendc_910/op_proto/inc/op_proto.h +33 -0
  79. mindspore/lib/plugin/ascend/custom_ascendc_910/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so +0 -0
  80. mindspore/lib/plugin/ascend/custom_ascendc_910/version.info +1 -0
  81. mindspore/lib/plugin/ascend/custom_ascendc_910b/framework/npu_supported_ops.json +14 -0
  82. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_api/include/aclnn_decoder_kv_cache.h +59 -0
  83. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_api/include/aclnn_prompt_kv_cache.h +59 -0
  84. mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910b}/op_api/lib/libcust_opapi.so +0 -0
  85. mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl → custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl}/dynamic/all_finite.py +51 -16
  86. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/decoder_kv_cache.cpp +192 -0
  87. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/decoder_kv_cache.py +215 -0
  88. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/prompt_kv_cache.cpp +274 -0
  89. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl/dynamic/prompt_kv_cache.py +215 -0
  90. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/all_finite/AllFinite_52f59e2a65d9b1bb002de35c2819754a.json +80 -0
  91. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/all_finite/AllFinite_52f59e2a65d9b1bb002de35c2819754a.o +0 -0
  92. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/all_finite/AllFinite_6b5e50e30256d85838d6ce83514df20f.json +80 -0
  93. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/all_finite/AllFinite_6b5e50e30256d85838d6ce83514df20f.o +0 -0
  94. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/all_finite/AllFinite_74e4ac02880d452e3308c94af273562e.json +80 -0
  95. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/all_finite/AllFinite_74e4ac02880d452e3308c94af273562e.o +0 -0
  96. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.json +158 -0
  97. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.o +0 -0
  98. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.json +158 -0
  99. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.o +0 -0
  100. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.json +158 -0
  101. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.o +0 -0
  102. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.json +158 -0
  103. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.o +0 -0
  104. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.json +158 -0
  105. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.o +0 -0
  106. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.json +158 -0
  107. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.o +0 -0
  108. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.json +158 -0
  109. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.o +0 -0
  110. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.json +158 -0
  111. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.o +0 -0
  112. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.json +167 -0
  113. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.o +0 -0
  114. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.json +167 -0
  115. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.o +0 -0
  116. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.json +167 -0
  117. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.o +0 -0
  118. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.json +167 -0
  119. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.o +0 -0
  120. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.json +167 -0
  121. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.o +0 -0
  122. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.json +167 -0
  123. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.o +0 -0
  124. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.json +167 -0
  125. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.o +0 -0
  126. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.json +167 -0
  127. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend310p/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.o +0 -0
  128. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_52f59e2a65d9b1bb002de35c2819754a.json +78 -0
  129. mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.o → custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_52f59e2a65d9b1bb002de35c2819754a.o} +0 -0
  130. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_6b5e50e30256d85838d6ce83514df20f.json +78 -0
  131. mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.o → custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_6b5e50e30256d85838d6ce83514df20f.o} +0 -0
  132. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_74e4ac02880d452e3308c94af273562e.json +78 -0
  133. mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.o → custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_74e4ac02880d452e3308c94af273562e.o} +0 -0
  134. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.json +156 -0
  135. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_0d5520cc587ad44ce634bf3fbcffc272.o +0 -0
  136. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.json +156 -0
  137. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_20390d30b3c4c0d23167ccca6c030c2b.o +0 -0
  138. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.json +156 -0
  139. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_2d151f0b1d2db51faa2968d5b67544e2.o +0 -0
  140. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.json +156 -0
  141. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_561690ec17cc1def3d2fcf68c1b07b56.o +0 -0
  142. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.json +156 -0
  143. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_570f9aaa99e5e773b3dd0a33784363f4.o +0 -0
  144. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.json +156 -0
  145. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_59668a0f0764afb98fda8ab9e84126f1.o +0 -0
  146. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.json +156 -0
  147. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_91d9833e4792b70b670e4e2b916abd86.o +0 -0
  148. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.json +156 -0
  149. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/decoder_kv_cache/DecoderKvCache_c74cdc5fef094383401856f8519504af.o +0 -0
  150. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.json +165 -0
  151. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_0515c7b1a4cd614449e38c5e9a7e3f8d.o +0 -0
  152. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.json +165 -0
  153. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_09f22d898d6358c91e7c4fc48bac48e7.o +0 -0
  154. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.json +165 -0
  155. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_0cb9a6f894b925250227136e5aab7061.o +0 -0
  156. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.json +165 -0
  157. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_2fa8702ffd7ca85e9e194f62644415d5.o +0 -0
  158. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.json +165 -0
  159. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_570b62f187dfd439b64613d881deedb7.o +0 -0
  160. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.json +165 -0
  161. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_585218c11411ff84709b9e725b66c435.o +0 -0
  162. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.json +165 -0
  163. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_5c9365ccde170b358c5b126d69dae13e.o +0 -0
  164. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.json +165 -0
  165. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/ascend910b/prompt_kv_cache/PromptKvCache_6d97c45b7c43bc16fcff8baa5dacac4e.o +0 -0
  166. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend310p/all_finite.json +139 -0
  167. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend310p/binary_info_config.json +361 -0
  168. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend310p/decoder_kv_cache.json +892 -0
  169. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend310p/prompt_kv_cache.json +892 -0
  170. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910b/all_finite.json +139 -0
  171. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910b/binary_info_config.json +361 -0
  172. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910b/decoder_kv_cache.json +892 -0
  173. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/kernel/config/ascend910b/prompt_kv_cache.json +892 -0
  174. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so +0 -0
  175. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
  176. mindspore/lib/plugin/ascend/custom_ascendc_910b/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so +0 -0
  177. mindspore/lib/plugin/ascend/custom_ascendc_910b/version.info +1 -0
  178. mindspore/lib/plugin/ascend/libhccl_plugin.so +0 -0
  179. mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
  180. mindspore/lib/plugin/ascend/libmindspore_internal_kernels.so +0 -0
  181. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/PkgInspect +0 -0
  182. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/op_man +0 -0
  183. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_cann_host.so +0 -0
  184. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_host.so +0 -0
  185. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops.so +0 -0
  186. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops_static.a +0 -0
  187. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/liblcal_static.a +0 -0
  188. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/flash_attention_score_op.h +6 -1
  189. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_quant_acme_impl.so +0 -0
  190. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
  191. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
  192. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
  193. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
  194. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bsh_full_mix.o +0 -0
  195. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/flash_attention_score/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
  196. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_bf16_bnsd_mix.o +0 -0
  197. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_bf16_bsh_mix.o +0 -0
  198. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/paged_attention/paged_attention_fp16_bsh_mix.o +0 -0
  199. mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
  200. mindspore/nn/__init__.py +2 -0
  201. mindspore/nn/cell.py +16 -2
  202. mindspore/nn/layer/conv.py +3 -0
  203. mindspore/nn/layer/pooling.py +8 -10
  204. mindspore/nn/utils/__init__.py +22 -0
  205. mindspore/nn/utils/init.py +71 -0
  206. mindspore/ops/_grad_experimental/grad_comm_ops.py +25 -7
  207. mindspore/ops/auto_generate/gen_ops_prim.py +3 -2
  208. mindspore/ops/function/math_func.py +5 -4
  209. mindspore/ops/operations/comm_ops.py +4 -1
  210. mindspore/ops/operations/custom_ops.py +6 -4
  211. mindspore/ops/operations/nn_ops.py +7 -2
  212. mindspore/parallel/_auto_parallel_context.py +23 -4
  213. mindspore/parallel/_cell_wrapper.py +22 -3
  214. mindspore/parallel/_utils.py +0 -1
  215. mindspore/run_check/_check_version.py +17 -8
  216. mindspore/train/callback/_tft_register.py +7 -6
  217. mindspore/train/model.py +1 -0
  218. mindspore/train/serialization.py +4 -1
  219. mindspore/version.py +1 -1
  220. {mindspore-2.4.1.dist-info → mindspore-2.4.10.dist-info}/METADATA +2 -2
  221. {mindspore-2.4.1.dist-info → mindspore-2.4.10.dist-info}/RECORD +233 -106
  222. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.json +0 -58
  223. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.json +0 -58
  224. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.json +0 -58
  225. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/all_finite.json +0 -109
  226. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/binary_info_config.json +0 -38
  227. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so +0 -0
  228. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
  229. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so +0 -0
  230. mindspore/lib/plugin/ascend/custom_ascendc_ops/version.info +0 -1
  231. /mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910}/op_api/include/aclnn_decoder_kv_cache.h +0 -0
  232. /mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910}/op_api/include/aclnn_prompt_kv_cache.h +0 -0
  233. /mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl → custom_ascendc_910/op_impl/ai_core/tbe/custom_ascendc_910_impl}/dynamic/decoder_kv_cache.cpp +0 -0
  234. /mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl → custom_ascendc_910/op_impl/ai_core/tbe/custom_ascendc_910_impl}/dynamic/prompt_kv_cache.cpp +0 -0
  235. /mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910b}/op_api/include/aclnn_all_finite.h +0 -0
  236. /mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910b}/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +0 -0
  237. /mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910b}/op_impl/ai_core/tbe/config/ascend910b/aic-ascend910b-ops-info.json +0 -0
  238. /mindspore/lib/plugin/ascend/{custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl → custom_ascendc_910b/op_impl/ai_core/tbe/custom_ascendc_910b_impl}/dynamic/all_finite.cpp +0 -0
  239. /mindspore/lib/plugin/ascend/{custom_ascendc_ops → custom_ascendc_910b}/op_proto/inc/op_proto.h +0 -0
  240. {mindspore-2.4.1.dist-info → mindspore-2.4.10.dist-info}/WHEEL +0 -0
  241. {mindspore-2.4.1.dist-info → mindspore-2.4.10.dist-info}/entry_points.txt +0 -0
  242. {mindspore-2.4.1.dist-info → mindspore-2.4.10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ custom_opp_compiler_version=7.6.T8.0.B059
@@ -59,6 +59,7 @@ class FlashAttentionScoreOp : public MultiImplsOp {
59
59
  AcmeStatus UpdateShape(const ShapeInfoList &inputs_shape, const ShapeInfoList &outputs_shape) override;
60
60
  const std::string &TargetKernelName() const override { return target_kernel_name_; }
61
61
  ShapeInfoList InferShape(const ShapeInfoList &inputs_shape) const override;
62
+ AcmeStatus UpdateParam(const void *) override;
62
63
 
63
64
  protected:
64
65
  AcmeStatus InitImpl() override;
@@ -69,7 +70,7 @@ class FlashAttentionScoreOp : public MultiImplsOp {
69
70
  std::string DumpTilingAcme(const RawHostAddr host_ptr) const override;
70
71
  uint32_t GetLaunchCoreNumAcme() const override;
71
72
  AcmeStatus CreateAsdTensor();
72
- AcmeStatus UpdateAsdTensor(ShapeInfoList *asd_input_shape, ShapeInfoList *asd_output_shape);
73
+ AcmeStatus UpdateAsdTensor();
73
74
  AcmeStatus UpdateAsdParam();
74
75
  AcmeStatus CheckAsdopSupport() const;
75
76
 
@@ -78,6 +79,10 @@ class FlashAttentionScoreOp : public MultiImplsOp {
78
79
  FlashAttentionScoreParam param_;
79
80
  InputsDescList asd_inputs_;
80
81
  OutputsDescList asd_outputs_;
82
+ InputsImmutableInfoList asd_inputs_ii_;
83
+ InputsImmutableInfoList asd_outputs_ii_;
84
+ ShapeInfoList asd_input_shape_;
85
+ ShapeInfoList asd_output_shape_;
81
86
  uint64_t tiling_key_{0};
82
87
  bool has_attn_mask_{false};
83
88
  bool has_alibi_mask_{false};
mindspore/nn/__init__.py CHANGED
@@ -31,6 +31,7 @@ from mindspore.nn.wrap import *
31
31
  from mindspore.nn.grad import Jvp, Vjp
32
32
  from mindspore.nn.sparse import *
33
33
  from mindspore.nn.reinforcement import *
34
+ from mindspore.nn.utils import *
34
35
 
35
36
  __all__ = ["Cell", "GraphCell"]
36
37
  __all__.extend(layer.__all__)
@@ -43,5 +44,6 @@ __all__.extend(sparse.__all__)
43
44
  __all__.extend(learning_rate_schedule.__all__)
44
45
  __all__.extend(dynamic_lr.__all__)
45
46
  __all__.extend(reinforcement.__all__)
47
+ __all__.extend(utils.__all__)
46
48
 
47
49
  __all__.sort()
mindspore/nn/cell.py CHANGED
@@ -32,7 +32,8 @@ from mindspore import context
32
32
  from mindspore._c_expression import init_pipeline, update_func_graph_hyper_params, Cell_, FuncGraph, MixedPrecisionType
33
33
  from mindspore import _checkparam as Validator
34
34
  from mindspore.common import dtype as mstype
35
- from mindspore.common.api import _cell_graph_executor, _pynative_executor, _get_args_for_run, cells_compile_cache, _no_grad
35
+ from mindspore.common.api import _cell_graph_executor, _pynative_executor, _get_args_for_run, cells_compile_cache, \
36
+ _no_grad
36
37
  from mindspore.common.api import _generate_branch_control_input, _convert_python_data, _get_args_for_run_predict
37
38
  from mindspore.common.api import _process_dyn_args, _generate_dyn_compile_args
38
39
  from mindspore.common.parameter import Parameter, ParameterTuple
@@ -45,6 +46,7 @@ from mindspore._check_jit_forbidden_api import jit_forbidden_register
45
46
  from mindspore.common._decorator import deprecated
46
47
  from mindspore.common._register_for_recompute import recompute_registry
47
48
 
49
+
48
50
  class Cell(Cell_):
49
51
  """
50
52
  The basic building block of neural networks in MindSpore. The model or neural network layer should inherit this
@@ -2582,7 +2584,7 @@ class Cell(Cell_):
2582
2584
  """
2583
2585
  if context.get_context("mode") == context.PYNATIVE_MODE:
2584
2586
  self._recompute_cell = recompute_registry.get()(self.construct)
2585
- self._recompute()
2587
+ self._add_recompute_flag()
2586
2588
  return
2587
2589
  self._recompute()
2588
2590
  if 'mp_comm_recompute' in kwargs.keys():
@@ -2685,6 +2687,18 @@ class Cell(Cell_):
2685
2687
  if hasattr(network, "_amp_level"):
2686
2688
  self._amp_level = getattr(network, "_amp_level")
2687
2689
 
2690
+ def _add_recompute_flag(self):
2691
+ """
2692
+ Set pynative cell recomputed.
2693
+ """
2694
+ if not self._has_config_recompute:
2695
+ self._has_config_recompute = True
2696
+ else:
2697
+ logger.info("The recompute interface can be configured only once."
2698
+ " If the parent cell is configured, the child cell should not be configured")
2699
+ for cell in self.cells():
2700
+ cell._add_recompute_flag()
2701
+
2688
2702
 
2689
2703
  class GraphCell(Cell):
2690
2704
  """
@@ -862,6 +862,9 @@ class Conv3dTranspose(_Conv):
862
862
  However, when `stride` > 1, Conv2d maps multiple input shapes to the same output shape. Deconvolutional network
863
863
  can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf>`_.
864
864
 
865
+ Note:
866
+ For Atlas A2 training series products, `output_padding` is currently not supported.
867
+
865
868
  Args:
866
869
  in_channels (int): The channel number of the input tensor of the Conv3dTranspose layer.
867
870
  out_channels (int): The channel number of the output tensor of the Conv3dTranspose layer.
@@ -297,6 +297,9 @@ class MaxPool3d(_PoolNd):
297
297
  \max_{l=0, \ldots, d_{ker}-1} \max_{m=0, \ldots, h_{ker}-1} \max_{n=0, \ldots, w_{ker}-1}
298
298
  \text{input}(N_i, C_j, s_0 \times d + l, s_1 \times h + m, s_2 \times w + n)
299
299
 
300
+ .. note::
301
+ For Atlas training series products, this interface is not supported.
302
+
300
303
  Args:
301
304
  kernel_size (Union[int, tuple[int]]): The size of kernel used to take the maximum value,
302
305
  is an int number or a single element tuple that represents depth, height and width of the kernel, or a tuple
@@ -1032,16 +1035,11 @@ class AvgPool2dExt(Cell):
1032
1035
  >>> import numpy as np
1033
1036
  >>> from mindspore import Tensor, nn
1034
1037
  >>> from mindspore import dtype as mstype
1035
- >>> x = Tensor(np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4), mstype.float32)
1036
- >>> m = nn.AvgPool2dExt(x, kernel_size=2, stride=1)
1037
- >>> output = m(x)
1038
- >>> print(output)
1039
- [[[[ 2.5 3.5 4.5]
1040
- [ 6.5 7.5 8.5]]
1041
- [[14.5 15.5 16.5]
1042
- [18.5 19.5 20.5]]
1043
- [[26.5 27.5 28.5]
1044
- [30.5 31.5 32.5]]]]
1038
+ >>> input = Tensor(np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4), mstype.float32)
1039
+ >>> net = nn.AvgPool2dExt(kernel_size=2, stride=1)
1040
+ >>> output = net(input)
1041
+ >>> print(output.shape)
1042
+ (1, 3, 2, 3)
1045
1043
  """
1046
1044
  def __init__(self, kernel_size, stride=None, padding=0, ceil_mode=False,
1047
1045
  count_include_pad=True, divisor_override=None):
@@ -0,0 +1,22 @@
1
+ # Copyright 2024 Huawei Technologies Co., Ltd
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ============================================================================
15
+ """
16
+ nn.utils.
17
+ """
18
+ from __future__ import absolute_import
19
+
20
+ from .init import no_init_parameters
21
+
22
+ __all__ = ["no_init_parameters"]
@@ -0,0 +1,71 @@
1
+ # Copyright 2024 Huawei Technologies Co., Ltd
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ============================================================================
15
+
16
+ """init for nn.Cell."""
17
+ from __future__ import absolute_import
18
+
19
+ from contextlib import contextmanager
20
+ from mindspore.common.parameter import Parameter
21
+
22
+
23
+ @contextmanager
24
+ def no_init_parameters():
25
+ r"""
26
+ In scenarios where a checkpoint is loaded, parameters within the network instantiation will be
27
+ instantiated and occupy physical memory. Loading a checkpoint will replace the parameter values.
28
+ Decorator can be applied during network instantiation to add an attribute `init_param` to all
29
+ parameters within the current Cell, setting it to `init_param=False` .
30
+ When `init_param=False` is detected, the initialization of the parameters is skipped,
31
+ and the parameters are assigned values directly from the checkpoint during loading,
32
+ which can optimize performance and reduce physical memory usage.
33
+
34
+ Note:
35
+ Initialization of parameters created with `initializer` can only be skipped.
36
+ Parameters created by `Tensor` or `numpy` cannot be skipped.
37
+
38
+ Examples:
39
+ >>> import mindspore as ms
40
+ >>> from mindspore import nn, ops, load_checkpoint
41
+ >>> from mindspore.common.initializer import initializer
42
+ >>> from mindspore.nn.utils import no_init_parameters
43
+ >>> # 1. Add a decorator to the network that requires delayed initialization
44
+ >>> class Net(nn.Cell):
45
+ ... def __init__(self, in_channels, out_channels):
46
+ ... super().__init__()
47
+ ... self.weight = ms.Parameter(initializer("normal", [in_channels, out_channels], ms.float32))
48
+ ... self.bias = ms.Parameter(initializer("normal", [out_channels], ms.float32))
49
+ ... self.matmul = ops.MatMul()
50
+ ... self.add = ops.Add()
51
+ ...
52
+ ... def construct(self, x):
53
+ ... x = self.matmul(x, self.weight)
54
+ ... x = self.add(x, self.bias)
55
+ ... return x
56
+ >>> with no_init_parameters():
57
+ ... # After instantiation, all parameters in the net are not initialized
58
+ ... net = Net(28*28, 64)
59
+ >>> # 2. Load checkpoint parameters to the net
60
+ >>> load_checkpoint('./checkpoint/test_net.ckpt', net=net)
61
+ >>> # 3. After loading the checkpoint, manually call init_parameters_data() to initialize
62
+ >>> # the uninitialized parameters in the net if need. If the network is executed,
63
+ >>> # the framework will automatically call this interface.
64
+ >>> net.init_parameters_data()
65
+ """
66
+ init_class = Parameter
67
+ setattr(init_class, "init_param", False)
68
+ try:
69
+ yield
70
+ finally:
71
+ setattr(init_class, "init_param", True)
@@ -16,7 +16,7 @@
16
16
  """Generate bprop for comm ops"""
17
17
  from __future__ import division
18
18
  from __future__ import absolute_import
19
- from mindspore import Tensor
19
+ from mindspore import Tensor, Parameter
20
20
  import mindspore.common.dtype as mstype
21
21
  from mindspore.ops import functional as F
22
22
  from mindspore.communication import get_rank, get_group_size
@@ -37,6 +37,9 @@ from mindspore.ops._grad_experimental.grad_base import bprop_getters
37
37
  from mindspore.ops.operations import _grad_ops as G
38
38
  import mindspore as ms
39
39
 
40
+ _device_local_norm = None
41
+ if ms.get_auto_parallel_context("dump_device_local_norm"):
42
+ _device_local_norm = Parameter(Tensor(0.0, mstype.float32), name="_device_local_norm", requires_grad=False)
40
43
 
41
44
  @bprop_getters.register(AllReduce)
42
45
  def get_bprop_all_reduce(self):
@@ -247,10 +250,15 @@ def get_bprop_mirror_micro_step_operator(self):
247
250
  reduce_sum = P.ReduceSum(keep_dims=False)
248
251
  square = P.Square()
249
252
  dump_local_norm = ms.get_auto_parallel_context("dump_local_norm")
253
+ dump_device_local_norm = ms.get_auto_parallel_context("dump_device_local_norm")
250
254
 
251
255
  def bprop(x, z, out, dout):
252
- if dump_local_norm:
253
- z = F.depend(z, ln_print("dump local norm: ", param_name, reduce_sum(square((z)))))
256
+ if dump_local_norm or dump_device_local_norm:
257
+ _norm = reduce_sum(square((z)))
258
+ if dump_local_norm:
259
+ z = F.depend(z, ln_print("dump local norm: ", param_name, _norm))
260
+ if dump_device_local_norm:
261
+ z = F.depend(z, F.assign_add(_device_local_norm, cast(_norm, _device_local_norm.dtype)))
254
262
  real_grad = z
255
263
  assign_out = dout
256
264
  if issubclass_(F.typeof(dout), mstype.tensor_type):
@@ -373,6 +381,7 @@ def get_bprop_micro_step_all_gather(self):
373
381
  reduce_sum = P.ReduceSum(keep_dims=False)
374
382
  square = P.Square()
375
383
  dump_local_norm = ms.get_auto_parallel_context("dump_local_norm")
384
+ dump_device_local_norm = ms.get_auto_parallel_context("dump_device_local_norm")
376
385
 
377
386
  def bprop(x, z, out, dout):
378
387
  if with_mirror_operator:
@@ -383,8 +392,12 @@ def get_bprop_micro_step_all_gather(self):
383
392
  real_grad = F.tensor_mul(real_grad, scale)
384
393
  return (real_grad, cast(out_tensor, dtype(z)))
385
394
  z = F.depend(z, dout)
386
- if dump_local_norm:
387
- z = F.depend(z, ln_print("dump local norm: ", param_name, reduce_sum(square((z)))))
395
+ if dump_local_norm or dump_device_local_norm:
396
+ _norm = reduce_sum(square((z)))
397
+ if dump_local_norm:
398
+ z = F.depend(z, ln_print("dump local norm: ", param_name, _norm))
399
+ if dump_device_local_norm:
400
+ z = F.depend(z, F.assign_add(_device_local_norm, cast(_norm, _device_local_norm.dtype)))
388
401
  if not do_mirror:
389
402
  return (z, cast(out_tensor, dtype(z)))
390
403
  real_grad = reduce_scatter(z)
@@ -586,6 +599,7 @@ def get_bprop_mirror_operator(self):
586
599
 
587
600
  dev_num_r = 1.0
588
601
  dump_local_norm = ms.get_auto_parallel_context("dump_local_norm")
602
+ dump_device_local_norm = ms.get_auto_parallel_context("dump_device_local_norm")
589
603
  if dev_num > 1:
590
604
  dev_num_r = 1.0 / dev_num
591
605
  all_reduce = AllReduce(group=group)
@@ -608,8 +622,12 @@ def get_bprop_mirror_operator(self):
608
622
  all_reduce.set_prim_instance_name(instance_name)
609
623
 
610
624
  def bprop(x, out, dout):
611
- if dump_local_norm:
612
- dout = F.depend(dout, ln_print("dump local norm: ", param_name, reduce_sum(square((dout)))))
625
+ if dump_local_norm or dump_device_local_norm:
626
+ _norm = reduce_sum(square((dout)))
627
+ if dump_local_norm:
628
+ dout = F.depend(dout, ln_print("dump local norm: ", param_name, _norm))
629
+ if dump_device_local_norm:
630
+ dout = F.depend(dout, F.assign_add(_device_local_norm, cast(_norm, _device_local_norm.dtype)))
613
631
 
614
632
  if dev_num == 1:
615
633
  return (dout,)
@@ -2387,7 +2387,8 @@ class BatchMatMul(Primitive):
2387
2387
 
2388
2388
  \text{output}[..., :, :] = \text{matrix}(x[..., :, :]) * \text{matrix}(y[..., :, :])
2389
2389
 
2390
- The rank of both two input tensors must be same and not less than `2`.
2390
+ The rank of the two input tensors must be at least `2`, and the two input tensors must have the same rank
2391
+ if the environment is GPU or CPU.
2391
2392
 
2392
2393
  Args:
2393
2394
  transpose_a (bool): If ``True`` , the last two dimensions of `x` is transposed before multiplication.
@@ -9488,7 +9489,7 @@ class MatMul(Primitive):
9488
9489
 
9489
9490
  .. math::
9490
9491
 
9491
- Output_{i j}=\sum_{k=1}^{p} a_{i k} b_{k j}=a_{i 1} b_{1 j}+a_{i 2} b_{2 j}+\cdots+a_{i p} b_{p j}, p\in N
9492
+ (Output)_{i j}=\sum_{k=1}^{p} a_{i k} b_{k j}=a_{i 1} b_{1 j}+a_{i 2} b_{2 j}+\cdots+a_{i p} b_{p j}, p\in N
9492
9493
 
9493
9494
  where the :math:`i,j` indicates the output of the i-th row and j-th column element.
9494
9495
 
@@ -9088,9 +9088,9 @@ def remainder(input, other):
9088
9088
  both dtypes cannot be bool, and the shapes of them could be broadcast. When the inputs are one tensor
9089
9089
  and one scalar, the scalar could only be a constant.
9090
9090
 
9091
- .. math::
9091
+ .. code:: python
9092
9092
 
9093
- remainder(input, other) = input - input.div(other, rounding\_mode="floor") * other
9093
+ remainder(input, other) == input - input.div(other, rounding_mode="floor") * other
9094
9094
 
9095
9095
  .. warning::
9096
9096
  - When the elements of input exceed 2048, there might be accuracy problems.
@@ -9135,9 +9135,10 @@ def remainder_ext(input, other):
9135
9135
 
9136
9136
  Supports broadcasting to a common shape and implicit type promotion.
9137
9137
 
9138
- .. math::
9138
+ .. code:: python
9139
+
9140
+ remainder(input, other) == input - input.div(other, rounding_mode="floor") * other
9139
9141
 
9140
- remainder(input, other) = input - input.div(other, rounding\_mode="floor") * other
9141
9142
 
9142
9143
  Note:
9143
9144
  Complex inputs are not supported. At least one input need to be tensor, but not both are bool tensors.
@@ -988,6 +988,9 @@ class NeighborExchangeV2(Primitive):
988
988
  in the same subnet, please check the `details \
989
989
  <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#notes>`_.
990
990
 
991
+ Users need to ensure that the length of the received data `recv_lens` is consistent with that of
992
+ the sent data `send_lens`.
993
+
991
994
  Args:
992
995
  send_rank_ids (list(int)): Ranks which the data is sent to. 8 rank_ids represents 8 directions, if one
993
996
  direction is not send to , set it -1.
@@ -1393,7 +1396,7 @@ class Send(PrimitiveWithInfer):
1393
1396
  >>> def __init__(self):
1394
1397
  >>> super(SendNet, self).__init__()
1395
1398
  >>> self.depend = ops.Depend()
1396
- >>> self.send = ops.Send(st_tag=0, dest_rank=8, group="hccl_world_group")
1399
+ >>> self.send = ops.Send(sr_tag=0, dest_rank=8, group="hccl_world_group")
1397
1400
  >>>
1398
1401
  >>> def construct(self, x):
1399
1402
  >>> out = self.depend(x, self.send(x))
@@ -251,11 +251,13 @@ class Custom(ops.PrimitiveWithInfer):
251
251
 
252
252
  - "xxx.so" file generation:
253
253
 
254
- 1) GPU Platform: Given user defined "xxx.cu" file (ex. "{path}/add.cu"), use nvcc command to compile
255
- it.(ex. "nvcc --shared -Xcompiler -fPIC -o add.so add.cu")
254
+ 1) GPU Platform: Given user defined "xxx.cu" file (ex. "{path}/add.cu"),
255
+ use nvcc command to compile
256
+ it.(ex. :code:`nvcc --shared -Xcompiler -fPIC -o add.so add.cu`)
256
257
 
257
- 2) CPU Platform: Given user defined "xxx.cc" file (ex. "{path}/add.cc"), use g++/gcc command to
258
- compile it.(ex. "g++ --shared -fPIC -o add.so add.cc")
258
+ 2) CPU Platform: Given user defined "xxx.cc" file (ex. "{path}/add.cc"),
259
+ use g++/gcc command to
260
+ compile it.(ex. :code:`g++ --shared -fPIC -o add.so add.cc`)
259
261
 
260
262
  - Define a "xxx.cc"/"xxx.cu" file:
261
263
 
@@ -1430,6 +1430,9 @@ class MaxPool3D(Primitive):
1430
1430
  \max_{l=0, \ldots, d_{ker}-1} \max_{m=0, \ldots, h_{ker}-1} \max_{n=0, \ldots, w_{ker}-1}
1431
1431
  \text{input}(N_i, C_j, s_0 \times d + l, s_1 \times h + m, s_2 \times w + n)
1432
1432
 
1433
+ .. note::
1434
+ For Atlas training series products, this primitive is not supported.
1435
+
1433
1436
  Args:
1434
1437
  kernel_size (Union[int, tuple[int]]): The size of kernel used to take the maximum value,
1435
1438
  is an int number that represents depth, height and width of the kernel, or a tuple
@@ -4759,7 +4762,8 @@ class SparseApplyAdagradV2(Primitive):
4759
4762
  - **grad** (Tensor) - Gradients has the same shape as `var` and
4760
4763
  :math:`grad.shape[1:] = var.shape[1:]` if var.shape > 1.
4761
4764
  - **indices** (Tensor) - A vector of indices into the first dimension of `var` and `accum`.
4762
- The type must be int32 and :math:`indices.shape[0] = grad.shape[0]`.
4765
+ The type must be int32 and :math:`indices.shape[0] = grad.shape[0]`. The value of indices
4766
+ must be unique. Otherwise, the result is unpredictable.
4763
4767
 
4764
4768
  Outputs:
4765
4769
  Tuple of 2 tensors, the updated parameters.
@@ -7158,7 +7162,8 @@ class Conv3DTranspose(Primitive):
7158
7162
  \times (\text{kernel_size}[2] - 1) + \text{output_padding}[2] + 1
7159
7163
 
7160
7164
  Note:
7161
- In Ascend, only support :math:`group=1`.
7165
+ - In Ascend, only support :math:`group=1`.
7166
+ - For Atlas A2 training series products, `output_padding` is currently not supported.
7162
7167
 
7163
7168
  Args:
7164
7169
  in_channel (int): The channel of the input x.
@@ -187,6 +187,25 @@ class _AutoParallelContext:
187
187
  self.check_context_handle()
188
188
  return self._context_handle.get_dump_local_norm()
189
189
 
190
+ def set_dump_device_local_norm(self, dump_device_local_norm):
191
+ """
192
+ Set dump device local norm for auto parallel.
193
+
194
+ Args:
195
+ dump_device_local_norm (bool): User need to specify if he want to dump device local norm. Default: False
196
+
197
+ Raises:
198
+ ValueError: If the dump_device_local_norm in not a bool value.
199
+ """
200
+ self.check_context_handle()
201
+ self._context_handle.set_dump_device_local_norm(dump_device_local_norm)
202
+
203
+ def get_dump_device_local_norm(self):
204
+ """Get dump device local norm."""
205
+ self.check_context_handle()
206
+ return self._context_handle.get_dump_device_local_norm()
207
+
208
+
190
209
  def set_fusion_threshold_mb(self, fusion_threshold=64, comm_type="allreduce"):
191
210
  """
192
211
  Set fusion threshold (MB) for auto parallel.
@@ -1287,7 +1306,8 @@ _set_auto_parallel_context_func_map = {
1287
1306
  "enable_alltoall": auto_parallel_context().set_enable_alltoall,
1288
1307
  "strategy_ckpt_config": auto_parallel_context().set_strategy_ckpt_config,
1289
1308
  "comm_fusion": auto_parallel_context().set_comm_fusion,
1290
- "dump_local_norm": auto_parallel_context().set_dump_local_norm}
1309
+ "dump_local_norm": auto_parallel_context().set_dump_local_norm,
1310
+ "dump_device_local_norm": auto_parallel_context().set_dump_device_local_norm}
1291
1311
 
1292
1312
  _get_auto_parallel_context_func_map = {
1293
1313
  "device_num": auto_parallel_context().get_device_num,
@@ -1320,7 +1340,8 @@ _get_auto_parallel_context_func_map = {
1320
1340
  "comm_fusion": auto_parallel_context().get_comm_fusion,
1321
1341
  "strategy_ckpt_config": auto_parallel_context().get_strategy_ckpt_config,
1322
1342
  "full_batch_is_set": auto_parallel_context().get_full_batch_is_set,
1323
- "dump_local_norm": auto_parallel_context().get_dump_local_norm}
1343
+ "dump_local_norm": auto_parallel_context().get_dump_local_norm,
1344
+ "dump_device_local_norm": auto_parallel_context().get_dump_device_local_norm}
1324
1345
 
1325
1346
 
1326
1347
  @args_type_check(device_num=int, global_rank=int, gradients_mean=bool, gradient_fp32_sync=bool,
@@ -1431,8 +1452,6 @@ def _set_auto_parallel_context(**kwargs):
1431
1452
  - reducescatter: If communication fusion type is `reducescatter`. The `mode` contains: `auto`
1432
1453
  and `size`. Config is same as `allgather`.
1433
1454
 
1434
-
1435
-
1436
1455
  Raises:
1437
1456
  ValueError: If input key is not attribute in auto parallel context.
1438
1457
  """
@@ -24,7 +24,8 @@ from mindspore.ops import operations as P
24
24
  from mindspore.ops.operations.comm_ops import AllGather
25
25
  from mindspore.communication import GlobalComm
26
26
  from mindspore.common import jit
27
- from mindspore.communication import create_group
27
+ from mindspore.communication import create_group, destroy_group
28
+ from mindspore.communication._comm_helper import _get_group_map
28
29
  from mindspore.train._utils import get_parameter_redundancy, remove_param_redundancy
29
30
 
30
31
  _ALLGATHER_CELL = None
@@ -131,6 +132,21 @@ def _restore_parallel_context(origin_parallel_mode, origin_dataset_strategy):
131
132
  context.set_auto_parallel_context(dataset_strategy=origin_dataset_strategy)
132
133
 
133
134
 
135
+ def _get_group_name(group_map, group):
136
+ """get group name"""
137
+ group_name = str(group)
138
+ is_manual_communication_group = True
139
+ if group_map:
140
+ for name, rank_list in group_map.items():
141
+ if list(group) == rank_list:
142
+ group_name = name
143
+ is_manual_communication_group = False
144
+ break
145
+ if is_manual_communication_group:
146
+ create_group(str(group), list(group))
147
+ return group_name, is_manual_communication_group
148
+
149
+
134
150
  def _single_parameter_broadcast(net, layout, cur_rank=0, initial_rank=0):
135
151
  """
136
152
  Broadcast single parameter to other rank in data parallel dimension.
@@ -158,8 +174,9 @@ def _single_parameter_broadcast(net, layout, cur_rank=0, initial_rank=0):
158
174
  return
159
175
  net_param_dict = net.parameters_dict()
160
176
  _chang_parallel_context(origin_dataset_strategy)
177
+ group_map = _get_group_map()
161
178
  for group, params in param_redundancy_reversed.items():
162
- create_group(str(group), list(group))
179
+ group_name, is_manual_communication_group = _get_group_name(group_map, group)
163
180
  allreduce_input = []
164
181
  for param in params:
165
182
  if param not in net_param_dict:
@@ -170,7 +187,9 @@ def _single_parameter_broadcast(net, layout, cur_rank=0, initial_rank=0):
170
187
  allreduce_input.append(real_param)
171
188
  if not allreduce_input:
172
189
  continue
173
- communicator = SingleCommunicator(str(group))
190
+ communicator = SingleCommunicator(group_name)
174
191
  for real_param in allreduce_input:
175
192
  real_param.set_data(communicator(real_param), real_param.sliced)
193
+ if is_manual_communication_group:
194
+ destroy_group(group_name)
176
195
  _restore_parallel_context(origin_parallel_mode, origin_dataset_strategy)
@@ -127,7 +127,6 @@ class ParallelParamInitProfCtx:
127
127
 
128
128
  def _slice_parameter(parameter, phase, layout):
129
129
  """Slice python parameter obj according to the layout."""
130
- # graph_executor.updata_param_node_default_input(phase, {parameter.name: parameter})
131
130
  if getattr(parameter, "init_param", False):
132
131
  if layout is None:
133
132
  parameter.sliced = True