@cannbot-plugin/cannbot-harness 0.0.0-stage → 0.1.5

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.
Files changed (1291) hide show
  1. package/README.md +105 -3
  2. package/THIRD_PARTY_NOTICES.md +11 -0
  3. package/assets/ops-direct-invoke/.cannbot-bundle +1 -0
  4. package/assets/ops-direct-invoke/.claude-plugin/plugin.json +21 -0
  5. package/assets/ops-direct-invoke/.codex-plugin/plugin.json +30 -0
  6. package/assets/ops-direct-invoke/AGENTS.md +93 -0
  7. package/assets/ops-direct-invoke/LICENSE +38 -0
  8. package/assets/ops-direct-invoke/QUICKSTART.md +44 -0
  9. package/assets/ops-direct-invoke/README.md +219 -0
  10. package/assets/ops-direct-invoke/SKILLS_LICENSE +38 -0
  11. package/assets/ops-direct-invoke/agents/ops-direct-invoke-architect.md +39 -0
  12. package/assets/ops-direct-invoke/agents/ops-direct-invoke-developer.md +39 -0
  13. package/assets/ops-direct-invoke/agents/ops-direct-invoke-verifier.md +38 -0
  14. package/assets/ops-direct-invoke/init.sh +8 -0
  15. package/assets/ops-direct-invoke/plugin-install.json +24 -0
  16. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/SKILL.md +88 -0
  17. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/evals/evals.json +207 -0
  18. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-arithmetic.md +399 -0
  19. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-atomic.md +192 -0
  20. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-buffer.md +364 -0
  21. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-cross-gen-fixpipe.md +28 -0
  22. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-cross-gen-migration.md +91 -0
  23. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-crosscore-sync.md +259 -0
  24. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-datacopy.md +405 -0
  25. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-gathermask.md +243 -0
  26. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-gmm.md +260 -0
  27. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-hccl-host.md +187 -0
  28. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-hcomm.md +229 -0
  29. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-host-runtime.md +129 -0
  30. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-loaddata.md +196 -0
  31. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-matmul.md +364 -0
  32. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-mrgsort.md +636 -0
  33. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-pipeline.md +206 -0
  34. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-precision.md +146 -0
  35. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-quickref.md +192 -0
  36. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-reduce-pattern.md +132 -0
  37. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-reduce.md +282 -0
  38. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-repeat-limits.md +144 -0
  39. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-restrictions.md +200 -0
  40. package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-transpose.md +234 -0
  41. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/SKILL.md +245 -0
  42. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/block/block_mmad_glu.h +238 -0
  43. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/block/block_scheduler_group_matmul.h +106 -0
  44. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/block/weight_quant_matmul_block_mmad.h +362 -0
  45. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_dequant_swiglu.h +265 -0
  46. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_pertoken_quant_single_pass.h +252 -0
  47. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_pertoken_quant_two_pass_chunked.h +313 -0
  48. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_swiglu.h +171 -0
  49. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/cv_sync_constants.h +32 -0
  50. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/epilogue_fusion_membase.h +212 -0
  51. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/epilogue_fusion_regbase.h +324 -0
  52. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/online_softmax_cross_core_epilogue.h +396 -0
  53. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/online_softmax_per_tile_epilogue.h +421 -0
  54. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/kernel/group_matmul_kernel_cv1_v2.h +150 -0
  55. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/kernel/group_matmul_kernel_glu_fused.h +345 -0
  56. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/kernel/weight_quant_matmul_kernel.h +611 -0
  57. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/policy/dispatch_policy.h +63 -0
  58. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/utils/common_utils.h +101 -0
  59. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/utils/integral_constant.h +38 -0
  60. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_group_matmul_pertoken_quant_selector.h +119 -0
  61. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_group_matmul_tiling_data.h +38 -0
  62. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_matmul_tiling.h +457 -0
  63. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_matmul_tiling_data.h +50 -0
  64. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/mx/quant_matmul_mx_tiling.h +549 -0
  65. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/mx/quant_matmul_mx_tiling_data.h +47 -0
  66. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/weight_quant/weight_quant_tiling.h +428 -0
  67. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/weight_quant/weight_quant_tiling_data.h +59 -0
  68. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/evals/evals.json +234 -0
  69. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/assembly-recovery-method.md +106 -0
  70. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/dependency-trace-method.md +140 -0
  71. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/design-contract-method.md +78 -0
  72. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/investigation-report-template.md +249 -0
  73. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/source-investigation-method.md +131 -0
  74. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-cmake-build-guide.md +184 -0
  75. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-framework-overview.md +403 -0
  76. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-matmul-layout.md +322 -0
  77. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-sync-patterns.md +814 -0
  78. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/tensor-api-reference.md +589 -0
  79. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/blaze-design-template.md +593 -0
  80. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/blaze-plan-template.md +391 -0
  81. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/glu-development.md +755 -0
  82. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/glu-precision-diagnosis.md +113 -0
  83. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/group-matmul-delta.md +299 -0
  84. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/per-token-quant-development.md +450 -0
  85. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/tiling-selection.md +114 -0
  86. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/launcher/launcher-development.md +346 -0
  87. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-elementwise-then-vector-pertoken-quant/cube-matmul-then-vector-elementwise-then-vector-pertoken-quant-design.md +196 -0
  88. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-elementwise-then-vector-pertoken-quant/cube-matmul-then-vector-elementwise-then-vector-pertoken-quant-development.md +104 -0
  89. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-glu/cube-matmul-then-vector-glu-design.md +150 -0
  90. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-glu/cube-matmul-then-vector-glu-development.md +54 -0
  91. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-glu-then-vector-pertoken-quant/cube-matmul-then-vector-glu-then-vector-pertoken-quant-design.md +189 -0
  92. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-glu-then-vector-pertoken-quant/cube-matmul-then-vector-glu-then-vector-pertoken-quant-development.md +52 -0
  93. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-pertoken-quant/cube-matmul-then-vector-pertoken-quant-design.md +138 -0
  94. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-pertoken-quant/cube-matmul-then-vector-pertoken-quant-development.md +45 -0
  95. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/cube-matmul-then-vector-softmax-reduce-design.md +205 -0
  96. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/cube-matmul-then-vector-softmax-reduce-development.md +99 -0
  97. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/cv-sync-and-two-phase-entry.md +156 -0
  98. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/cv1-v2-adaptation-for-softmax-reduce.md +331 -0
  99. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/online-softmax-reduce-epilogue-design.md +174 -0
  100. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/reduce-adaptation-guide.md +204 -0
  101. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/block-l0c2ub-extension.md +75 -0
  102. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/elementwise-broadcast-epilogue-fusion-design.md +280 -0
  103. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/elementwise-broadcast-epilogue-fusion-development.md +202 -0
  104. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/epilogue-membase-design.md +82 -0
  105. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/epilogue-regbase-design.md +95 -0
  106. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/fused-kernel-development.md +71 -0
  107. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/precision-diagnosis.md +86 -0
  108. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/splitm-contract-and-debugging.md +86 -0
  109. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/index.md +14 -0
  110. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/scenario-extension-guide.md +84 -0
  111. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/layout-variant-boundary.md +76 -0
  112. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/pitfalls-and-diagnosis.md +124 -0
  113. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/prologue-ub-layout-design.md +135 -0
  114. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/prologue-vf-dequant-design.md +213 -0
  115. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/vc-sync-and-l1-layout-design.md +103 -0
  116. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/weight-dequant-prologue-fusion-design.md +289 -0
  117. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/weight-dequant-prologue-fusion-development.md +232 -0
  118. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/weight-quant-tiling-contract.md +83 -0
  119. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/troubleshooting/compile-troubleshooting.md +231 -0
  120. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/troubleshooting/optimized-runtime-hang.md +102 -0
  121. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step1-project-setup.md +170 -0
  122. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step2-blaze-investigation.md +192 -0
  123. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step3-kernel-design.md +246 -0
  124. package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step4-operator-development.md +166 -0
  125. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/SKILL.md +67 -0
  126. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/evals/evals.json +123 -0
  127. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/crash_workflow.md +193 -0
  128. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/memcheck/README.md +137 -0
  129. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/memcheck/automated_workflow.md +418 -0
  130. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/memcheck/mssanitizer_guide.md +181 -0
  131. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/scripts/memcheck_input.json.template +44 -0
  132. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/scripts/parse_plog.py +191 -0
  133. package/assets/ops-direct-invoke/skills/ascendc-crash-debug/scripts/run_memcheck_pre.sh +696 -0
  134. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/SKILL.md +105 -0
  135. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/evals/evals.json +128 -0
  136. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/CMakeLists.txt +131 -0
  137. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/README.md +55 -0
  138. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_extension/add_custom_torch.cpp +82 -0
  139. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_extension/ops.h +23 -0
  140. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_extension/register.cpp +42 -0
  141. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_host/add_custom.asc +149 -0
  142. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_host/data_utils.h +98 -0
  143. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_kernel/add_custom_kernel.asc +136 -0
  144. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_kernel/add_custom_tiling.h +31 -0
  145. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/run.sh +86 -0
  146. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/gen_data.py +49 -0
  147. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/golden.py +36 -0
  148. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/test_torch.py +90 -0
  149. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/verify_result.py +54 -0
  150. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kernel_launch_details.md +116 -0
  151. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/CMakeLists.txt +19 -0
  152. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/README.md +214 -0
  153. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/UPSTREAM.md +35 -0
  154. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/add_custom.cpp +99 -0
  155. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/add_custom_tiling.h +25 -0
  156. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeCCECompiler.cmake.in +15 -0
  157. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeCCEInformation.cmake +51 -0
  158. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeDetermineCCECompiler.cmake +119 -0
  159. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeTestCCECompiler.cmake +11 -0
  160. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/npu/CMakeLists.txt +36 -0
  161. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/data_utils.h +132 -0
  162. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/ext_lib/.gitattributes +1 -0
  163. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/input/.keep +0 -0
  164. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/main.cpp +108 -0
  165. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/output/.keep +0 -0
  166. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/run.sh +141 -0
  167. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/scripts/acl.json +1 -0
  168. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/scripts/gen_data.py +26 -0
  169. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/scripts/verify_result.py +54 -0
  170. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_vector_guide.md +172 -0
  171. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_guide.md +348 -0
  172. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/CMakeLists.txt +157 -0
  173. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/common/acl_utils.h +70 -0
  174. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/common/common_utils.h +84 -0
  175. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/common/io_utils.h +163 -0
  176. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_extension/matmul_blaze_torch.cpp +55 -0
  177. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_extension/ops.h +22 -0
  178. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_extension/register.cpp +22 -0
  179. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_kernel/include/blaze_custom/.gitkeep +0 -0
  180. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_kernel/matmul_blaze_kernel.cpp +33 -0
  181. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_kernel/matmul_blaze_kernel.h +99 -0
  182. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_tiling/matmul_constant.h +31 -0
  183. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_tiling/matmul_tiling_data.h +45 -0
  184. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_tiling/matmul_tiling_stub.h +77 -0
  185. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/run.sh +94 -0
  186. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/scripts/gen_data_mxfp4.py +152 -0
  187. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/scripts/gen_data_mxfp8.py +114 -0
  188. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/scripts/verify_result.py +132 -0
  189. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/test_matmul_blaze.cpp +145 -0
  190. package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/test_matmul_blaze_torch.py +141 -0
  191. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/SKILL.md +56 -0
  192. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/evals/evals.json +191 -0
  193. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/aclnn-api-doc-template.md +368 -0
  194. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/detailed-design-template.md +388 -0
  195. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/iteration-plan-template.md +45 -0
  196. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/operator-readme-template.md +234 -0
  197. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/operator-readme-template_bak.md +165 -0
  198. package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/requirement-analysis-template.md +131 -0
  199. package/assets/ops-direct-invoke/skills/ascendc-docs-search/SKILL.md +163 -0
  200. package/assets/ops-direct-invoke/skills/ascendc-docs-search/evals/evals.json +197 -0
  201. package/assets/ops-direct-invoke/skills/ascendc-docs-search/references/api-index.md +207 -0
  202. package/assets/ops-direct-invoke/skills/ascendc-docs-search/references/compatibility.md +141 -0
  203. package/assets/ops-direct-invoke/skills/ascendc-docs-search/references/example-catalog.md +197 -0
  204. package/assets/ops-direct-invoke/skills/ascendc-docs-search/requirements.txt +2 -0
  205. package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/__init__.py +6 -0
  206. package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/ascend_content_fetcher.py +479 -0
  207. package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/ascend_search_client.py +201 -0
  208. package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/ascend_search_skill.py +163 -0
  209. package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/clean_markdown.py +489 -0
  210. package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/find_api_doc.sh +54 -0
  211. package/assets/ops-direct-invoke/skills/ascendc-env-check/SKILL.md +123 -0
  212. package/assets/ops-direct-invoke/skills/ascendc-env-check/evals/evals.json +211 -0
  213. package/assets/ops-direct-invoke/skills/ascendc-env-check/references/asys_commands.md +64 -0
  214. package/assets/ops-direct-invoke/skills/ascendc-env-check/references/env_config_guide.md +96 -0
  215. package/assets/ops-direct-invoke/skills/ascendc-env-check/references/kirin_platform_guide.md +11 -0
  216. package/assets/ops-direct-invoke/skills/ascendc-env-check/references/npu_commands.md +114 -0
  217. package/assets/ops-direct-invoke/skills/ascendc-env-check/references/troubleshooting.md +177 -0
  218. package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/_npu_info.py +763 -0
  219. package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/check_env.sh +320 -0
  220. package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/get_npu_arch.py +488 -0
  221. package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/npu_info.sh +228 -0
  222. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/SKILL.md +370 -0
  223. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/CONTEXT.md +85 -0
  224. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/MC2-CAPABILITY-PLAN.md +111 -0
  225. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/adr/0001-mc2-skill-not-plugin.md +31 -0
  226. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/adr/0002-decision-stack-path-registry.md +33 -0
  227. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/evals/evals.json +315 -0
  228. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/capability-declaration.md +97 -0
  229. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/codebase-analysis.md +34 -0
  230. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/architecture.md +444 -0
  231. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/communication.md +669 -0
  232. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/compute.md +587 -0
  233. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/fusion.md +550 -0
  234. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/design-template.md +313 -0
  235. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/dev-methodology.md +111 -0
  236. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/development-guide.md +445 -0
  237. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/host-and-testing.md +285 -0
  238. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/operator-anatomy.md +739 -0
  239. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/paradigm-mapping.md +93 -0
  240. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/plan-template.md +235 -0
  241. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/review-checklist.md +96 -0
  242. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/compute-first-reduce-scatter/design.md +107 -0
  243. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/compute-first-reduce-scatter/development.md +272 -0
  244. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/get-all-gather-quant-matmul/design.md +93 -0
  245. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/get-all-gather-quant-matmul/development.md +70 -0
  246. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/index.md +47 -0
  247. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-gather-quant-matmul/design.md +83 -0
  248. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-gather-quant-matmul/development.md +62 -0
  249. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-to-all-quant-matmul/design.md +106 -0
  250. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-to-all-quant-matmul/development.md +74 -0
  251. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/troubleshooting/failure-navigation.md +47 -0
  252. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/troubleshooting/optimization-playbook.md +143 -0
  253. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step1-project-setup.md +52 -0
  254. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step2-investigation.md +89 -0
  255. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step3-design.md +69 -0
  256. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step4-implementation.md +29 -0
  257. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow_integration.md +122 -0
  258. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/api-rules/dispatch-combine-contracts.md +60 -0
  259. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/api-rules/index.md +71 -0
  260. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/api-rules/mte-address-access.md +374 -0
  261. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/api-rules/sync-and-visibility.md +105 -0
  262. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/combine-reading-guide.md +102 -0
  263. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/common-reading-method.md +226 -0
  264. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/design-overview.md +558 -0
  265. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/dispatch-reading-guide.md +81 -0
  266. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/kernel-execution-units.md +189 -0
  267. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/mega-moe-reading-guide.md +123 -0
  268. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/build-framework.md +177 -0
  269. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/change-routing.md +18 -0
  270. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/combine-dataflow.md +144 -0
  271. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/dispatch-dataflow.md +128 -0
  272. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/index.md +98 -0
  273. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/CMakeLists.txt +51 -0
  274. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/README.md +131 -0
  275. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/build.sh +56 -0
  276. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/include/moe_dispatch_base_compat.h +113 -0
  277. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/include/tiling_data.h +100 -0
  278. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/include/utils.h +57 -0
  279. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/kernel/moe_dispatch.h +524 -0
  280. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/kernel/mte_dispatch_comm.h +324 -0
  281. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/moe_dispatch.cpp +67 -0
  282. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/run.sh +61 -0
  283. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/run_multi_data_test.sh +80 -0
  284. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/scripts/verify_dispatch.py +248 -0
  285. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/moe_dispatch_direct_invoke_sample/test/test_moe_dispatch.cpp +679 -0
  286. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/sample-helper-map.md +47 -0
  287. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/spec-template.md +78 -0
  288. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/tiling-scheme/double-buffer-protocol.md +69 -0
  289. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/tiling-scheme/index.md +111 -0
  290. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/tiling-scheme/multi-core-formulas.md +126 -0
  291. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/tiling-scheme/split-core-design.md +100 -0
  292. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/tiling-scheme/window-memory-layout.md +199 -0
  293. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/CMakeLists.txt +95 -0
  294. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/cmake/ascend.cmake +59 -0
  295. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/cmake/shmem.cmake +75 -0
  296. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/cmake/tensor_api.cmake +48 -0
  297. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/common/host_utils/acl_utils.h +73 -0
  298. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/common/host_utils/common_utils.h +181 -0
  299. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/common/host_utils/io_utils.h +175 -0
  300. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/common/kernel_utils/common_utils.h +99 -0
  301. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/common/kernel_utils/integral_constant.h +36 -0
  302. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/common/kernel_utils/tuple_utils.h +34 -0
  303. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/block/block_mmad.h +27 -0
  304. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/block/block_scheduler_policy.h +35 -0
  305. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/block/block_scheduler_utils.h +27 -0
  306. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/block/quant_matmul_mx_block_mmad_swat.h +392 -0
  307. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/block/quant_matmul_mx_block_scheduler_swat.h +290 -0
  308. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/kernel/all_to_all_comm_udma.h +255 -0
  309. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/kernel/all_to_all_matmul_impl.h +370 -0
  310. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/kernel/heavy_kernels.h +128 -0
  311. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/kernel/qbmm_mx_kernel.h +395 -0
  312. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/policy/dispatch_policy.h +47 -0
  313. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tile/copy_scale_l1_to_l0a.h +61 -0
  314. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tile/copy_scale_l1_to_l0b.h +54 -0
  315. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tile/pad_mx_kl1.h +138 -0
  316. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tile/tile_mmad_mx.h +34 -0
  317. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tiling/all_to_all_matmul_tiling_data.h +29 -0
  318. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tiling/quant_matmul_mx_tiling_swat.h +410 -0
  319. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tiling/quant_matmul_tiling_base.h +116 -0
  320. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tiling/quant_matmul_tiling_common.h +101 -0
  321. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/tiling/quant_matmul_tiling_data.h +61 -0
  322. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/utils/constant.h +106 -0
  323. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/run.sh +65 -0
  324. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/scripts/extract_perf.py +57 -0
  325. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/scripts/gen_data.py +139 -0
  326. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/scripts/verify_result.py +152 -0
  327. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/src/all_to_all_matmul.cpp +396 -0
  328. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/src/utils.h +168 -0
  329. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/codebase_map.md +342 -0
  330. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/comm_shmem.md +280 -0
  331. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/matmul_blaze.md +259 -0
  332. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/mc2_architecture.md +199 -0
  333. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/review-checklist.md +29 -0
  334. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/workflow_integration.md +215 -0
  335. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/CMakeLists.txt +559 -0
  336. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/build.sh +319 -0
  337. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/config.cmake +232 -0
  338. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/func.cmake +478 -0
  339. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/intf.cmake +4 -0
  340. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/intf_pub.cmake +67 -0
  341. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/modules/Findalog.cmake +105 -0
  342. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/scripts/check_version_compatible.py +94 -0
  343. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/scripts/prepare.sh +129 -0
  344. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/golden.py +27 -0
  345. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/run_test.sh +33 -0
  346. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/single_server_check_result.py +71 -0
  347. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/single_server_config.ini +17 -0
  348. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/single_server_gen_data.py +91 -0
  349. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/single_server_run.py +116 -0
  350. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/test_golden_cpu.py +63 -0
  351. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/CMakeLists.txt +202 -0
  352. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/mc2_common_infershape.cpp +163 -0
  353. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/mc2_common_infershape.h +49 -0
  354. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/formulaic_tiling_datatype.h +161 -0
  355. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/hccl_formulaic_tiling.cpp +373 -0
  356. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/hccl_formulaic_tiling.h +150 -0
  357. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/hccl_performance.cpp +206 -0
  358. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/hccl_performance.h +118 -0
  359. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/hcom_topo_info.h +81 -0
  360. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/matmul_formulaic_tiling.cpp +338 -0
  361. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/matmul_formulaic_tiling.h +340 -0
  362. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/matmul_performance.cpp +272 -0
  363. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/matmul_performance.h +152 -0
  364. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/mc2_tiling_struct.h +46 -0
  365. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/mc2_tiling_utils.cpp +296 -0
  366. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_host/op_tiling/mc2_tiling_utils.h +269 -0
  367. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_kernel/mc2_matmul_block.h +235 -0
  368. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_kernel/mc2_matmul_block_l2cache.h +165 -0
  369. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_kernel/mc2_matmul_compute.h +218 -0
  370. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_kernel/mc2_nd_to_nz.h +579 -0
  371. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/op_kernel/mc2_tiling_struct.h +164 -0
  372. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/utils/mc2_hcom_topo_info.cpp +390 -0
  373. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/utils/mc2_hcom_topo_info.h +81 -0
  374. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/mc2_common/utils/ops_utils.h +77 -0
  375. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_api/aclnn_x_all_gather_matmul.cpp +65 -0
  376. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_api/aclnn_x_all_gather_matmul.h +57 -0
  377. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/arch22/x_all_gather_formulaic_tiling_a2a3.cpp +50 -0
  378. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/arch22/x_all_gather_formulaic_tiling_a2a3.h +47 -0
  379. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/arch22/x_all_gather_matmul_tiling_a2a3.cpp +72 -0
  380. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/arch22/x_all_gather_matmul_tiling_a2a3.h +31 -0
  381. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/x_all_gather_formulaic_tiling.cpp +82 -0
  382. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/x_all_gather_formulaic_tiling.h +55 -0
  383. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/x_all_gather_matmul_tiling_base.cpp +508 -0
  384. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/op_tiling/x_all_gather_matmul_tiling_base.h +54 -0
  385. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/x_all_gather_matmul_def.cpp +79 -0
  386. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_host/x_all_gather_matmul_proto.cpp +39 -0
  387. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_kernel/x_all_gather_matmul.cpp +96 -0
  388. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_kernel/x_all_gather_matmul_base.h +152 -0
  389. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_kernel/x_all_gather_matmul_full_mesh.h +230 -0
  390. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_kernel/x_all_gather_matmul_tiling.h +45 -0
  391. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/x_all_gather_matmul/op_kernel/x_all_gather_matmul_tiling_key.h +47 -0
  392. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/codebase_map.md +281 -0
  393. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/comm_hccl.md +201 -0
  394. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/matmul_fusion.md +50 -0
  395. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/mc2_architecture.md +142 -0
  396. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/op_architecture.md +167 -0
  397. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/pipeline_tuning.md +47 -0
  398. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/review-checklist.md +39 -0
  399. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/workflow_integration.md +152 -0
  400. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/operators/collective-comm.md +145 -0
  401. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/classification.md +27 -0
  402. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/comm-path-decision.md +51 -0
  403. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/grill-protocol.md +202 -0
  404. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/quality-checklist.md +57 -0
  405. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/template.md +208 -0
  406. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/shared/pipeline_tuning.md +232 -0
  407. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/shared/profiling_mc2.md +278 -0
  408. package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/scripts/fetch_apace.sh +96 -0
  409. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/SKILL.md +121 -0
  410. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/evals/evals.json +138 -0
  411. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/advanced_tiling.md +92 -0
  412. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/broadcast_design.md +160 -0
  413. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/broadcast_add_kernel.cpp +118 -0
  414. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/broadcast_add_tiling.cpp +126 -0
  415. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/broadcast_common.h +344 -0
  416. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/onedim_add_kernel.cpp +97 -0
  417. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/onedim_add_tiling.cpp +57 -0
  418. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/datacopypad_design.md +46 -0
  419. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/nddma_design.md +53 -0
  420. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/onedim_design.md +114 -0
  421. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/ub_broadcast_design.md +67 -0
  422. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/core_shrink_design.md +126 -0
  423. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/datacopy_optimization_design.md +351 -0
  424. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/tail_block_design.md +268 -0
  425. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/ub_resident_design.md +342 -0
  426. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/guide.md +69 -0
  427. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_base.template +81 -0
  428. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_big_dim.template +217 -0
  429. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_cut_one_axis.template +336 -0
  430. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_cut_two_axis.template +781 -0
  431. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_n_last.template +340 -0
  432. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_small_shape.template +321 -0
  433. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_tensor_move.template +102 -0
  434. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_transdata_5hd.template +480 -0
  435. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_transdata_5hd_021axis.template +533 -0
  436. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_with_gather.template +688 -0
  437. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/transpose_tiling_data.template +192 -0
  438. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_big_dim.md +220 -0
  439. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_cut_one_axis.md +175 -0
  440. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_cut_two_axis.md +177 -0
  441. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_fusion_design.md +398 -0
  442. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_gather.md +191 -0
  443. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_n_last.md +276 -0
  444. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_small_shape.md +315 -0
  445. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_tensor_move.md +203 -0
  446. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_tiling_data.md +176 -0
  447. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_vconv_021.md +206 -0
  448. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_vconv_5hd.md +179 -0
  449. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/elementwise/double_buffer_design.md +288 -0
  450. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/elementwise/vector_efficiency_design.md +203 -0
  451. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/constant_folding_design.md +466 -0
  452. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/fullload_design.md +344 -0
  453. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/guide.md +16 -0
  454. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/mte2_preload_design.md +320 -0
  455. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/pingpong_design.md +254 -0
  456. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/scale_coalescing_design.md +282 -0
  457. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/small_m_wide_n_pipeline_design.md +137 -0
  458. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/streamk_design.md +374 -0
  459. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/swat_design.md +423 -0
  460. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/mc2/guide.md +45 -0
  461. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/mc2/local_matmul_design.md +130 -0
  462. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/mc2/pipeline_balancing_design.md +502 -0
  463. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/guide.md +178 -0
  464. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/kernel_utils.template +75 -0
  465. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ar_full_load.template +429 -0
  466. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ar_recompute.template +485 -0
  467. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ar_small_r.template +348 -0
  468. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ara_full_load.template +574 -0
  469. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ara_online.template +324 -0
  470. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ara_recompute.template +436 -0
  471. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_base.template +950 -0
  472. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/fused_attention_online_softmax_design.md +428 -0
  473. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ar_full_load.md +137 -0
  474. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ar_recompute.md +135 -0
  475. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ar_small_r.md +122 -0
  476. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ara_full_load.md +144 -0
  477. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ara_online.md +185 -0
  478. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ara_recompute.md +163 -0
  479. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_tiling.template +460 -0
  480. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_tiling_data.template +278 -0
  481. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/state_resident_design.md +337 -0
  482. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/usage_guide.md +253 -0
  483. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/scalar/coding_principles.md +476 -0
  484. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/scalar/conv_scalar.md +165 -0
  485. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/scalar/guide.md +31 -0
  486. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/simt/optimization-guide.md +110 -0
  487. package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/sort/radix_sort.md +354 -0
  488. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/SKILL.md +361 -0
  489. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/evals/evals.json +161 -0
  490. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/ascendc-dumptensor-refs/api-reference.md +92 -0
  491. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/ascendc-dumptensor-refs/error-patterns.md +40 -0
  492. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/ascendc-dumptensor.md +205 -0
  493. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/best-practices.md +317 -0
  494. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/binary-search-debug.md +275 -0
  495. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/case-studies.md +459 -0
  496. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/common-traps.md +492 -0
  497. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/data-comparison.md +308 -0
  498. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/debug-summary-template.md +198 -0
  499. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/diagnosis-workflow.md +180 -0
  500. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/printf-debug.md +296 -0
  501. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/simt-precision-debug.md +76 -0
  502. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/tools-reference.md +364 -0
  503. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/scripts/error_analysis.py +148 -0
  504. package/assets/ops-direct-invoke/skills/ascendc-precision-debug/scripts/gen_boundary_test.py +169 -0
  505. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/SKILL.md +47 -0
  506. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/evals/evals.json +115 -0
  507. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/arithmetic_and_reduce.md +228 -0
  508. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/compute_api_membase_vs_regbase.md +107 -0
  509. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/datacopy_best_practices.md +139 -0
  510. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/index.md +38 -0
  511. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/pipeline_and_buffer.md +105 -0
  512. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/regbase_api_reference.md +303 -0
  513. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/regbase_api_sync.md +173 -0
  514. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/regbase_api_whitelist.md +142 -0
  515. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/index.md +24 -0
  516. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/regbase_build_notes.md +49 -0
  517. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/regbase_performance_practices.md +52 -0
  518. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/regbase_programming_notes.md +120 -0
  519. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/tiling_review_notes.md +86 -0
  520. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/working_vs_failed_dav_3510_cases.md +49 -0
  521. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/README.md +190 -0
  522. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_host/adam_apply_one_assign_def.cpp +102 -0
  523. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_host/arch35/adam_apply_one_assign_tiling_arch35.cpp +597 -0
  524. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_host/arch35/adam_apply_one_assign_tiling_arch35.h +82 -0
  525. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_kernel/adam_apply_one_assign.cpp +44 -0
  526. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_kernel/arch35/adam_apply_one_assign_kernel.h +361 -0
  527. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_kernel/arch35/adam_apply_one_assign_struct.h +27 -0
  528. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-code/op_kernel/arch35/adam_apply_one_assign_tiling_struct.h +53 -0
  529. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-design/adam_apply_one_assign_analysis.md +143 -0
  530. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/examples-adam-design/adam_apply_one_assign_design.md +2865 -0
  531. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/CMakeLists.txt +328 -0
  532. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/README.md +163 -0
  533. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_graph/xdivy_graph_infer.cpp +38 -0
  534. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_graph/xdivy_proto.h +42 -0
  535. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_host/arch35/xdivy_tiling_arch35.cpp +601 -0
  536. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_host/arch35/xdivy_tiling_arch35.h +89 -0
  537. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_host/xdivy_def.cpp +60 -0
  538. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_host/xdivy_infershape.cpp +58 -0
  539. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_kernel/arch35/xdivy_kernel.h +331 -0
  540. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_kernel/arch35/xdivy_struct.h +28 -0
  541. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_kernel/arch35/xdivy_tiling_struct.h +57 -0
  542. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_kernel/xdivy.cpp +42 -0
  543. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/aclnn/CMakeLists.txt +67 -0
  544. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/aclnn/run.sh +56 -0
  545. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/aclnn/test_aclnn.cpp +354 -0
  546. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/geir/CMakeLists.txt +69 -0
  547. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/geir/run.sh +58 -0
  548. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/geir/test_geir.cpp +407 -0
  549. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/tiling/CMakeLists.txt +185 -0
  550. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/tiling/run.sh +61 -0
  551. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/tiling/test_tiling.cpp +386 -0
  552. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/patterns.md +324 -0
  553. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-kernel-entrance.md +95 -0
  554. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-overview.md +252 -0
  555. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-compute-flow.md +214 -0
  556. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-dag-buffers.md +285 -0
  557. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-kernel-helpers.md +209 -0
  558. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-kernel-template.md +611 -0
  559. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-tiling-preprocess.md +545 -0
  560. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-tiling.md +471 -0
  561. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/broadcast-rules.md +126 -0
  562. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/cast-rules.md +414 -0
  563. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/datacopypad-rules.md +185 -0
  564. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/nddma-rules.md +255 -0
  565. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/sync-and-consistency.md +314 -0
  566. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/value-depend-process.md +40 -0
  567. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/vf-programming-rules.md +150 -0
  568. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/dynamic_shape/knowledge.md +382 -0
  569. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/dynamic_shape/patterns.md +260 -0
  570. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/elewise/patterns.md +46 -0
  571. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/elewise/tiling.md +215 -0
  572. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/example-routes.yaml +17 -0
  573. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/general-methodology.md +94 -0
  574. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/mask_predicate/patterns.md +99 -0
  575. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/numerical_stable/knowledge.md +233 -0
  576. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/numerical_stable/patterns.md +390 -0
  577. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/CMakeLists.txt +289 -0
  578. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/README.md +148 -0
  579. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_graph/euclidean_norm_graph_infer.cpp +39 -0
  580. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_graph/euclidean_norm_proto.h +54 -0
  581. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_host/arch35/euclidean_norm_tiling_arch35.cpp +1040 -0
  582. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_host/arch35/euclidean_norm_tiling_arch35.h +28 -0
  583. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_host/euclidean_norm_def.cpp +86 -0
  584. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_host/euclidean_norm_infershape.cpp +205 -0
  585. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm.cpp +46 -0
  586. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_base.h +965 -0
  587. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_empty.h +153 -0
  588. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_group.h +396 -0
  589. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_tiling_data.h +74 -0
  590. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_tiling_key.h +32 -0
  591. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/aclnn/CMakeLists.txt +59 -0
  592. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/aclnn/run.sh +36 -0
  593. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/aclnn/test_aclnn.cpp +227 -0
  594. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/geir/CMakeLists.txt +84 -0
  595. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/geir/run.sh +48 -0
  596. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/geir/test_geir.cpp +297 -0
  597. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/tiling/CMakeLists.txt +143 -0
  598. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/tiling/run.sh +40 -0
  599. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/tiling/test_tiling.cpp +318 -0
  600. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/patterns.md +527 -0
  601. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-binary-sum.md +260 -0
  602. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-highlevel-api.md +146 -0
  603. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-kernel-entrance.md +96 -0
  604. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-survival-node.md +74 -0
  605. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-binary-base/reduction-binary-base-dag-buffers.md +612 -0
  606. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-binary-base/reduction-binary-base-kernel-template.md +1261 -0
  607. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-binary-base/reduction-binary-base-tiling.md +531 -0
  608. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-binary-group/reduction-binary-group-dag-buffers.md +209 -0
  609. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-binary-group/reduction-binary-group-kernel-template.md +588 -0
  610. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-binary-group/reduction-binary-group-tiling.md +203 -0
  611. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-empty/reduction-empty-dag-buffers.md +292 -0
  612. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-empty/reduction-empty-kernel-template.md +360 -0
  613. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-empty/reduction-empty-tiling.md +234 -0
  614. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-overview.md +238 -0
  615. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-tiling-preprocess.md +218 -0
  616. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-tuple-reduce.md +72 -0
  617. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-vf-fusion-rules.md +95 -0
  618. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/validate_gates.py +194 -0
  619. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/resolve_example.py +106 -0
  620. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/routes.yaml +39 -0
  621. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/stateful/patterns.md +146 -0
  622. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/variable_output/knowledge.md +366 -0
  623. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/variable_output/patterns.md +203 -0
  624. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/api_misuse.md +50 -0
  625. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/common_traps.md +67 -0
  626. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/index.md +25 -0
  627. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/precision_failures.md +51 -0
  628. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/precision_guide.md +85 -0
  629. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/regbase_vs_membase_confusions.md +52 -0
  630. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/symptom_to_cause.md +38 -0
  631. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/reference-ops/open_source_operator_table.md +740 -0
  632. package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/regbase_development_guide.md +334 -0
  633. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/SKILL.md +107 -0
  634. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/evals/evals.json +44 -0
  635. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/compute-operators.md +34 -0
  636. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/data-transfer.md +51 -0
  637. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/debug-api.md +530 -0
  638. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/index-calculation.md +49 -0
  639. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/intra-core-shared.md +70 -0
  640. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/macro-api.md +65 -0
  641. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/multi-core-sync.md +39 -0
  642. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/overview.md +128 -0
  643. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/tensorlist-handling.md +92 -0
  644. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/thread-stride-pattern.md +49 -0
  645. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/vf-call.md +51 -0
  646. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/vf-declaration.md +39 -0
  647. package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references//347/274/226/350/257/221/344/270/216/350/277/220/350/241/214.md +158 -0
  648. package/assets/ops-direct-invoke/skills/ascendc-simt-tiling-design/SKILL.md +42 -0
  649. package/assets/ops-direct-invoke/skills/ascendc-simt-tiling-design/evals/evals.json +44 -0
  650. package/assets/ops-direct-invoke/skills/ascendc-simt-tiling-design/references/guide.md +73 -0
  651. package/assets/ops-direct-invoke/skills/ascendc-st-design/SKILL.md +316 -0
  652. package/assets/ops-direct-invoke/skills/ascendc-st-design/evals/evals.json +44 -0
  653. package/assets/ops-direct-invoke/skills/ascendc-st-design/references/constraint-examples.md +392 -0
  654. package/assets/ops-direct-invoke/skills/ascendc-st-design/references/dependency-yaml-spec.md +625 -0
  655. package/assets/ops-direct-invoke/skills/ascendc-st-design/references/empty-tensor-guide.md +236 -0
  656. package/assets/ops-direct-invoke/skills/ascendc-st-design/references/parameter-definition.md +491 -0
  657. package/assets/ops-direct-invoke/skills/ascendc-st-design/references/standards.md +11 -0
  658. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_empty_tensor_cases_derive.py +815 -0
  659. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_factor_values.py +1287 -0
  660. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_implicit_constraints.py +511 -0
  661. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_solver_config.py +618 -0
  662. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_test_cases.py +2800 -0
  663. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_test_factors.py +762 -0
  664. package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/utils.py +1931 -0
  665. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/SKILL.md +91 -0
  666. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/evals/evals.json +72 -0
  667. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/dynamic-ub-broadcast.md +87 -0
  668. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/nddma-broadcast.md +199 -0
  669. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/onedim.md +152 -0
  670. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/patterns.md +165 -0
  671. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/ub-broadcast.md +331 -0
  672. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/conversion/patterns.md +261 -0
  673. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/elewise/patterns.md +46 -0
  674. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/elewise/tiling.md +215 -0
  675. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/_governance.md +132 -0
  676. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/execution.md +469 -0
  677. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/resources.md +339 -0
  678. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/shape.md +271 -0
  679. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/composition.md +138 -0
  680. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/extension_points.md +173 -0
  681. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/fundamentals.md +245 -0
  682. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/roofline.md +227 -0
  683. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/implementation_ref.md +201 -0
  684. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/patterns.md +239 -0
  685. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/specialization/feature_flags.md +216 -0
  686. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/specialization/sparse_design.md +198 -0
  687. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/subfamilies/base_design.md +395 -0
  688. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/subfamilies/quantization_design.md +233 -0
  689. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/gather.md +273 -0
  690. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/index_add.md +434 -0
  691. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/index_select.md +185 -0
  692. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/patterns.md +199 -0
  693. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/repeat_interleave.md +251 -0
  694. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/scatter.md +341 -0
  695. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/matmul/ascendc-api-gmm-tiling.md +313 -0
  696. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/matmul/ascendc-api-matmul-tiling.md +408 -0
  697. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/matmul/patterns.md +32 -0
  698. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/alg-dichotomy.md +56 -0
  699. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/alg-group-reduce.md +101 -0
  700. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/alg-welford.md +74 -0
  701. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/algorithms.md +35 -0
  702. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ar-colsplit.md +149 -0
  703. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ar-fullload.md +151 -0
  704. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ara-fullload.md +228 -0
  705. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ara-rowsplit.md +219 -0
  706. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/multi-axis-transform.md +83 -0
  707. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/multi-output-buffer.md +115 -0
  708. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/patterns.md +212 -0
  709. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/tiling-fields.md +94 -0
  710. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/with-index.md +247 -0
  711. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/scatter/patterns.md +827 -0
  712. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/sort/alg-two-level-mrgsort.md +681 -0
  713. package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/sort/patterns.md +249 -0
  714. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/SKILL.md +109 -0
  715. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/coverage_files_question.json +24 -0
  716. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_cmake.txt +46 -0
  717. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_inferdtype.cpp +139 -0
  718. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_inferdtype.csv +5 -0
  719. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_infershape.cpp +122 -0
  720. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_infershape.csv +5 -0
  721. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_param.h +319 -0
  722. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_tiling.cpp +154 -0
  723. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_tiling.csv +5 -0
  724. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/question.json +100 -0
  725. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/template_report.md +112 -0
  726. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/todo.json +24 -0
  727. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/evals/evals.json +198 -0
  728. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/coverage-guide/coverage-extraction.md +78 -0
  729. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/coverage-guide/test-implementation.md +136 -0
  730. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/custom/custom.md +5 -0
  731. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/csv-format-spec.md +263 -0
  732. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/csv-refactor-workflow.md +494 -0
  733. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/legacy-code-extraction.md +325 -0
  734. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/ops-transformer.md +75 -0
  735. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/build_ut.md +65 -0
  736. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/op-api-ut-guide.md +237 -0
  737. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/op-host-ut-guide.md +240 -0
  738. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/op-kernel-ut-guide.md +198 -0
  739. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step1.md +43 -0
  740. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step2.md +26 -0
  741. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step3.md +51 -0
  742. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step4.md +130 -0
  743. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step5.md +5 -0
  744. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/scripts/extract_dtype_combinations.py +200 -0
  745. package/assets/ops-direct-invoke/skills/ascendc-ut-develop/scripts/generate_csv_template.py +270 -0
  746. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/SKILL.md +125 -0
  747. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/evals/evals.json +198 -0
  748. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/S1-input-collection.md +125 -0
  749. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/00-execution-order.md +58 -0
  750. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/01-variable-semantics.md +250 -0
  751. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/02-generate-mapper.md +218 -0
  752. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/S5_case_json_schema.md +373 -0
  753. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/S5_mapped_case_schema.md +131 -0
  754. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/s5_case_mapper_template.py +411 -0
  755. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/design-verifier/00-execution-order.md +114 -0
  756. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/00-execution-order.md +291 -0
  757. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/01-code-analyzer.md +121 -0
  758. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/02-interface-analyzer.md +417 -0
  759. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/03-param-derivation.md +45 -0
  760. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/04-test-design-template.md +231 -0
  761. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/05-network-search.md +154 -0
  762. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/00-overview.md +66 -0
  763. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/01-step1-tiling.md +114 -0
  764. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/02-step2-trace.md +81 -0
  765. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/03-step3-kernel.md +51 -0
  766. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/04-path-config-schema.md +342 -0
  767. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/00-execution-order.md +26 -0
  768. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/01-step1-merge.md +54 -0
  769. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/02-step2-group.md +44 -0
  770. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/03-step3-derive.md +416 -0
  771. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/04-step4-output.md +122 -0
  772. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/05-step5-gen-cases.md +156 -0
  773. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/00-execution-order.md +108 -0
  774. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/01-csv-common.md +33 -0
  775. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/02-kernel-fields.md +64 -0
  776. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/03-kernel-mode.md +142 -0
  777. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/workflow.md +193 -0
  778. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/_scout_common.py +53 -0
  779. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/assemble_dim_spec.py +232 -0
  780. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/build_param_def.py +134 -0
  781. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/build_path_list.py +520 -0
  782. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/format_json.py +135 -0
  783. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/gen_cases_template.py +196 -0
  784. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/generate_test_design.py +555 -0
  785. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/normalize_op_name.py +157 -0
  786. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/pick_dims.py +173 -0
  787. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/run_ttk_kernel_module.py +750 -0
  788. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s2p0_verify.py +302 -0
  789. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s3_task_d_gate.py +365 -0
  790. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s5_append_empty.py +180 -0
  791. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s5_check_mapper_outputs.py +292 -0
  792. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s5_expand_high.py +208 -0
  793. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/scout_k.py +723 -0
  794. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/scout_t.py +983 -0
  795. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/ttk_generate_kernel_csv.py +346 -0
  796. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/ttk_precheck_env.py +248 -0
  797. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/ttk_validate_csv.py +315 -0
  798. package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/update_path_list.py +143 -0
  799. package/assets/ops-direct-invoke/skills/cann-env-setup/SKILL.md +177 -0
  800. package/assets/ops-direct-invoke/skills/cann-env-setup/evals/evals.json +144 -0
  801. package/assets/ops-direct-invoke/skills/cann-env-setup/references/env_dependence.md +77 -0
  802. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/SKILL.md +51 -0
  803. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/overall-implementation.md +226 -0
  804. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/aclnn-adaptation.md +34 -0
  805. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/aicpu-load-balance-metadata.md +116 -0
  806. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/channel-buffer.md +36 -0
  807. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/compilation-launch.md +144 -0
  808. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/host-validation.md +34 -0
  809. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/layout-tail.md +53 -0
  810. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/synchronization.md +80 -0
  811. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/torch-registration.md +66 -0
  812. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/vf.md +144 -0
  813. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/workspace.md +67 -0
  814. package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/production-code.md +120 -0
  815. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/SKILL.md +25 -0
  816. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/core/methodology.md +104 -0
  817. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/references/readability-rules.md +280 -0
  818. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/steps/clause-review.md +59 -0
  819. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/steps/report-write.md +60 -0
  820. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/workflows/file-review.md +49 -0
  821. package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/workflows/pr-review.md +58 -0
  822. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/SKILL.md +97 -0
  823. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/references/checks-and-troubleshooting.md +96 -0
  824. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/references/env-selected-soc-schema.md +43 -0
  825. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/references/environment-schema.md +112 -0
  826. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/check_env.sh +34 -0
  827. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/env_check.py +946 -0
  828. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/probe_compile_stage.py +99 -0
  829. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/probe_kernel.py +33 -0
  830. package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/tests/test_env_report.py +90 -0
  831. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/SKILL.md +60 -0
  832. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/references/pipeline-design.md +84 -0
  833. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/references/stage-cost-model.md +77 -0
  834. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/DESIGN-BRANCH.md.templ +119 -0
  835. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/INDEX.md.templ +34 -0
  836. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/API.md.templ +67 -0
  837. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/DevView.md.templ +67 -0
  838. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/HostLaunch.md.templ +119 -0
  839. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/InferShapeDtype.md.templ +56 -0
  840. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Interface.md.templ +61 -0
  841. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Kernel.md.templ +183 -0
  842. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/LaunchData.md.templ +126 -0
  843. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Overview.md.templ +57 -0
  844. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/TemplatePartition.md.templ +69 -0
  845. package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Validation.md.templ +80 -0
  846. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/SKILL.md +64 -0
  847. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/assets/case_contract.py +269 -0
  848. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/assets/test.py +571 -0
  849. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/references/cases.md +29 -0
  850. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/references/evidence.md +67 -0
  851. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/references/golden.md +12 -0
  852. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/build_blackbox_cases.py +536 -0
  853. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/build_tdd_cases.py +498 -0
  854. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/build_whitebox_cases.py +183 -0
  855. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/casebook.py +71 -0
  856. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/generator_support.py +95 -0
  857. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/prepare_golden.py +390 -0
  858. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/recipe_validation.py +144 -0
  859. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/tests/test_evidence_chain.py +339 -0
  860. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/tests/test_skills.py +547 -0
  861. package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/tests/test_synthesize_dtype.py +85 -0
  862. package/assets/ops-direct-invoke/skills/cannbot-dsl-unit-planner/SKILL.md +35 -0
  863. package/assets/ops-direct-invoke/skills/cannbot-dsl-unit-planner/references/decomposition-checks.md +46 -0
  864. package/assets/ops-direct-invoke/skills/cannbot-dsl-unit-planner/references/unit-format.md +77 -0
  865. package/assets/ops-direct-invoke/skills/npu-arch/SKILL.md +87 -0
  866. package/assets/ops-direct-invoke/skills/npu-arch/evals/evals.json +356 -0
  867. package/assets/ops-direct-invoke/skills/npu-arch/references/npu-arch-guide-triton.md +312 -0
  868. package/assets/ops-direct-invoke/skills/npu-arch/references/npu-arch-guide.md +454 -0
  869. package/assets/ops-direct-invoke/skills/npu-arch/references/npu-hardware-params.md +248 -0
  870. package/assets/ops-direct-invoke/skills/npu-arch/references/simt-arch-guide.md +303 -0
  871. package/assets/ops-direct-invoke/skills/ops-design-paradigms/SKILL.md +41 -0
  872. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/index.md +32 -0
  873. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/arithmetic_and_reduce.md +96 -0
  874. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/datacopy_best_practices.md +87 -0
  875. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/index.md +37 -0
  876. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/pipeline_and_buffer.md +87 -0
  877. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/precision_and_runtime.md +98 -0
  878. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/regbase_api_reference.md +88 -0
  879. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/regbase_api_sync.md +112 -0
  880. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/regbase_api_whitelist.md +121 -0
  881. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/complexity_and_route_selection.md +113 -0
  882. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/index.md +55 -0
  883. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/process_memory_cards.md +54 -0
  884. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_build_notes.md +87 -0
  885. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_kernel_case_notes.md +103 -0
  886. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_performance_practices.md +92 -0
  887. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_programming_notes.md +108 -0
  888. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/requirements_analysis_patterns.md +97 -0
  889. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/small_channel_transpose_notes.md +78 -0
  890. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/tiling_review_notes.md +87 -0
  891. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/working_vs_failed_950_cases.md +85 -0
  892. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/index.md +30 -0
  893. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/broadcast_patterns.md +132 -0
  894. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/index.md +48 -0
  895. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/inplace_operator_patterns.md +182 -0
  896. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/kernel_design_patterns.md +117 -0
  897. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/reduction_patterns.md +152 -0
  898. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_buffer_partitioning.md +122 -0
  899. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_kernel_dataflow_patterns.md +164 -0
  900. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_operator_patterns.md +138 -0
  901. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_sync_patterns.md +113 -0
  902. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/tiling_input_validation.md +267 -0
  903. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/tiling_patterns.md +124 -0
  904. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/api_misuse.md +161 -0
  905. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/common_traps.md +199 -0
  906. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/index.md +41 -0
  907. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/precision_failures.md +176 -0
  908. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/precision_guide.md +190 -0
  909. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/regbase_vs_membase_confusions.md +89 -0
  910. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/symptom_to_cause.md +58 -0
  911. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/regbase_development_guide.md +290 -0
  912. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/flash_attn-arch35-best-practices.md +80 -0
  913. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/quant_flash_attn-arch35-best-practices.md +67 -0
  914. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/sparse_flash_attention-arch35-best-practices.md +66 -0
  915. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/sparse_flash_mla-arch35-best-practices.md +69 -0
  916. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/patterns.md +65 -0
  917. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/advanced.md +37 -0
  918. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/buffer.md +241 -0
  919. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/compute-flow.md +111 -0
  920. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/load-balancing.md +42 -0
  921. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/pipeline-example.md +173 -0
  922. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/pipeline.md +60 -0
  923. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/pre-knowledge.md +197 -0
  924. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/roofline.md +220 -0
  925. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/selection.md +32 -0
  926. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/stage-cost.md +63 -0
  927. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/trait-mla.md +36 -0
  928. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/trait-quantization.md +51 -0
  929. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/trait-sparse.md +35 -0
  930. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/README.md +20 -0
  931. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/capability-mapping.md +41 -0
  932. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/dag-buffers.md +285 -0
  933. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/design-spec.md +24 -0
  934. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_host/adam_apply_one_assign_def.cpp +104 -0
  935. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_host/arch35/adam_apply_one_assign_tiling_arch35.cpp +572 -0
  936. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_host/arch35/adam_apply_one_assign_tiling_arch35.h +86 -0
  937. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_kernel/adam_apply_one_assign.cpp +46 -0
  938. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_kernel/arch35/adam_apply_one_assign_kernel.h +343 -0
  939. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_kernel/arch35/adam_apply_one_assign_struct.h +29 -0
  940. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-code/op_kernel/arch35/adam_apply_one_assign_tiling_struct.h +53 -0
  941. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-design/adam_apply_one_assign_analysis.md +143 -0
  942. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/examples-adam-design/adam_apply_one_assign_design.md +2840 -0
  943. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/CMakeLists.txt +328 -0
  944. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/README.md +162 -0
  945. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_graph/xdivy_graph_infer.cpp +40 -0
  946. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_graph/xdivy_proto.h +44 -0
  947. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_host/arch35/xdivy_tiling_arch35.cpp +582 -0
  948. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_host/arch35/xdivy_tiling_arch35.h +94 -0
  949. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_host/xdivy_def.cpp +62 -0
  950. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_host/xdivy_infershape.cpp +60 -0
  951. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_kernel/arch35/xdivy_kernel.h +337 -0
  952. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_kernel/arch35/xdivy_struct.h +30 -0
  953. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_kernel/arch35/xdivy_tiling_struct.h +57 -0
  954. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_kernel/xdivy.cpp +44 -0
  955. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/aclnn/CMakeLists.txt +67 -0
  956. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/aclnn/run.sh +57 -0
  957. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/aclnn/test_aclnn.cpp +353 -0
  958. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/geir/CMakeLists.txt +69 -0
  959. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/geir/run.sh +59 -0
  960. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/geir/test_geir.cpp +409 -0
  961. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/tiling/CMakeLists.txt +185 -0
  962. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/tiling/run.sh +62 -0
  963. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/tiling/test_tiling.cpp +355 -0
  964. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/index.md +48 -0
  965. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/kernel-entrance.md +95 -0
  966. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/kernel-helpers.md +208 -0
  967. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/kernel-template.md +617 -0
  968. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/overview.md +250 -0
  969. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/pitfalls.md +50 -0
  970. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/tiling-preprocess.md +487 -0
  971. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/tiling.md +374 -0
  972. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/dsl/capability-mapping.md +50 -0
  973. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/dsl/implementation-guide.md +52 -0
  974. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/dsl/index.md +33 -0
  975. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/capability-contract.md +41 -0
  976. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/compute-flow.md +216 -0
  977. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/index.md +23 -0
  978. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/liveness-fusion.md +200 -0
  979. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/scene.md +68 -0
  980. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/shape-preprocessing.md +209 -0
  981. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/splitting.md +158 -0
  982. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/sync-model.md +79 -0
  983. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/verification.md +131 -0
  984. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/patterns.md +62 -0
  985. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/broadcast-rules.md +126 -0
  986. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/cast-rules.md +414 -0
  987. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/datacopypad-rules.md +186 -0
  988. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/nddma-rules.md +257 -0
  989. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/sync-and-consistency.md +315 -0
  990. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/value-depend-process.md +40 -0
  991. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/vf-programming-rules.md +150 -0
  992. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/example-routes.yaml +31 -0
  993. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/general-methodology-dsl.md +11 -0
  994. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/general-methodology.md +94 -0
  995. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/binary-tree.md +260 -0
  996. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/capability-mapping.md +49 -0
  997. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/design-spec.md +26 -0
  998. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/CMakeLists.txt +289 -0
  999. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/README.md +147 -0
  1000. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_graph/euclidean_norm_graph_infer.cpp +39 -0
  1001. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_graph/euclidean_norm_proto.h +54 -0
  1002. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_host/arch35/euclidean_norm_tiling_arch35.cpp +1027 -0
  1003. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_host/arch35/euclidean_norm_tiling_arch35.h +28 -0
  1004. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_host/euclidean_norm_def.cpp +85 -0
  1005. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_host/euclidean_norm_infershape.cpp +211 -0
  1006. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_apt.cpp +41 -0
  1007. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_base.h +911 -0
  1008. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_empty.h +141 -0
  1009. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_group.h +381 -0
  1010. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_tiling_data.h +65 -0
  1011. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/op_kernel/arch35/euclidean_norm_tiling_key.h +30 -0
  1012. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/aclnn/CMakeLists.txt +59 -0
  1013. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/aclnn/run.sh +37 -0
  1014. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/aclnn/test_aclnn.cpp +223 -0
  1015. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/geir/CMakeLists.txt +84 -0
  1016. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/geir/run.sh +49 -0
  1017. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/geir/test_geir.cpp +296 -0
  1018. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/tiling/CMakeLists.txt +143 -0
  1019. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/tiling/run.sh +41 -0
  1020. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/tiling/test_tiling.cpp +320 -0
  1021. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/highlevel-api.md +146 -0
  1022. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/index.md +48 -0
  1023. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/kernel-entrance.md +97 -0
  1024. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/overview.md +237 -0
  1025. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/survival-node.md +74 -0
  1026. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-base/dag-buffers.md +612 -0
  1027. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-base/kernel-template.md +1213 -0
  1028. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-base/tiling.md +511 -0
  1029. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-group/dag-buffers.md +209 -0
  1030. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-group/kernel-template.md +577 -0
  1031. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-group/tiling.md +199 -0
  1032. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/empty/dag-buffers.md +292 -0
  1033. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/empty/kernel-template.md +349 -0
  1034. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/empty/tiling.md +230 -0
  1035. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/tiling-preprocess.md +218 -0
  1036. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/tuple-reduce.md +72 -0
  1037. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/vf-fusion-rules.md +95 -0
  1038. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/axis-preprocessing.md +109 -0
  1039. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/capability-contract.md +48 -0
  1040. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/index.md +23 -0
  1041. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/liveness-fusion.md +111 -0
  1042. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/scene.md +92 -0
  1043. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/splitting.md +230 -0
  1044. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/sync-model.md +86 -0
  1045. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/tree-reduction.md +160 -0
  1046. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/tuple-reduce.md +53 -0
  1047. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/patterns.md +62 -0
  1048. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/validate_gates.py +196 -0
  1049. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/resolve_example.py +170 -0
  1050. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/routes.yaml +39 -0
  1051. package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/reference-ops/open_source_operator_table.md +715 -0
  1052. package/assets/ops-direct-invoke/skills/ops-design-paradigms/tests/test_language_route.py +142 -0
  1053. package/assets/ops-direct-invoke/skills/ops-direct-invoke/SKILL.md +249 -0
  1054. package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/assemble_cannbotdsl_design.py +156 -0
  1055. package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/assemble_workflow.py +571 -0
  1056. package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/build_implementation_subgraph.py +320 -0
  1057. package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/generate_workflow_guide.py +94 -0
  1058. package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/run_workflow.py +121 -0
  1059. package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/validate_unit_contracts.py +228 -0
  1060. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//344/273/243/347/240/201/344/277/256/345/244/215.yaml +39 -0
  1061. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//346/212/200/346/234/257/347/251/277/345/210/272.yaml +40 -0
  1062. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//346/226/207/346/241/243/345/207/206/345/244/207.yaml +27 -0
  1063. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//346/265/213/350/257/225/345/267/245/347/250/213/345/274/200/345/217/221.yaml +33 -0
  1064. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//347/231/275/347/233/222/346/265/213/350/257/225/350/256/276/350/256/241.yaml +34 -0
  1065. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//347/237/245/350/257/206/346/220/234/351/233/206.yaml +36 -0
  1066. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//347/256/227/345/255/220/345/274/200/345/217/221.yaml +47 -0
  1067. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/ascendc//351/273/221/347/233/222/346/265/213/350/257/225/350/256/276/350/256/241.yaml +27 -0
  1068. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//344/272/244/344/273/230.yaml +15 -0
  1069. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//344/273/243/347/240/201/346/243/200/350/247/206.yaml +18 -0
  1070. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/210/233/345/273/272/345/267/245/344/275/234/345/214/272.yaml +17 -0
  1071. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/215/225/345/205/203/344/273/273/345/212/241/346/213/206/345/210/206.yaml +22 -0
  1072. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/215/225/345/205/203/345/256/236/347/216/260.yaml +27 -0
  1073. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/215/225/345/205/203/351/233/206/346/210/220/345/244/215/351/252/214.yaml +19 -0
  1074. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/256/236/347/216/260/344/277/256/345/244/215.yaml +21 -0
  1075. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/256/236/347/216/260/346/243/200/350/247/206.yaml +20 -0
  1076. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//345/256/236/347/216/260/351/227/250/347/246/201.yaml +17 -0
  1077. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//346/200/247/350/203/275/344/274/230/345/214/226.yaml +22 -0
  1078. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//346/226/207/346/241/243/347/224/237/346/210/220.yaml +15 -0
  1079. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//346/226/271/346/241/210/350/256/276/350/256/241.yaml +32 -0
  1080. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//346/265/213/350/257/225/347/224/237/346/210/220.yaml +29 -0
  1081. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//347/216/257/345/242/203/345/260/261/347/273/252.yaml +25 -0
  1082. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//347/262/276/345/272/246/351/252/214/350/257/201.yaml +25 -0
  1083. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//350/247/204/346/240/274/347/224/237/346/210/220.yaml +18 -0
  1084. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//351/234/200/346/261/202/345/210/206/346/236/220.yaml +16 -0
  1085. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//351/273/221/347/233/222/347/224/250/344/276/213/350/256/276/350/256/241.yaml +19 -0
  1086. package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/common/.gitkeep +0 -0
  1087. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//344/273/243/347/240/201/346/243/200/350/247/206/346/212/245/345/221/212.md +70 -0
  1088. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//345/212/237/350/203/275/351/252/214/346/224/266/346/212/245/345/221/212.md +80 -0
  1089. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//346/265/213/350/257/225/346/211/247/350/241/214/350/256/260/345/275/225.md +73 -0
  1090. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//347/231/275/347/233/222/346/265/213/350/257/225/350/256/276/350/256/241.md +37 -0
  1091. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//347/237/245/350/257/206/346/220/234/351/233/206.md +25 -0
  1092. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//351/252/214/346/224/266/346/212/245/345/221/212.md +39 -0
  1093. package/assets/ops-direct-invoke/skills/ops-direct-invoke/templates//351/273/221/347/233/222/346/265/213/350/257/225/350/256/276/350/256/241.md +130 -0
  1094. package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/ascendc/basic.yaml +57 -0
  1095. package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/ascendc/feasibility.yaml +13 -0
  1096. package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/cannbot-dsl/op-dev.graph-preview.yaml +18 -0
  1097. package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/cannbot-dsl/op-dev.yaml +142 -0
  1098. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/SKILL.md +115 -0
  1099. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/agents-entry.md +23 -0
  1100. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/documentation.md +52 -0
  1101. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/ops-direct-invoke.md +67 -0
  1102. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/repo-skills.md +85 -0
  1103. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/subagents.md +43 -0
  1104. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/task-authoring.md +83 -0
  1105. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/tests.md +33 -0
  1106. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/dsl_generation/test.py +499 -0
  1107. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/support.py +122 -0
  1108. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/test_all.py +59 -0
  1109. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/variables/test.py +100 -0
  1110. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/workflow_execution/test.py +134 -0
  1111. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/workflow_generation/test.py +457 -0
  1112. package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/workflow_guide/test.py +91 -0
  1113. package/assets/ops-direct-invoke/skills/ops-precision-standard/SKILL.md +22 -0
  1114. package/assets/ops-direct-invoke/skills/ops-precision-standard/evals/evals.json +120 -0
  1115. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/benchmark_construction.md +77 -0
  1116. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/float_compute.md +126 -0
  1117. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/integer_compute.md +105 -0
  1118. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/non_compute.md +81 -0
  1119. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/quantization.md +49 -0
  1120. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/random_generation.md +198 -0
  1121. package/assets/ops-direct-invoke/skills/ops-precision-standard/references/test_case_generation.md +61 -0
  1122. package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/bitwise_match.py +103 -0
  1123. package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/integer_compute_check.py +157 -0
  1124. package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/mixed_tolerance_check.py +178 -0
  1125. package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/random_distribution_check.py +247 -0
  1126. package/assets/ops-direct-invoke/skills/ops-profiling/SKILL.md +185 -0
  1127. package/assets/ops-direct-invoke/skills/ops-profiling/evals/evals.json +196 -0
  1128. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/SKILL.md +259 -0
  1129. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/VERSION +10 -0
  1130. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/evals/evals.json +33 -0
  1131. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/collection-workflow.md +91 -0
  1132. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/data-contract.md +63 -0
  1133. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/environment-and-failure.md +82 -0
  1134. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/validation-and-performance.md +63 -0
  1135. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/visualization-contract.md +86 -0
  1136. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/collect.py +2209 -0
  1137. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/collect_discovery.py +987 -0
  1138. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/collect_validate.py +607 -0
  1139. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/environment_context.py +723 -0
  1140. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/estimate_runtime.py +131 -0
  1141. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/run_pipeline.py +339 -0
  1142. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/runtime_guard.py +589 -0
  1143. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/self_check.py +465 -0
  1144. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize.py +1004 -0
  1145. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_common.py +258 -0
  1146. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_parsers.py +1555 -0
  1147. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_render.py +286 -0
  1148. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_resolvers.py +1224 -0
  1149. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_source.py +1288 -0
  1150. package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/templates/report_template.html +253 -0
  1151. package/assets/ops-direct-invoke/skills/ops-profiling/references/csv_fields_reference.md +260 -0
  1152. package/assets/ops-direct-invoke/skills/ops-profiling/references/msprof-guide.md +252 -0
  1153. package/assets/ops-direct-invoke/skills/ops-profiling/references/msprof-op-guide.md +241 -0
  1154. package/assets/ops-direct-invoke/skills/ops-profiling/references/optimization_quickref.md +265 -0
  1155. package/assets/ops-direct-invoke/skills/ops-profiling/scripts/msprof_perf_summary.py +2469 -0
  1156. package/assets/ops-direct-invoke/skills/ops-profiling/scripts/msprof_profile_run.sh +400 -0
  1157. package/assets/ops-direct-invoke/skills/ops-profiling/scripts/perf_summary.py +448 -0
  1158. package/assets/ops-direct-invoke/skills/ops-simulator/SKILL.md +233 -0
  1159. package/assets/ops-direct-invoke/skills/ops-simulator/evals/evals.json +128 -0
  1160. package/assets/ops-direct-invoke/skills/ops-simulator/references/pc-source-mapping.md +76 -0
  1161. package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-aic.md +557 -0
  1162. package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-aiv.md +674 -0
  1163. package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-general.md +199 -0
  1164. package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-template.md +143 -0
  1165. package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-metrics-reference.md +350 -0
  1166. package/assets/ops-direct-invoke/skills/ops-simulator/references/pipeline-bubble-analysis.md +269 -0
  1167. package/assets/ops-direct-invoke/skills/ops-simulator/references/simulator-advanced.md +174 -0
  1168. package/assets/ops-direct-invoke/skills/ops-simulator/references/troubleshooting.md +105 -0
  1169. package/assets/ops-direct-invoke/skills/ops-simulator/scripts/map_pc_to_source.py +741 -0
  1170. package/assets/ops-direct-invoke/skills/ops-simulator/scripts/trace_bubble_analyzer.py +971 -0
  1171. package/assets/ops-direct-invoke/skills/ops-spec-gen/SKILL.md +350 -0
  1172. package/assets/ops-direct-invoke/skills/ops-spec-gen/evals/evals.json +114 -0
  1173. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/README.md +71 -0
  1174. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/add/spec.yaml +161 -0
  1175. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/complex/spec.yaml +154 -0
  1176. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/cumsum/spec.yaml +176 -0
  1177. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/dropout/spec.yaml +170 -0
  1178. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/fused_quant_matmul/spec.yaml +331 -0
  1179. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/matmul/spec.yaml +201 -0
  1180. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/nonzero/spec.yaml +174 -0
  1181. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/reduce_sum/spec.yaml +151 -0
  1182. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/reduce_sum_all/spec.yaml +135 -0
  1183. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/reduce_sum_fixed/spec.yaml +143 -0
  1184. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/softmax/spec.yaml +231 -0
  1185. package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/split/spec.yaml +160 -0
  1186. package/assets/ops-direct-invoke/skills/ops-spec-gen/references/accumulation_order.md +63 -0
  1187. package/assets/ops-direct-invoke/skills/ops-spec-gen/references/error-codes.md +199 -0
  1188. package/assets/ops-direct-invoke/skills/ops-spec-gen/references/spec-cheatsheet.md +358 -0
  1189. package/assets/ops-direct-invoke/skills/ops-spec-gen/references/stage-rules.md +476 -0
  1190. package/assets/ops-direct-invoke/skills/ops-spec-gen/references/usage-scenarios.md +265 -0
  1191. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/anti_pattern_registry.yaml +51 -0
  1192. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/boundary_min_cases.yaml +215 -0
  1193. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/category_enum.yaml +37 -0
  1194. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/category_paradigm_map.yaml +145 -0
  1195. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/chip_registry.yaml +82 -0
  1196. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/error_code_enum.yaml +25 -0
  1197. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/framework_oracle_registry.yaml +22 -0
  1198. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/invariant_kind_registry.yaml +130 -0
  1199. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/machine_check_kind_registry.yaml +84 -0
  1200. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/paradigm_enum.yaml +48 -0
  1201. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/primitive_whitelist.yaml +67 -0
  1202. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/synthesize_pattern_registry.yaml +58 -0
  1203. package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/tolerance_defaults.yaml +53 -0
  1204. package/assets/ops-direct-invoke/skills/ops-spec-gen/schemas/op-spec.json +762 -0
  1205. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/check_registry_schema_sync.py +167 -0
  1206. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/dump_rule_ids.py +168 -0
  1207. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/__init__.py +8 -0
  1208. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/_ast_sandbox.py +142 -0
  1209. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/broadcast.py +270 -0
  1210. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/dtype_eval.py +186 -0
  1211. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/extreme_inputs_check.py +355 -0
  1212. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/formula_eval.py +431 -0
  1213. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/formula_oracle_equiv.py +603 -0
  1214. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/invariant_exec.py +569 -0
  1215. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/oracle_check.py +465 -0
  1216. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/parser.py +71 -0
  1217. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/promote.py +254 -0
  1218. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/shape_eval.py +368 -0
  1219. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/stages.py +995 -0
  1220. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/types.py +130 -0
  1221. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/generate_spec.py +1571 -0
  1222. package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/validate_spec.py +1848 -0
  1223. package/assets/ops-direct-invoke/skills/ops-spec-gen/templates/spec.yaml.tmpl +100 -0
  1224. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/conftest.py +21 -0
  1225. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_attr_resolve.py +72 -0
  1226. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_broadcast.py +85 -0
  1227. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_doc_drift.py +45 -0
  1228. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_dtype_eval.py +163 -0
  1229. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_examples.py +54 -0
  1230. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_extreme_inputs_check.py +181 -0
  1231. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_formula_eval.py +154 -0
  1232. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_formula_oracle_equiv.py +281 -0
  1233. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_generate_spec.py +98 -0
  1234. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_invariant_exec.py +235 -0
  1235. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_main_pipeline.py +419 -0
  1236. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_oracle.py +255 -0
  1237. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_promote.py +127 -0
  1238. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_registry_schema_sync.py +32 -0
  1239. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_sandbox_escape.py +90 -0
  1240. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_shape_eval.py +220 -0
  1241. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_shape_literal.py +82 -0
  1242. package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_stage2_constraints.py +213 -0
  1243. package/assets/ops-direct-invoke/skills/repo-build-guide/SKILL.md +10 -0
  1244. package/assets/ops-direct-invoke/skills/repo-build-guide/references/build-guide.md +42 -0
  1245. package/assets/ops-direct-invoke/skills/repo-coding-rules/SKILL.md +10 -0
  1246. package/assets/ops-direct-invoke/skills/repo-coding-rules/references/red-lines.md +42 -0
  1247. package/assets/ops-direct-invoke/skills/repo-env-check/SKILL.md +44 -0
  1248. package/assets/ops-direct-invoke/skills/repo-env-check/references//347/216/257/345/242/203/344/277/241/346/201/257.md +42 -0
  1249. package/assets/ops-direct-invoke/skills/repo-knowledge/SKILL.md +12 -0
  1250. package/assets/ops-direct-invoke/skills/repo-knowledge/references/evaluation-contract.md +48 -0
  1251. package/assets/ops-direct-invoke/skills/repo-op-templates/SKILL.md +15 -0
  1252. package/assets/ops-direct-invoke/skills/repo-op-templates/references/operator-template.md +27 -0
  1253. package/assets/ops-direct-invoke/skills/repo-op-templates/references/project-skeleton.md +41 -0
  1254. package/assets/ops-direct-invoke/skills/repo-requirement/SKILL.md +39 -0
  1255. package/assets/ops-direct-invoke/skills/repo-requirement/references/requirement-checklist.md +70 -0
  1256. package/assets/ops-direct-invoke/skills/repo-test-develop/SKILL.md +17 -0
  1257. package/assets/ops-direct-invoke/skills/repo-test-develop/references/blackbox-design.md +30 -0
  1258. package/assets/ops-direct-invoke/skills/repo-test-develop/references/cannbench-integration.md +75 -0
  1259. package/assets/ops-direct-invoke/skills/repo-test-develop/references/precision-and-perf.md +36 -0
  1260. package/assets/ops-direct-invoke/skills/repo-test-develop/references/test-framework.md +75 -0
  1261. package/assets/ops-direct-invoke/skills/repo-test-develop/references/whitebox-design.md +19 -0
  1262. package/assets/ops-direct-invoke/skills/workflow-orchestrator/README.md +145 -0
  1263. package/assets/ops-direct-invoke/skills/workflow-orchestrator/SKILL.md +84 -0
  1264. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/approve_task.py +98 -0
  1265. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/get_task.py +1133 -0
  1266. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/init_status.py +131 -0
  1267. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/link_agent_config.py +89 -0
  1268. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/orchestrator.py +738 -0
  1269. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/poll_workflow.py +392 -0
  1270. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/task_graph.py +144 -0
  1271. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/update_status.py +149 -0
  1272. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/verdict_common.py +103 -0
  1273. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/verdict_fail.py +22 -0
  1274. package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/verdict_pass.py +21 -0
  1275. package/assets/ops-direct-invoke/skills/workflow-orchestrator/templates/basic_workflow.yaml +113 -0
  1276. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_agent_exit.py +91 -0
  1277. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_approval.py +490 -0
  1278. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_link_agent_config.py +202 -0
  1279. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_nested_subgraphs.py +337 -0
  1280. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_orchestrator.py +1383 -0
  1281. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_poll_workflow.py +371 -0
  1282. package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_verdict.py +148 -0
  1283. package/cordis.patch.yml +3 -0
  1284. package/icon.svg +1 -0
  1285. package/lib/client.js +255 -0
  1286. package/lib/client.js.map +1 -0
  1287. package/lib/index.js +15 -0
  1288. package/locale/en.json +1 -0
  1289. package/locale/zh.json +1 -0
  1290. package/package.json +62 -3
  1291. package/upstream.json +10 -0
@@ -0,0 +1,1213 @@
1
+ # reduction 范式 binary-base 模板
2
+
3
+ > 本范式主模板的完整 kernel 实现,含骨架、偏移计算、CopyIn、Compute、CopyOut。
4
+
5
+ 依赖输入:
6
+ - [dag-buffers.md](dag-buffers.md)(核心:VF 融合后的数据流及存活节点直接决定 kernel 的搬运、计算流程)
7
+ - [overview.md](../../overview.md)(§1.1 术语表)
8
+ - [tiling.md](tiling.md)
9
+ - [tiling-preprocess.md](../../tiling-preprocess.md)
10
+ - [common/vf-programming-rules.md](../../../../../common/vf-programming-rules.md)
11
+ - [common/cast-rules.md](../../../../../common/cast-rules.md)
12
+ - [common/sync-and-consistency.md](../../../../../common/sync-and-consistency.md)
13
+ - [common/datacopypad-rules.md](../../../../../common/datacopypad-rules.md)
14
+
15
+ **范式 kernel 约束**:
16
+ - 统一使用 TBuf,不使用 TQue,TQue 隐藏的同步操作增加模型理解复杂度
17
+ - 同步必须配套使用,一个 SetFlag 就必须有一个 WaitFlag -- HardEvent
18
+ - VF 统一使用 `asc_vf_call` 调用, 不使用 `__VEC_SCOPE__`
19
+
20
+ **Kernel 代码规则**(所有 reduce 算子遵守):
21
+ 1. **连续 vector 计算 ≥ 2 个必须合入一个 VF**:减少 UB↔register 来回
22
+ 2. **VF 函数硬约束**:详见 [common/vf-programming-rules.md](../../../../../common/vf-programming-rules.md) §9
23
+ 3. **C++ 标准库走 `AscendC::` 命名空间**,不用 `std::`
24
+ 4. **`UpdateMask` 引用传递**:详见 [common/vf-programming-rules.md](../../../../../common/vf-programming-rules.md) §3
25
+ 5. **b16↔fp32 必须配对使用 dist 模式**:详见 [common/cast-rules.md](../../../../../common/cast-rules.md) §4
26
+ 6. **dtype 走 `DTYPE_X` 编译期实例化**:不需要手动 `if constexpr (dtype == ...)` 分支
27
+
28
+ ## 1 kernel 概述
29
+
30
+ ### 1.1 数据流图
31
+
32
+ BinaryBase 模板使用二分缓存树,适用于所有 reduce 算子(sum/mean/max/min/prod/any/all)。对 sum/mean 有精度收益,对 max/min/any/all 结果不变(满足结合律),prod 因 fp 舍入不满足结合律、结果可能有差异。每个 aLoopIdx 一棵独立二分缓存树,单 for 循环内通过 `i < bisectionTail` 判定是否配对二分尾块(Phase A),否则二分主块独立处理(Phase B)。
33
+
34
+ ```
35
+ 每个 aLoopIdx 内:
36
+ GM_x ──→ CopyIn → PreElewise ──┐
37
+ ├─ Phase A(i < bisectionTail):二分主块 + 二分尾块 merge → Reduce → cacheBuf[层i]
38
+ GM_x ──→ CopyIn → PreElewise ──┘ Phase B(i ≥ bisectionTail):仅二分主块 → Reduce → cacheBuf[层i]
39
+ DoCaching:cacheBuf[层i] 就地吸收低层
40
+
41
+ cacheBuf 树根 ──→ PostElewise ──→ CopyOut ──→ GM_y
42
+ ```
43
+
44
+ ### 1.2 kernel IR 描述
45
+
46
+ 本节以IR的形式描述如何将二分缓存树算法引入实际 kernel 代码中。以 ReduceSum `A0 R0 A1 R1`(tail-R,aSplitIdx=A1,rSplitIdx=R0)为例。
47
+
48
+ **注意**:以下只是IR简述,未考虑`UB内对齐约束/DataCopyPad实现转置/buffer复用关系/pad清零`等等,细节会在后续展开讨论。
49
+
50
+ # A1 → A1.o × A1.i, R0 → R0.o × R0.i
51
+ # tail-R: UB = [A_bundle, R_bundle]
52
+
53
+ (1) 原始态,考虑切分,但不考虑二分累加
54
+
55
+ ```pseudocode
56
+ aOuter = A0 × A1.o
57
+ for aLoopIdx in [0, aOuter):
58
+ A0_idx = aLoopIdx / A1.o
59
+ A1_o_idx = aLoopIdx % A1.o
60
+ a1Len = min(A1.i, A1 - A1_o_idx × A1.i) # 可能存在 `A 切分尾块`(a1Len < A1.i)
61
+
62
+ # 顺序累加进 reduceResult
63
+ reduceResult = [0] * A1.i
64
+ rOuter = R0.o # R切分轴无更外层R了,fuse后就是 R0.o
65
+ for rIdx in [0, rOuter):
66
+ R0_o_idx = rIdx
67
+ r0Len = min(R0.i, R0 - R0_o_idx × R0.i) # 可能存在 `R 切分尾块`(r0Len < R0.i,即 partial chunk)
68
+
69
+ # 源地址
70
+ srcGM = GM[A0_idx:1, R0_o_idx * R0.i:r0Len, A1_o_idx * A1.i:a1Len, 0:R1] # 分别表示GM中每一维的`偏移:长度`
71
+ buffer0 = CopyIn(srcGM) # buffer0 内只看到2根轴 [A_bundle, R_bundle];此处未考虑 MTE2 通过 DataCopyPad 实现转置装入的细节,后续 §4.2 展开
72
+ buffer1 = PreElewise(buffer0)
73
+ buffer2 = Reduce(buffer1) # reduce后为[A_bundle]大小
74
+ reduceResult += buffer2
75
+ buffer3 = PostElewise(reduceResult)
76
+ CopyOut(buffer3) → GM[A0_idx:1, A1_o_idx * A1.i:a1Len] # 有效长度 a1Len
77
+ ```
78
+
79
+ (2) 为提升累加精度,引入二分缓存树算法,(1) 中原始态的算法有如下改变
80
+
81
+ ```pseudocode
82
+ aOuter = A0 × A1.o
83
+ for aLoopIdx in [0, aOuter):
84
+ A0_idx = aLoopIdx / A1.o
85
+ A1_o_idx = aLoopIdx % A1.o
86
+ a1Len = min(A1.i, A1 - A1_o_idx × A1.i) # 可能存在 `A 切分尾块`(a1Len < A1.i)
87
+
88
+ # 此处引入二分缓存树,使用cacheBuf缓存中间reduce的结果。大小固定 16KB,见 [tiling.md](tiling.md) §5.1
89
+ cacheBuf = [0] # 16 KB
90
+ rOuter = R0.o # R切分轴无更外层R了,fuse后就是 R0.o
91
+ bisectionPos = nearestPower2(rOuter) # 小于 rOuter 的最大的 2^n 二分主块数
92
+ bisectionTail = rOuter - bisectionPos # 二分尾块数
93
+
94
+ for rIdx in [0, bisectionPos):
95
+ {
96
+ # 二分主块
97
+ R0_o_idx = rIdx
98
+ r0Len = min(R0.i, R0 - R0_o_idx × R0.i) # 可能存在 `R 切分尾块`(r0Len < R0.i,即 partial chunk)
99
+ # 源地址
100
+ srcGM = GM[A0_idx:1, R0_o_idx * R0.i:r0Len, A1_o_idx * A1.i:a1Len, 0:R1] # 分别表示GM中每一维的`偏移:长度`
101
+ buffer0 = CopyIn(srcGM) # buffer0 内只看到2根轴 AR: [A_bundle, R_bundle]
102
+ preReduceResult = PreElewise(buffer0)
103
+ }
104
+ if (rIdx < bisectionTail) {
105
+ # 二分尾块
106
+ R0_o_idx_tail = rIdx + bisectionPos
107
+ r0Len_tail = min(R0.i, R0 - R0_o_idx_tail × R0.i) # 可能存在 `R 切分尾块`(r0Len_tail < R0.i,即 partial chunk)
108
+ # 源地址
109
+ srcGMTail = GM[A0_idx:1, R0_o_idx_tail * R0.i:r0Len_tail, A1_o_idx * A1.i:a1Len, 0:R1] # 分别表示GM中每一维的`偏移:长度`
110
+ buffer1 = CopyIn(srcGMTail) # buffer1 内只看到2根轴 AR: [A_bundle, R_bundle]
111
+ preReduceResultTail = PreElewise(buffer1)
112
+ preReduceResult = preReduceResult + preReduceResultTail # 合并二分主块和二分尾块
113
+ }
114
+
115
+ cacheBuf[GetCacheID(rIdx) * a1Len : a1Len] = Reduce(preReduceResult) # reduce后为[A_bundle]大小;此处未考虑 cacheBuf 层 stride 的 32B 对齐,后续 §5.1 展开为 levelStride
116
+ DoCaching(GetCacheID(rIdx)) # 合并 cacheBuf[GetCacheID(rIdx)] 及前面的数据并写回到 cacheBuf[GetCacheID(rIdx)]
117
+ buffer3 = PostElewise(GetCacheRoot()) # GetCacheRoot() = cacheBuf + CalLog2(bisectionPos) * levelStride,是最终的reduce结果
118
+ CopyOut(buffer3) → GM[A0_idx:1, A1_o_idx * A1.i:a1Len] # 有效长度 a1Len
119
+ ```
120
+
121
+
122
+ ## 2 Kernel 骨架代码
123
+
124
+ ### 2.1 kernel骨架代码
125
+
126
+ ```cpp
127
+ template <typename D_T>
128
+ class KernelXxx { // ← 占位名,每算子换成自己的类名
129
+ // ─── 成员变量 ───
130
+ // GM:
131
+ GlobalTensor<D_T> xGm_, yGm_;
132
+ // UB:
133
+ TBuf preInBuf_, preReduceResult_, preReduceResultTail_, cacheBuf_, ...;
134
+ TPipe *pipe_ = nullptr;
135
+ const TilingData *td_ = nullptr;
136
+ bool isTailR_ = false; // tail 类型:Init 由 axisNum 奇偶现算
137
+
138
+ public:
139
+ __aicore__ inline void Init(GM_ADDR x, GM_ADDR y, const TilingData* td, TPipe* pipe) {
140
+ // Init GM
141
+ // Init TBuf
142
+ pipe_ = pipe;
143
+ td_ = td;
144
+ isTailR_ = (td_->axisNum % 2 == 0); // 偶数轴→tail-R,奇数轴→tail-A
145
+ }
146
+ __aicore__ inline void Process() {
147
+ int64_t blockIdx = GetBlockIdx();
148
+ if (blockIdx >= td_->usedCoreNum) return;
149
+
150
+ // 核间偏移计算: blockIdx → [aLoopStart, aLoopEnd)
151
+ int64_t aLoopStart, aLoopEnd;
152
+ UnravelBlockLoop();
153
+
154
+ for (int64_t aLoopIdx = aLoopStart; aLoopIdx < aLoopEnd; ++aLoopIdx) {
155
+ int64_t aIdx[MAX_PATTERN_RANK], aSplitChunkIdx;
156
+ UnravelALoop(aLoopIdx, aIdx, aSplitChunkIdx);
157
+ int64_t a_off = aSplitChunkIdx * aUbFactor;
158
+ int64_t a_len = min(aUbFactor, axisShape[aSplitIdx] - a_off);
159
+ OuterIdx aIdxBundle { aIdx, a_off, a_len };
160
+ // ─── Base 路径(二分缓存树)───
161
+ int64_t rLoopCntTotal = td_->rLoopCntTotal;
162
+ int64_t bisectionPos = FindNearestPower2(rLoopCntTotal);
163
+ int64_t bisectionTail = rLoopCntTotal - bisectionPos;
164
+
165
+ for (int64_t rIdx = 0; rIdx < bisectionPos; ++rIdx) {
166
+ // ── 二分主块 → preReduceResult ──
167
+ int64_t rOuterIdx_main[MAX_PATTERN_RANK], rChunkIdx_main, rLen_main;
168
+ UnravelRLoop(rIdx, rOuterIdx_main, rChunkIdx_main, rLen_main);
169
+ ProcessOneRChunk(aIdxBundle, rOuterIdx_main, rChunkIdx_main, rLen_main,
170
+ preReduceResult_, /*paddedSize=*/rUbFactorAlign);
171
+ if (rLen_main < rUbFactor)
172
+ ClearChunkExtensionVf(preReduceResult_, rLen_main); // 简化示意;完整参数见 §5.1.2.2
173
+
174
+ // ── 二分主块 BurstPad 清零(tail-R 恒清)──
175
+ if (isTailR_) {
176
+ burstTail = (rSplitIdx == LastR) ? rLen_main : axisShape[LastR];
177
+ if (burstTail % bsElem != 0) ClearInnerBurstTailPadVf(preReduceResult_, burstTail); // 简化示意;完整参数见 §5.1.2.2
178
+ }
179
+
180
+ // ── Phase A(rIdx < bisectionTail):配对二分尾块 → preReduceResultTail ──
181
+ if (rIdx < bisectionTail) {
182
+ int64_t rOuterIdx_tail[MAX_PATTERN_RANK], rChunkIdx_tail, rLen_tail;
183
+ UnravelRLoop(rIdx + bisectionPos, rOuterIdx_tail, rChunkIdx_tail, rLen_tail);
184
+ ProcessOneRChunk(aIdxBundle, rOuterIdx_tail, rChunkIdx_tail, rLen_tail,
185
+ preReduceResultTail_, /*paddedSize=*/rUbFactorAlign);
186
+ if (rLen_tail < rUbFactor)
187
+ ClearChunkExtensionVf(preReduceResultTail_, rLen_tail); // 简化示意;完整参数见 §5.1.2.2
188
+
189
+ // ── 二分尾块 BurstPad 清零(tail-R 恒清)──
190
+ if (isTailR_) {
191
+ burstTail = (rSplitIdx == LastR) ? rLen_tail : axisShape[LastR];
192
+ if (burstTail % bsElem != 0) ClearInnerBurstTailPadVf(preReduceResultTail_, burstTail); // 简化示意;完整参数见 §5.1.2.2
193
+ }
194
+ MergeTmpBufVf(preReduceResult_, preReduceResultTail_);
195
+ }
196
+
197
+ // ── Reduce: preReduceResult(src) → cacheBuf[GetCacheID(rIdx)](dst) ──
198
+ // levelStride = CeilAlign(laneA, 8),laneA = aUbFactor × innerAProdAlign,详见 §5.1
199
+ int64_t cacheID = GetCacheID(rIdx);
200
+ ReduceXxx(cacheBuf_ + cacheID * levelStride, preReduceResult_,
201
+ /*srcShape={..., rUbFactorAlign × innerRProdAlign}*/);
202
+ DoCaching(cacheID);
203
+ }
204
+
205
+ auto result = GetCacheRoot();
206
+ PostElewise(result); // 含 算子专属 elewise + cast_down(同一 VF 完成)
207
+ CopyOut(aIdxBundle, result);
208
+ }
209
+ }
210
+ private:
211
+ __aicore__ inline void ProcessOneRChunk(...); // CopyIn(MTE2 转置装入)→preInBuf + PreElewise→preReduceResult/preReduceResultTail
212
+ __aicore__ inline void CopyOut(...);
213
+ };
214
+ ```
215
+
216
+ > 具体算子实现时按 §5 替换为具体值/API。
217
+
218
+ ## 3 地址偏移计算
219
+
220
+ ### 3.1 核间偏移计算
221
+
222
+ 当前模板只使用A轴开多核,需要计算当前核处理的A轴的起/止位置,即 blockIdx → [aLoopStart, aLoopEnd),对应 `UnravelBlockLoop()`:
223
+
224
+ ```cpp
225
+ // blockIdx → [aLoopStart, aLoopEnd)
226
+ if (blockIdx < aBigCoreCnt) {
227
+ aLoopStart = blockIdx * aBigCoreLoopCnt;
228
+ aLoopEnd = aLoopStart + aBigCoreLoopCnt;
229
+ } else {
230
+ aLoopStart = aBigCoreCnt * aBigCoreLoopCnt
231
+ + (blockIdx - aBigCoreCnt) * aSmallCoreLoopCnt;
232
+ aLoopEnd = aLoopStart + aSmallCoreLoopCnt;
233
+ }
234
+ ```
235
+
236
+ ### 3.2 核内循环间偏移计算
237
+
238
+ 单核内既有A轴的循环,又有R轴的循环(即UB间的循环),分别计算 loop 循环 → 多维索引解码:
239
+
240
+ #### UnravelALoop()
241
+
242
+ reduction的切分策略是将A轴切分轴的 aSplitChunkCnt(即 A.o)与左侧所有A轴fuse在一起的,一维的循环索引 `aLoopIdx` 需解码为多维 A 轴索引: `aSplitChunkIdx` 为 aSplitIdx 轴上的 chunk 序号,`aIdx[]` 为 aSplitIdx 左侧所有外层 A 轴的索引(用于算 GM 偏移)。
243
+
244
+ ```cpp
245
+ // aLoopIdx → (aIdx[outer A], aSplitChunkIdx)
246
+ void UnravelALoop(int64_t aLoopIdx, int64_t aIdx[], int64_t& aSplitChunkIdx) {
247
+ int64_t rem = aLoopIdx;
248
+ aSplitChunkIdx = rem % aSplitChunkCnt;
249
+ rem /= aSplitChunkCnt;
250
+ // 从 aSplitIdx 的左邻 A 向外侧依次拆(k 取 A 轴位置=偶下标,步长 2 越过 R 轴)
251
+ for (int32_t k = aSplitIdx - 2; k >= 0; k -= 2) {
252
+ aIdx[k] = rem % axisShape[k];
253
+ rem /= axisShape[k];
254
+ }
255
+ }
256
+ ```
257
+
258
+ #### UnravelRLoop()
259
+
260
+ R轴切分轴的 rSplitChunkCnt(即 R.o)与左侧所有 R 轴是fuse在一起的, 一维 `rIdx` 索引需解码为多维 R 轴索引:`rChunkIdx` 为 rSplitIdx 轴上的 chunk 序号,`rLen` 为当前 chunk 的实际长度(可能 partial),`rOuterIdx[]` 为 rSplitIdx 左侧所有外层 R 轴的索引(用于算 GM 偏移)。其中 `rSplitChunkCnt = CeilDiv(axisShape[rSplitIdx], rUbFactor)`(R 切分轴的 chunk 数)。
261
+
262
+ ```cpp
263
+ // rIdx → (rOuterIdx[outer R], rChunkIdx, rLen)
264
+ void UnravelRLoop(int64_t rIdx, int64_t rOuterIdx[], int64_t& rChunkIdx, int64_t& rLen) {
265
+ rChunkIdx = rIdx % rSplitChunkCnt;
266
+ int64_t rem = rIdx / rSplitChunkCnt;
267
+ // 从 rSplitIdx 的左邻 R 向外侧依次拆(k 取 R 轴位置=奇下标,步长 2 越过 A 轴)
268
+ // 下标 0 必为 A(leading A 规则),R 轴最低下标为 1
269
+ for (int32_t k = rSplitIdx - 2; k >= 1; k -= 2) {
270
+ rOuterIdx[k] = rem % axisShape[k];
271
+ rem /= axisShape[k];
272
+ }
273
+ rLen = min(rUbFactor, axisShape[rSplitIdx] - rChunkIdx * rUbFactor);
274
+ }
275
+ ```
276
+
277
+ #### GM 偏移计算
278
+
279
+ **输入起始偏移**:
280
+
281
+ ```
282
+ offset_in = Σ_{k_A < aSplitIdx, k_A 是 A 轴} aIdx[k_A] × axisStride[k_A] // 外层 A 轴(来自 UnravelALoop)
283
+ + aSplitChunkIdx × aUbFactor × axisStride[aSplitIdx] // A 切分轴
284
+ + Σ_{k_R < rSplitIdx, k_R 是 R 轴} rOuterIdx[k_R] × axisStride[k_R] // 外层 R 轴(来自 UnravelRLoop)
285
+ + rChunkIdx × rUbFactor × axisStride[rSplitIdx] // R 切分轴
286
+ ```
287
+
288
+ **输出偏移**(输出 shape = 各 A 轴 size 顺序拼接,连续、紧凑,无 R 维):
289
+
290
+ ```
291
+ output_strides[k_A] = ∏(更内 A 轴的 size)
292
+ offset_out = Σ_{k_A} a_idx_{k_A} × output_strides[k_A]
293
+ + aSplitChunkIdx × aUbFactor × output_strides[aSplitIdx 对应的 A 轴序号]
294
+ ```
295
+
296
+ ## 4 CopyIn MTE2 逻辑
297
+
298
+ ### 4.1 MTE2 指令选型
299
+
300
+ 必读知识 [common/datacopypad-rules.md](../../../../../common/datacopypad-rules.md)。reduce 场景使用 DataCopyPad + Loop 模式完成"转置"装入。
301
+
302
+ **UB 内 aSplitIdx 的切分因子 aUbFactor 及其右侧所有 A 轴聚成 A_bundle、rSplitIdx 的切分因子 rUbFactor 及其右侧所有 R 轴聚成 R_bundle**,由 DataCopyPad 的 stride/blockCount 实现"转置"装入(尾轴不转置)。bundle 内外顺序由 tail 类型决定:
303
+ - **tail R**:UB = `[A_bundle 在外, R_bundle 在内]`,最内 R 是 burst 尾轴
304
+ - **tail A**:UB = `[R_bundle 在外, A_bundle 在内]`,最内 A 是 burst 尾轴
305
+
306
+ **字段映射规律**(从 UB 内到外):
307
+
308
+ | UB 轴位置 | 对应字段 |
309
+ |-----------|---------|
310
+ | 第 1 根(burst 尾轴) | `blockLen`(byte) |
311
+ | 第 2 根 | `blockCount` |
312
+ | 第 3 根 | `loop1Size` |
313
+ | 第 4 根 | `loop2Size` |
314
+ | 第 5 根及更外 | for 循环 |
315
+
316
+ **stride 双语义**(不可混用):
317
+
318
+ > 本章是描述 MTE2,从 gm->ub 语义
319
+
320
+ | 字段类型 | 语义 | 公式 |
321
+ |---------|------|------|
322
+ | `DataCopyExtParams.srcStride` | **gap**(尾→头),减一次 `blockLen` | `axisShape[burst尾轴] × sizeof(D_T) − blockLen` |
323
+ | `LoopModeParams.loop*SrcStride` | **advance**(头→头),直接用 | `axisStride[对应外层轴] × sizeof(D_T)` |
324
+
325
+ **K 平台分级**:
326
+ - K=2:只用 blockLen + blockCount
327
+ - K∈[3,4]:必须 Loop 模式,且 `SetLoopModePara` + `ResetLoopModePara`
328
+ - K≥5:第 5 根及更外用 for 拆(所有平台)
329
+
330
+
331
+ **isPad 与 paddingValue**:
332
+
333
+ burst 尾轴 bundle 必须 block 对齐(非对齐时 Ascend950 访存性能很差),UB 行宽由 `paddedNum` 保证,BurstPad 区域是行宽对齐的必然产物。
334
+
335
+ ```cpp
336
+ DataCopyPadExtParams<D_T> padParams{/*isPad=*/false, /*leftPadding=*/0, /*rightPadding=*/0, /*paddingValue=*/0};
337
+ ```
338
+
339
+ - 行宽对齐由 HW 自动保证:UB 侧每行实际占用恒为 `CeilAlign(blockLen, 32B)`,与 `rightPadding` 无关
340
+ - `isPad=false`、`rightPadding=0`:补区填首元素值(脏数据),不承载任何语义,Reduce 前由 kernel 统一清零(§5.1.2)
341
+
342
+ ### 4.2 UB内数据排布格式
343
+
344
+ **原则**:
345
+ 由于二分累加存在merge的操作,即会将 `切分尾块 UB` + `切分整块 UB` 做合并,我们默认要求两块UB占用大小一样(即切分尾块使用切分整块的 layout, laneA = aUbFactor × innerAProdAlign; laneR = rUbFactorAlign × innerRProdAlign),非有效数据位置必须清为 `pad_value`(kernel 清零保证,§5.1.2)
346
+
347
+ MTE2 搬运 UB 后,UB 内是 bundled layout。装入 UB 后只看尾轴的类型:尾 R → 视为 `AR`;尾 A → 视为 `RA`。
348
+
349
+ UB 内存在两类 pad:
350
+
351
+ - **BurstPad**:burst 尾轴方向尾部的 pad(行宽对齐的必然产物),值是脏数据(rightPadding=0 → HW 填首元素值)
352
+ - **ExtensionPad**:partial chunk(rLen < rUbFactor)时,R 切分轴方向 `[rLen, rUbFactor)` 范围的切片,未搬入的 stale,值不确定。需要代码显示清理 stale,设置为 `pad_value`
353
+
354
+ > A 方向 BurstPad/ExtensionPad stale数据不影响累加结果; R 方向 BurstPad/ExtensionPad stale数据会影响累加结果。
355
+
356
+ ### 4.2.1 非切尾轴场景
357
+
358
+ burst 尾轴是整根轴(未被 UB 切分),BurstPad 取决于该轴 size 是否对齐。
359
+
360
+ **tail-R 非切尾轴**:`A0 R0 A1 R1`(aSplit=A1,rSplit=R0),fp32,R1=5(非对齐),rUbFactor=4,rLen=3(partial),aUbFactor=2。UB = `[A_bundle, R_bundle]`,从内到外:R1 → R0.i → A1.i。每个 R0.i 切片含 R1 个元素(padded 到 8):
361
+
362
+ ```
363
+ R切分主块(rUbFactor) R_bundle 的排布:
364
+ R0.i=0: [R1=5 valid │ BurstPad=3] ← DataCopyPad 搬入,BurstPad=脏数据
365
+ R0.i=1: [R1=5 valid │ BurstPad=3]
366
+ R0.i=2: [R1=5 valid │ BurstPad=3]
367
+ R0.i=3: [R1=5 valid │ BurstPad=3]
368
+
369
+ R切分尾块(rLen) R_bundle 的排布:
370
+ R0.i=0: [R1=5 valid │ BurstPad=3] ← DataCopyPad 搬入,BurstPad=脏数据
371
+ R0.i=1: [R1=5 valid │ BurstPad=3]
372
+ R0.i=2: [R1=5 valid │ BurstPad=3]
373
+ R0.i=3: [───── ExtensionPad ────] ← partial 未搬,stale
374
+ ```
375
+
376
+ BurstPad 在 R 方向(R1 是 R 轴)→ 需置0 → Reduce 累加。ExtensionPad 在 R 方向(R0.i 是 R 轴)→ 需置0 → Reduce 累加。
377
+
378
+ **tail-A 非切尾轴**:`A0 R0 A1`(aSplit=A0,rSplit=R0),fp32,A1=5(非对齐),rUbFactor=4,rLen=3(partial),aUbFactor=2。UB = `[R_bundle, A_bundle]`,从内到外:A1 → A0.i → R0.i。每个 R0.i 切片含整个 A_bundle(A0.i × A1,A1 padded 到 8):
379
+
380
+ ```
381
+ R切分主块(rUbFactor) R_bundle 的排布:
382
+ R0.i=0, A0.i=0: [A1=5 valid │ BurstPad=3] ← A 方向 pad
383
+ R0.i=0, A0.i=1: [A1=5 valid │ BurstPad=3]
384
+ ...
385
+ R0.i=3, A0.i=0: [A1=5 valid │ BurstPad=3]
386
+ R0.i=3, A0.i=1: [A1=5 valid │ BurstPad=3]
387
+
388
+ R切分尾块(rLen) R_bundle 的排布:
389
+ R0.i=0, A0.i=0: [A1=5 valid │ BurstPad=3] ← A 方向 pad
390
+ R0.i=0, A0.i=1: [A1=5 valid │ BurstPad=3]
391
+ ...
392
+ R0.i=3, A0.i=0: [────── stale ×8 ──────] ← ExtensionPad
393
+ R0.i=3, A0.i=1: [────── stale ×8 ──────]
394
+ ```
395
+
396
+ BurstPad 在 A 方向(A1 是 A 轴)→ Reduce 不累加 → **不需清**。ExtensionPad 在 R 方向(R0.i 是 R 轴)→ Reduce 累加 → 需置0。
397
+
398
+ ### 4.2.2 切尾轴场景
399
+
400
+ burst 尾轴是 split 切分内层(rSplit==LastR 或 aSplit==LastA),BurstPad 取决于 rLen/aLen 是否对齐,且同一行内 BurstPad 后面紧跟该方向的 ExtensionPad。
401
+
402
+ **tail-R 切尾轴**(rSplit==LastR):`A0 R0 A1 R1`(aSplit=A0,rSplit=R1=LastR),fp32,rUbFactor=16,rUbFactorAlign=16,rLen=5(partial),aUbFactor=2,A1=3。UB = `[A_bundle, R_bundle]`,从内到外:R1.i → A1 → A0.i。每个 A entry 一行 rUbFactorAlign=16 个 fp32:
403
+
404
+ ```
405
+ R切分主块(rUbFactor) R_bundle 的排布:
406
+ [------------- valid=16 --------------]
407
+ ↑
408
+ rLen=rUbFactor=16(对齐,无 BurstPad;full chunk,无 ExtensionPad)
409
+
410
+ R切分尾块(rLen) R_bundle 的排布:
411
+ [valid=5 │ BurstPad=3 │ ExtensionPad=8]
412
+ ↑ ↑ ↑
413
+ rLen HW自动补到32B [CeilAlign(rLen,8), rUbFactorAlign)
414
+ ```
415
+
416
+ BurstPad 在 R 方向 → 需置0。ExtensionPad 也在 R 方向 → 需置0。与非切尾轴的区别:同一行内 BurstPad 后面紧跟 ExtensionPad(rUbFactorAlign > CeilAlign(rLen, bsElem))。
417
+
418
+ **tail-A 切尾轴**(aSplit==LastA):`A0 R0 A1`(aSplit=A1=LastA,rSplit=R0),fp32,aUbFactor=16(对齐),aLen=5(partial),rUbFactor=4,rLen=3(partial)。UB = `[R_bundle, A_bundle]`,从内到外:A1.i → R0.i。每个 R0.i 切片 = aUbFactor=16 个 fp32:
419
+
420
+ ```
421
+ R切分主块(rUbFactor) R_bundle 的排布:
422
+ R0.i=0: [valid=5 │ BurstPad=3 │ ExtensionPad=8] ← A 方向 pad
423
+ R0.i=1: [valid=5 │ BurstPad=3 │ ExtensionPad=8]
424
+ R0.i=2: [valid=5 │ BurstPad=3 │ ExtensionPad=8]
425
+ R0.i=3: [valid=5 │ BurstPad=3 │ ExtensionPad=8]
426
+
427
+ R切分尾块(rLen) R_bundle 的排布:
428
+ R0.i=0: [valid=5 │ BurstPad=3 │ ExtensionPad=8] ← A 方向 pad
429
+ R0.i=1: [valid=5 │ BurstPad=3 │ ExtensionPad=8]
430
+ R0.i=2: [valid=5 │ BurstPad=3 │ ExtensionPad=8]
431
+ R0.i=3: [──────── stale =16 ────────] ← R 方向 ExtensionPad
432
+ ```
433
+
434
+ A1.i 是 A 轴 → BurstPad 和 A 方向 ExtensionPad 都在 A 方向 → **不需置0**。R0.i=3 是 R 方向 ExtensionPad → 需置0。与非切尾轴的区别:同一行内 BurstPad 后面有 A 方向 ExtensionPad(aUbFactor > CeilAlign(aLen, bsElem)),两者都不需置0。
435
+
436
+ ### 4.2.3 总结
437
+
438
+ | | BurstPad(burst 尾轴方向) | ExtensionPad(尾块方向) |
439
+ |---|---|---|
440
+ | **tail-R** | R 方向,Reduce 累加,需置0 | R 方向,Reduce 累加,需置0 |
441
+ | **tail-A** | A 方向,Reduce 不累加,不需置0 | R 方向,Reduce 累加,需置0 |
442
+
443
+ - **BurstPad**:搬运不指定 paddingValue(isPad=false),是脏数据。tail-R 恒需置0(§5.1.2);tail-A 在 A 方向,不需置0
444
+ - **ExtensionPad**:DataCopyPad 无法覆盖 Extension 部分,必须显式置0
445
+
446
+ ### 4.2.4 DoCopyInTile 完整骨架
447
+
448
+ **目的**:统计需要搬入UB内的每个 `A/R` 轴信息(如有效长度、stride等),供 DataCopyPad 逐字段映射搬运参数。
449
+
450
+ `BuildUBAxes` 根据 aSplitIdx / rSplitIdx / isTailR,从 **GM 最内层向外**构造 UB 轴列表。下标 `[0]` 为 burst 尾轴(UB 最内层),下标 `[K-1]` 为 UB 最外侧轴,`K` 是 UB 内总轴数(2 ≤ K ≤ axisNum)。
451
+
452
+ ```cpp
453
+ struct UBAxisDesc {
454
+ int32_t gmIdx; // 原 pattern 轴序号(0..axisNum-1),GM 偏移还原用
455
+ int64_t actualNum; // actual 元素数 → blockLen / blockCount / loopSize
456
+ int64_t paddedNum; // UB 行步距元素数 → dstStride / ubStride
457
+ // 切分轴(rSplitIdx/aSplitIdx):rUbFactorAlign / aUbFactor(对齐后的切分因子,整块 layout)
458
+ // 非切分的 burst 尾轴:CeilAlign(axisSize, bsElem);其余 = actualNum
459
+ int64_t gmStride; // GM stride(元素,来自 axisStride → srcStride / loop*SrcStride)
460
+ };
461
+ ```
462
+
463
+ ```cpp
464
+ void DoCopyInTile(int64_t baseGmOff, int64_t aLen, int64_t rLen, LocalTensor<D_T>& preIn) {
465
+ UBAxisDesc ubAxes[MAX_PATTERN_RANK];
466
+ const int32_t K = BuildUBAxes(aLen, rLen, ubAxes);
467
+ const int64_t dt = sizeof(D_T);
468
+
469
+ // ── 第 1 根 → blockLen;行内 padding 由 paddedNum 决定 dstStride ──
470
+ DataCopyExtParams ext;
471
+ ext.blockLen = ubAxes[0].actualNum * dt; // 有效字节
472
+
473
+ DataCopyPadExtParams<D_T> padParams{/*isPad=*/false, /*leftPadding=*/0, /*rightPadding=*/0, /*paddingValue=*/0};
474
+
475
+ int64_t copyPadBytes = CeilAlign(ext.blockLen, 32); // HW 在 UB 上占的字节(32B 粒度)
476
+ int64_t target0Bytes = ubAxes[0].paddedNum * dt; // 固定 UB 行步距
477
+ ext.dstStride = (target0Bytes - copyPadBytes) / 32; // UB 侧 gap(partial chunk 时 > 0),单位 datablock
478
+
479
+ // ── 第 2 根 → blockCount;srcStride = gap(尾→头),减一次 blockLen ──
480
+ if (K >= 2) {
481
+ ext.blockCount = ubAxes[1].actualNum;
482
+ ext.srcStride = ubAxes[1].gmStride * dt - ext.blockLen; // GM 侧 gap 语义
483
+ } else {
484
+ ext.blockCount = 1;
485
+ ext.srcStride = 0;
486
+ }
487
+ ext.rsv = 0; // 必须显式填 0(datacopypad-rules.md)
488
+
489
+ // ── UB 每层字节步长:ubStride[0]=dt;ubStride[k]=ubStride[k-1]×paddedNum[k-1] ──
490
+ int64_t ubStride[MAX_PATTERN_RANK];
491
+ ubStride[0] = dt;
492
+ for (int32_t i = 1; i < K; ++i) ubStride[i] = ubStride[i-1] * ubAxes[i-1].paddedNum;
493
+
494
+ // ── 第 3/4 根 → loop1/loop2;loop*Stride = advance(头→头),直接 axisStride×dt ──
495
+ LoopModeParams lp{}; // 全 0
496
+ if (K >= 3) {
497
+ lp.loop1Size = ubAxes[2].actualNum;
498
+ lp.loop1SrcStride = ubAxes[2].gmStride * dt; // advance 语义
499
+ lp.loop1DstStride = ubStride[2];
500
+ lp.loop2Size = 1; // ★ 哪怕外层不用也必须 ≥ 1,否则整批搬运 0 次
501
+ }
502
+ if (K >= 4) {
503
+ lp.loop2Size = ubAxes[3].actualNum;
504
+ lp.loop2SrcStride = ubAxes[3].gmStride * dt;
505
+ lp.loop2DstStride = ubStride[3];
506
+ }
507
+
508
+ const bool useLoopMode = (K >= 3);
509
+ if (useLoopMode) SetLoopModePara(lp, DataCopyMVType::OUT_TO_UB); // ★ 调用前 set
510
+
511
+ // ── 第 5 根及更外 → for 拆;K≤4 时 outerProd=1,循环一次 ──
512
+ int64_t outerProd = 1;
513
+ for (int32_t k = 4; k < K; ++k) outerProd *= ubAxes[k].actualNum;
514
+ for (int64_t flat = 0; flat < outerProd; ++flat) {
515
+ int64_t addGm = 0, addUbBytes = 0, cur = flat;
516
+ for (int32_t k = 4; k < K; ++k) {
517
+ int64_t ix = cur % ubAxes[k].actualNum; cur /= ubAxes[k].actualNum;
518
+ addGm += ix * ubAxes[k].gmStride;
519
+ addUbBytes += ix * ubStride[k];
520
+ }
521
+ DataCopyPad(preIn[addUbBytes / dt], xGm[baseGmOff + addGm], ext, padParams);
522
+ }
523
+
524
+ if (useLoopMode) ResetLoopModePara(DataCopyMVType::OUT_TO_UB); // ★ 调用后 reset,成对出现
525
+ }
526
+ ```
527
+
528
+ ## 5 Compute 计算逻辑
529
+
530
+ ### 5.1 算法描述
531
+
532
+ #### 5.1.1 二分缓存树算法
533
+
534
+ 二分缓存树的完整算法(GetCacheID 公式与演化表、DoCaching 吸收逻辑、FindNearestPower2/CalLog2、Phase A/B 主尾配对)详见 [binary-tree.md](../../binary-tree.md)。
535
+
536
+ **kernel 侧变量与 binary-tree.md 的映射**:
537
+
538
+ | kernel-template 变量 | binary-tree.md 概念 | 计算方式 | 说明 |
539
+ |---|---|---|---|
540
+ | `rLoopCntTotal` | `M`(总块数) | tiling 算出 | R 切分后的总 chunk 数 |
541
+ | `bisectionPos` | `P`(主段长度,2 幂) | `FindNearestPower2(rLoopCntTotal)` | 严格小于 M 的最大 2 幂 |
542
+ | `bisectionTail` | `T`(尾段长度) | `rLoopCntTotal - bisectionPos` | Phase A 配对数 |
543
+ | `cacheCount` | `L`(缓存树层数) | `CalLog2(bisectionPos) + 1` | cacheBuf 层数 |
544
+ | `GetCacheID(rIdx)` | `GetCacheID(i)` | `count_ones(rIdx ^ (rIdx+1)) - 1` | 写入层级 |
545
+ | `levelStride` | —(sum.md 无此概念) | `CeilAlign(laneA, 8)` | cacheBuf 每层物理 stride,kernel 侧新增 |
546
+ | `GetCacheRoot()` | `GetCacheRoot(P)` = `cache[L-1]` | `cacheBuf + (cacheCount-1) × levelStride` | 树根位置 |
547
+
548
+ **levelStride 对齐约束**:
549
+
550
+ ```cpp
551
+ constexpr uint32_t BLOCK_F32 = 32 / sizeof(float); // = 8
552
+ const uint32_t levelStride = (laneA + BLOCK_F32 - 1) / BLOCK_F32 * BLOCK_F32;
553
+ ```
554
+
555
+ **约束**:cacheBuf 每层 stride 必须 `CeilAlign(laneA, 8)`(32B 对齐)。VF `LoadAlign`/`StoreAlign` 强制 32B 对齐起点。
556
+
557
+ - `laneA` = `aUbFactor × innerAProdAlign`(padded A 维 lane 数,与 Reduce dst 写入形状一致)
558
+ - `laneA` 可能已经对齐,也可能未对齐,所以统一计算对齐后的结果给 `levelStride=CeilAlign(laneA, 8)`
559
+ - `GetCacheRoot()` = `cacheBuf + (cacheCount-1) × levelStride`,fp32,形状 `aUbFactor × innerAProdAlign`(padded)。PostElewise 按 padded 整行处理,CopyOut 按 `aLen × innerAProd`(有效)拷出。`innerAProd` = ∏ axisShape[aSplitIdx+1..LastA](真实乘积),kernel 端从 axisShape 计算
560
+ - 每个 aLoopIdx 进入前**不需要**清零 cacheBuf:DoCaching 覆盖写 + GetCacheID 序列保证低层先写,上轮残留不会进入结果
561
+
562
+ #### 5.1.2 R_bundle 清零
563
+
564
+ **以下讨论均是基于UB内 R 方向的 pad/stale,A 方向不需要清零**。
565
+
566
+ **清零口径**:
567
+ - **按 fp32 元素个数清零**:BurstPad 按 InputT 的 bsElem 对齐(fp16 补到 16 个元素),Cast 后元素数守恒变 fp32。mask 按 fp32 个数精确覆盖 [validR, padEndInRow),不按字节或 block 粒度
568
+ - **双类型必需**:InputT 决定 BurstPad 补到多少个元素(fp16=16, fp32=8),TmpT 固定 fp32 决定 mask 和 store 的粒度
569
+
570
+ ##### 5.1.2.1 pad 区域脏数据与清零规则
571
+
572
+ 搬运不指定 paddingValue(isPad=false),BurstPad / ExtensionPad 均为脏数据,Reduce 前必须将 **R 方向的 pad** 清零为 `pad_value`;A 方向的 pad 不参与 Reduce、不被拷出,不需清零。
573
+
574
+ **BurstPad**:(使用 `ClearInnerBurstTailPadVf` 清零)
575
+ 只在 tail-R 出现(burst 尾轴是 R),尾轴非对齐时恒清零。
576
+
577
+ > **行序注意(仅 rSplit<LastR)**:这里的"行"指 burst 尾轴方向的一次遍历(宽 rowStride)。partial 与 full chunk 用同一 UB layout、大小相同,行按全量布局排位;UB 从外到内依次是 A entry、R 切分轴、中间 R 轴(如有)、burst 尾轴,所以行按 A entry 分段排列。partial 时每段只有 R 切分轴前 rLen 个位置有数据,要清的行是每段开头的一小段,在内存里不连续——与其跳着清,不如按全量行清:多清的 stale 行本就是脏数据,清掉无害。
578
+
579
+ **ExtensionPad**:(使用 `ClearChunkExtensionVf` 清零)
580
+ partial chunk 的 stale 区域,无论 tail 类型都必须显式清。
581
+
582
+ **pad_value 取值表(fp32 计算域)**:
583
+
584
+ | reducer | pad_value |
585
+ |---------|-----------|
586
+ | sum / mean | `0` |
587
+ | max | `dtype::lowest()` |
588
+ | min | `dtype::highest()` |
589
+ | prod | `1` |
590
+ | any | `false` (0) |
591
+ | all | `true` (1) |
592
+
593
+ 以下 4 个场景以 exp+sum(`pad_value=0`)为例,展示脏数据清零流程。
594
+
595
+ **场景 A:tail-R 切尾轴 + partial**(rSplit==LastR)
596
+
597
+ `A0 R0 A1 R1`(aSplit=A0,rSplit=R1=LastR),fp32,rUbFactor=16,rLen=5(partial),aUbFactor=2,A1=3。每个 A entry 一行 16 个 fp32:
598
+
599
+ ```
600
+ MTE2 后: [valid=5 │ BurstPad=3 │ ExtensionPad=8] ← 全部脏数据
601
+ PreElewise: [exp(×)=5 │ 脏×3 │ 脏×8]
602
+
603
+ ClearInnerBurstTailPadVf: validR=rLen=5, rowStride=rUbFactorAlign×innerRProdAlign=16×1=16, rowCnt=aUbFactor×innerAProdAlign=2×3=6
604
+ → 每行清 [5, CeilAlign(5,8)=8),共 6 行
605
+ ClearChunkExtensionVf: extStart=CeilAlign(rLen×innerRProdAlign, 8)=8, extLanes=rUbFactorAlign×innerRProdAlign−extStart=16−8=8, aBundleEntries=6
606
+ → 每行清 [8, 16),共 6 行
607
+
608
+ 清完后: [exp(×)=5 │ 0×3 │ 0×8]
609
+ → Reduce 沿 R 累加,pad_value 零贡献,结果正确
610
+ ```
611
+
612
+ BurstPad 与 ExtensionPad 相邻,extStart = CeilAlign(rLen, 8) = 8,两者各自由不同 VF 清。
613
+
614
+ **场景 B:tail-R 非切尾轴 + partial**(rSplit<LastR)
615
+
616
+ `A0 R0 A1 R1`(aSplit=A1,rSplit=R0),fp32,R1=5(非对齐),rUbFactor=4,rLen=3(partial),aUbFactor=2。每个 R0.i 对应一行(R1 padded 到 8):
617
+
618
+ ```
619
+ MTE2 后(单个 A entry):
620
+ R0.i=0: [R1=5 valid │ BurstPad=3] ← 脏数据
621
+ R0.i=1: [R1=5 valid │ BurstPad=3]
622
+ R0.i=2: [R1=5 valid │ BurstPad=3]
623
+ R0.i=3: [──────── ExtensionPad ──────] ← 未搬,stale
624
+
625
+ ClearChunkExtensionVf: extStart=CeilAlign(rLen×innerRProdAlign, 8)=CeilAlign(3×8,8)=24, aStride=rUbFactorAlign×innerRProdAlign=4×8=32
626
+ → extLanes=32−24=8,每个 A entry 清 [24,32)(R0.i=3 那一行),共 2 行
627
+ ClearInnerBurstTailPadVf: validR=axisShape[LastR]=5, rowStride=CeilAlign(5,8)=8,
628
+ rowCnt = UB 总元素数 ÷ rowStride = (A entry 数 2 × R0 切片数 4 × R1 宽 8) ÷ 8 = 8(全量行)
629
+ → 每行清 [5,8),共 8 行
630
+
631
+ → Reduce 沿 R 累加,pad_value 零贡献,结果正确
632
+ ```
633
+
634
+ BurstPad 在 LastR 方向(每行尾部),ExtensionPad 在 R0.i 方向(整行),两者方向不同。
635
+
636
+ **场景 C:tail-A + partial**
637
+
638
+ `A0 R0 A1`(aSplit=A0,rSplit=R0),fp32,A1=5(非对齐),rUbFactor=4,rLen=3(partial),aUbFactor=2。每个 R0.i 切片含整个 A_bundle(A0.i × A1,A1 padded 到 8):
639
+
640
+ ```
641
+ MTE2 后:
642
+ R0.i=0, A0.i=0: [A1=5 valid │ BurstPad=3] ← A 方向 pad(脏数据)
643
+ R0.i=0, A0.i=1: [A1=5 valid │ BurstPad=3]
644
+ R0.i=1, A0.i=0: [A1=5 valid │ BurstPad=3]
645
+ R0.i=1, A0.i=1: [A1=5 valid │ BurstPad=3]
646
+ R0.i=2, A0.i=0: [A1=5 valid │ BurstPad=3]
647
+ R0.i=2, A0.i=1: [A1=5 valid │ BurstPad=3]
648
+ R0.i=3, A0.i=0: [────── stale ×8 ──────] ← ExtensionPad
649
+ R0.i=3, A0.i=1: [────── stale ×8 ──────]
650
+
651
+ ClearChunkExtensionVf: cellElems=aUbFactor×innerAProdAlign×innerRProdAlign=2×8×1=16
652
+ → startElem=rLen×cellElems=3×16=48, totalClear=(rUbFactor−rLen)×cellElems=(4−3)×16=16
653
+ → 清 R0.i=3 整段 [48, 64)
654
+ 不需 ClearInnerBurstTailPadVf:BurstPad 在 A 方向,Reduce Pattern=RA 沿 R 累加、A 各 lane 独立,BurstPad 不串到 valid lane
655
+
656
+ → Reduce 沿 R 累加,ExtensionPad 已清为 pad_value 零贡献,BurstPad 不参与 Reduce,结果正确
657
+ ```
658
+
659
+ **场景 D:tail-R 非切尾轴 + 中间 R 轴 + partial**(rSplit<LastR 且中间隔 R 轴)
660
+
661
+ `A0 R0 A1 R1 A2 R2`(aSplit=A0,rSplit=R0,LastR=R2,中间隔 R1),fp16,R2=2(非对齐),rUbFactorAlign=20,rLen=14(partial),A entry 数=8。UB 从内到外:`[R2(2, padded 到 16), R1(2), R0(20), A(8)]`。每个 A entry 对应一段 40 行,partial 时每段开头 28 行(rLen 14 × R1 2)有数据:
662
+
663
+ ```
664
+ 需要清的行(r0∈[0,14)):A entry 0 的段 [0,28)、A entry 1 的段 [40,68)、…,各段之间不连续
665
+ 若按 "前 rLen×R1×A entry 数 = 14×2×8 = 224 行" 连续清 [0,224):数量上恰好等于需要的总行数,位置却全错——a=6、7 段一行没清到
666
+
667
+ ClearInnerBurstTailPadVf: validR=axisShape[LastR]=2, rowStride=CeilAlign(2,16)=16,
668
+ rowCnt = (A entry 数 8 × R0 切片数 20 × innerRProdAlign 32) ÷ rowStride 16 = 320(全量行)
669
+ innerRProdAlign = R1 宽 2 × R2 宽 16(中间 R 轴并入,行数自然包含它)
670
+ → 每行清 [2,16),共 320 行
671
+ ```
672
+
673
+ ##### 5.1.2.2 清零总览
674
+
675
+ **决策汇总表**(BinaryBase 路径):
676
+
677
+ > rLen:切分轴本次搬入ub的大小, 切分整块`=rUbFactor`,切分尾块 `< rUbFactor`
678
+
679
+ | tail | rChunk | rSplitIdx | 清零部分 |
680
+ |------|-------|--------|---------------------|
681
+ | tail-R | partial | ==LastR | ExtensionPad + BurstPad(尾轴非对齐) |
682
+ | tail-R | partial | <LastR | ExtensionPad + BurstPad(尾轴非对齐) |
683
+ | tail-R | full | 任意 | BurstPad(尾轴非对齐) |
684
+ | tail-A | partial | 任意 | ExtensionPad |
685
+ | tail-A | full | 任意 | 不需要显式清零 |
686
+
687
+ **清零准入条件及参数汇总**:
688
+
689
+ ```cpp
690
+ // rLen:切分轴本次搬入ub的大小, 切分整块`=rUbFactor`,切分尾块 `< rUbFactor`
691
+ if (rLen < rUbFactor) {
692
+ // R 切分尾块,必清 ExtensionPad
693
+ ClearChunkExtensionVf();
694
+
695
+ // 清零参数描述
696
+ // tail-R:BurstPad 按 A entry 逐行清
697
+ extStart = CeilAlign(rLen × innerRProdAlign, 8) // 清零起点(8 = 32B / sizeof(fp32)),跳过 BurstPad 区间
698
+ aStride = rUbFactorAlign × innerRProdAlign // 每个 A entry 的行宽(fp32 元素数)
699
+ extLanes = aStride − extStart // 每个 A entry 内清零长度
700
+ aBundleEntries = aUbFactor × innerAProdAlign // A entry 数(外层循环次数)
701
+
702
+ // tail-A:ExtensionPad 连续整段清
703
+ cellElems = aUbFactor × innerAProdAlign × innerRProdAlign // 每个 R 切分轴切片的元素数
704
+ startElem = rLen × cellElems // 清零起点
705
+ totalClear = (rUbFactor − rLen) × cellElems // 清零总长度
706
+ }
707
+ ```
708
+
709
+ ```cpp
710
+ bsElem = blockSize / sizeof(D_T) // BurstPad 是按 D_T 计算的个数
711
+ if (isTailR_) {
712
+ burstTail = (rSplitIdx == LastR) ? rLen : axisShape[LastR];
713
+ if (burstTail % bsElem != 0) {
714
+ ClearInnerBurstTailPadVf();
715
+
716
+ // 清零参数描述
717
+ bsElem = blockSize / sizeof(D_T) // D_T 的 block 对齐元素数(fp32=8, fp16=16)
718
+ validR = (rSplitIdx == LastR) ? rLen : axisShape[LastR] // burst 尾轴有效元素数
719
+ rowStride = (rSplitIdx == LastR) ? rUbFactorAlign × innerRProdAlign // rSplit==LastR:行宽 = R_bundle 宽
720
+ : CeilAlign(axisShape[LastR], bsElem) // rSplit!=LastR:行宽 = burst 尾轴 padded 宽
721
+ rowCnt = (rSplitIdx == LastR) ? aUbFactor × innerAProdAlign // rSplit==LastR:每 A entry 一行
722
+ : aUbFactor × innerAProdAlign × rUbFactorAlign × innerRProdAlign / rowStride
723
+ // rSplit!=LastR:UB 总元素数 ÷ 行宽 = 全量行(理由见 5.1.2.1 行序注意)
724
+ }
725
+ }
726
+ ```
727
+
728
+ **实现要点**:
729
+ - **保留 valid 只清 pad**:从最后一个含 valid 数据的 fp32 block 起点开始写,mask 跳过 valid 部分,只写 padding 部分,不污染下一行
730
+ - **起点必须 block 对齐**:StoreAlign/LoadAlign 起点须block对齐,非对齐起点会运行时错
731
+ - **UpdateMask 引用语义**:`UpdateMask(N)` 生成"前 N lane 为 1"的 mask;参数是引用且被消耗(N>64 减 64、≤64 置 0),cntEnd/cntStart 必须是独立的非 const 局部变量
732
+
733
+
734
+ **ClearChunkExtensionVf 伪码**:
735
+
736
+ ```cpp
737
+ // __simd_vf__ 函数:tail-R 分支
738
+ template <typename T = float>
739
+ __simd_vf__ inline void ClearChunkExtTailRVfImpl(
740
+ __ubuf__ T* slotBase,
741
+ uint32_t extStart, uint32_t aStride,
742
+ uint32_t extLanes, uint16_t aU16, uint16_t repPerA,
743
+ T padVal) // kPadClearValue 作为参数传入
744
+ {
745
+ constexpr uint32_t VL = 64;
746
+ AscendC::Reg::RegTensor<T> idReg;
747
+ AscendC::Reg::Duplicate(idReg, padVal);
748
+ for (uint16_t a = 0; a < aU16; ++a) {
749
+ int32_t aOff = static_cast<int32_t>(a) * static_cast<int32_t>(aStride);
750
+ uint32_t remaining = extLanes;
751
+ for (uint16_t r = 0; r < repPerA; ++r) {
752
+ int32_t off = aOff + static_cast<int32_t>(extStart) +
753
+ static_cast<int32_t>(r) * static_cast<int32_t>(VL);
754
+ auto mask = AscendC::Reg::UpdateMask<T>(remaining);
755
+ AscendC::Reg::StoreAlign(slotBase + off, idReg, mask);
756
+ }
757
+ }
758
+ }
759
+
760
+ // __simd_vf__ 函数:tail-A 分支
761
+ template <typename T = float>
762
+ __simd_vf__ inline void ClearChunkExtTailAVfImpl(
763
+ __ubuf__ T* slotBase,
764
+ uint32_t startElem, uint32_t totalClear, uint16_t repCount,
765
+ T padVal) // kPadClearValue 作为参数传入
766
+ {
767
+ constexpr uint32_t VL = 64;
768
+ AscendC::Reg::RegTensor<T> idReg;
769
+ AscendC::Reg::Duplicate(idReg, padVal);
770
+ AscendC::Reg::MaskReg mask;
771
+ uint32_t remaining = totalClear;
772
+ for (uint16_t i = 0; i < repCount; ++i) {
773
+ int32_t off = static_cast<int32_t>(startElem) +
774
+ static_cast<int32_t>(i) * static_cast<int32_t>(VL);
775
+ mask = AscendC::Reg::UpdateMask<T>(remaining);
776
+ AscendC::Reg::StoreAlign(slotBase + off, idReg, mask);
777
+ }
778
+ }
779
+
780
+ // 调用侧
781
+ template <typename T = float>
782
+ __aicore__ inline void ClearChunkExtensionVf(
783
+ __ubuf__ T* slotBase, // preReduceResult 或 preReduceResultTail
784
+ bool isTailR, // tail 类型
785
+ uint32_t aBundleEntries, // tail-R: aUbFactor × innerAProdAlign
786
+ uint32_t innerRPA, // tail-R: innerRProdAlign(tail-A 视图传 1)
787
+ uint32_t cellElems, // tail-A: aUbFactor × innerAProdAlign × innerRProdAlign(tail-R 视图传 0)
788
+ uint32_t rUbFactor,
789
+ uint32_t rUbFactorAlign,
790
+ int64_t rLen) // 调用前已保证 rLen < rUbFactor
791
+ {
792
+ constexpr uint32_t VL = 64;
793
+ constexpr uint32_t BS_TMP = 8; // 32 / sizeof(fp32)
794
+
795
+ if (isTailR) {
796
+ const uint32_t rLenInner = static_cast<uint32_t>(rLen) * innerRPA;
797
+ const uint32_t extStart = (rLenInner + BS_TMP - 1) / BS_TMP * BS_TMP; // 32B 对齐起点
798
+ const uint32_t aStride = rUbFactorAlign * innerRPA;
799
+ if (extStart >= aStride) return;
800
+ const uint32_t extLanes = aStride - extStart;
801
+ const uint32_t repPerA = (extLanes + VL - 1) / VL;
802
+ const uint16_t aU16 = static_cast<uint16_t>(aBundleEntries);
803
+
804
+ asc_vf_call<ClearChunkExtTailRVfImpl<T>>(
805
+ slotBase, extStart, aStride, extLanes, aU16, static_cast<uint16_t>(repPerA),
806
+ static_cast<T>(kPadClearValue));
807
+ } else { // tail-A:rSplit 在 UB 最外层,单段连续清零
808
+ const uint32_t startElem = static_cast<uint32_t>(rLen) * cellElems;
809
+ const uint32_t totalClear = (rUbFactor - static_cast<uint32_t>(rLen)) * cellElems;
810
+ const uint32_t repCount = (totalClear + VL - 1) / VL;
811
+
812
+ asc_vf_call<ClearChunkExtTailAVfImpl<T>>(
813
+ slotBase, startElem, totalClear, static_cast<uint16_t>(repCount),
814
+ static_cast<T>(kPadClearValue));
815
+ }
816
+ }
817
+ ```
818
+
819
+ **MergeTmpBufVf 伪码**:
820
+
821
+ ```cpp
822
+ // __simd_vf__ 函数
823
+ template <typename T = float>
824
+ __simd_vf__ inline void MergeTmpBufVfImpl(
825
+ __ubuf__ T* p0, __ubuf__ T* p1,
826
+ uint32_t totalElems, uint16_t repU16)
827
+ {
828
+ AscendC::Reg::RegTensor<T> aReg, bReg;
829
+ AscendC::Reg::MaskReg mask;
830
+ uint32_t remaining = totalElems;
831
+ for (uint16_t i = 0; i < repU16; ++i) {
832
+ int32_t off = static_cast<int32_t>(i) * static_cast<int32_t>(VL);
833
+ mask = AscendC::Reg::UpdateMask<T>(remaining);
834
+ AscendC::Reg::LoadAlign(aReg, p0 + off);
835
+ AscendC::Reg::LoadAlign(bReg, p1 + off);
836
+ AscendC::Reg::Add(aReg, aReg, bReg, mask); // 占位:reducer 的 merge(sum 系 = Add,max/min = Max/Min)
837
+ AscendC::Reg::StoreAlign(p0 + off, aReg, mask);
838
+ }
839
+ }
840
+
841
+ // 调用侧
842
+ template <typename T = float>
843
+ __aicore__ inline void MergeTmpBufVf(
844
+ __ubuf__ T* p0, // preReduceResult(二分主块,merge 结果写回此处)
845
+ __ubuf__ T* p1, // preReduceResultTail(二分尾块,merge 后释放)
846
+ uint32_t totalElems) // aUbFactor × innerAProdAlign × rUbFactorAlign × innerRProdAlign
847
+ {
848
+ constexpr uint32_t VL = 64;
849
+ uint16_t repU16 = static_cast<uint16_t>((totalElems + VL - 1) / VL);
850
+ asc_vf_call<MergeTmpBufVfImpl<T>>(p0, p1, totalElems, repU16);
851
+ }
852
+ ```
853
+
854
+ **ClearInnerBurstTailPadVf 伪码**:
855
+
856
+ ```cpp
857
+ // __simd_vf__ 函数
858
+ template <typename TmpT = float>
859
+ __simd_vf__ inline void ClearInnerBurstTailPadVfImpl(
860
+ __ubuf__ TmpT* base,
861
+ uint16_t rowCntU16, int32_t rowStrideI, int32_t windowOff,
862
+ uint32_t padEnd, uint32_t partialStartInBlock,
863
+ TmpT padVal) // kPadClearValue 作为参数传入
864
+ {
865
+ AscendC::Reg::RegTensor<TmpT> idReg;
866
+ AscendC::Reg::Duplicate(idReg, padVal); // 不是 0:max→-inf, prod→1, ...
867
+
868
+ uint32_t cntEnd = padEnd;
869
+ uint32_t cntStart = partialStartInBlock;
870
+ auto maskEnd = AscendC::Reg::UpdateMask<TmpT>(cntEnd);
871
+ auto maskStart = AscendC::Reg::UpdateMask<TmpT>(cntStart);
872
+ auto allMask = AscendC::Reg::CreateMask<TmpT, AscendC::Reg::MaskPattern::ALL>();
873
+ AscendC::Reg::MaskReg notStart, padMask;
874
+ AscendC::Reg::Not(notStart, maskStart, allMask);
875
+ AscendC::Reg::And(padMask, maskEnd, notStart, allMask);
876
+
877
+ for (uint16_t row = 0; row < rowCntU16; ++row) {
878
+ int32_t rowOff = static_cast<int32_t>(row) * rowStrideI;
879
+ AscendC::Reg::StoreAlign(base + rowOff + windowOff, idReg, padMask);
880
+ }
881
+ }
882
+
883
+ // 调用侧
884
+ template <typename InputT, typename TmpT = float> // preReduceResult/preReduceResultTail 固定 fp32
885
+ __aicore__ inline void ClearInnerBurstTailPadVf(__ubuf__ TmpT* base,
886
+ uint32_t rowCnt,
887
+ uint32_t rowStride, // UB 行步距(元素数,调用方算)
888
+ uint32_t validR) // R_inner(业务有效列数)
889
+ {
890
+ constexpr uint32_t BS_INPUT = 32 / sizeof(InputT); // CopyIn 对齐用:b16=16,fp32=8
891
+ constexpr uint32_t BS_TMP = 32 / sizeof(TmpT); // VL 视窗下块边界用:fp32=8
892
+ if (validR >= rowStride) return; // 无 padding,直接返回
893
+
894
+ uint32_t padEndInRow = ((validR + BS_INPUT - 1) / BS_INPUT) * BS_INPUT; // CeilAlign(validR, BS_INPUT)
895
+ uint32_t partialBlockIdx = validR / BS_TMP;
896
+ uint32_t partialStartInBlock = validR % BS_TMP;
897
+ uint32_t padEnd = padEndInRow - partialBlockIdx * BS_TMP;
898
+
899
+ uint16_t rowCntU16 = static_cast<uint16_t>(rowCnt);
900
+ int32_t rowStrideI = static_cast<int32_t>(rowStride);
901
+ int32_t windowOff = static_cast<int32_t>(partialBlockIdx * BS_TMP);
902
+
903
+ asc_vf_call<ClearInnerBurstTailPadVfImpl<TmpT>>(
904
+ base, rowCntU16, rowStrideI, windowOff, padEnd, partialStartInBlock,
905
+ static_cast<TmpT>(kPadClearValue));
906
+ }
907
+ ```
908
+
909
+ #### 5.1.3 A 方向 BurstPad/ExtensionPad 隔离
910
+
911
+ A 方向的 BurstPad 和 ExtensionPad **不需要主动清零**,因为 Reduce 沿 R 维度合并,A 各位置独立
912
+
913
+ **与 R 方向的关键区别**:R 方向 BurstPad/ExtensionPad 会被 Reduce 沿 R 累加进结果 → 必须显式清。A 方向 Reduce 沿 R 走、A 各 lane 独立 → 天然隔离。**禁止额外 A 方向清零操作**。
914
+
915
+ #### 5.1.4 ReduceSum 高阶 API
916
+
917
+ API 原型、硬约束详见 [highlevel-api.md](../../highlevel-api.md)。
918
+
919
+ > srcShape 即 UB 内数据排布的维度(由 §4.2 CopyIn 时 DataCopyPad stride/blockCount 决定):
920
+ > - tail-R:`[A_bundle, R_bundle]` = `{aUbFactor × innerAProdAlign, rUbFactorAlign × innerRProdAlign}`
921
+ > - tail-A:`[R_bundle, A_bundle]` = `{rUbFactorAlign × innerRProdAlign, aUbFactor × innerAProdAlign}`
922
+
923
+ ```cpp
924
+ // 运行时选择,各分支内 Pattern 仍是编译期常量
925
+ // isTailR → Pattern::Reduce::AR(沿内层 R reduce,保留外层 A)
926
+ // !isTailR → Pattern::Reduce::RA(沿外层 R reduce,保留内层 A)
927
+
928
+ const uint32_t laneA = aUbFactor * innerAProdAlign; // padded A 维 lane 数(与 Reduce dst 写入形状一致)
929
+ constexpr uint32_t BLOCK_F32 = 32 / sizeof(float); // = 8
930
+ const uint32_t levelStride = (laneA + BLOCK_F32 - 1) / BLOCK_F32 * BLOCK_F32;
931
+ int32_t levelOff = cacheID × levelStride; // cacheID 由 GetCacheID 算
932
+
933
+ // srcShape 按 padded 值计算
934
+ if (isTailR_) {
935
+ uint32_t srcShape[2] = {static_cast<uint32_t>(aUbFactor * innerAProdAlign),
936
+ static_cast<uint32_t>(rUbFactorAlign * innerRProdAlign)};
937
+ ReduceSum<float, AscendC::Pattern::Reduce::AR, /*isReuseSource=*/true>(
938
+ cacheBuf + levelOff, preReduceResult, preReduceResultTail, srcShape, /*srcInnerPad=*/true);
939
+ } else {
940
+ uint32_t srcShape[2] = {static_cast<uint32_t>(rUbFactorAlign * innerRProdAlign),
941
+ static_cast<uint32_t>(aUbFactor * innerAProdAlign)};
942
+ ReduceSum<float, AscendC::Pattern::Reduce::RA, /*isReuseSource=*/true>(
943
+ cacheBuf + levelOff, preReduceResult, preReduceResultTail, srcShape, /*srcInnerPad=*/true);
944
+ }
945
+ // dst=cacheBuf[levelOff] src=preReduceResult sharedTmpBuffer=preReduceResultTail
946
+ ```
947
+
948
+ 本范式统一使用带 sharedTmpBuffer 的重载,`preReduceResultTail` 兼作 sharedTmpBuffer。BinaryBase 路径下 buffer 与 ReduceSum API 参数的映射关系:
949
+
950
+ | ReduceSum API 参数 | 本范式 buffer | 说明 |
951
+ |---|---|---|
952
+ | `dst` | `cacheBuf[levelOff]` | 二分缓存树当前层,Reduce 结果直接写入 |
953
+ | `src` | `preReduceResult` | 二分主块 或 merge 后结果 |
954
+ | sharedTmpBuffer | `preReduceResultTail` | Phase A 配对后空闲,兼作 sharedTmpBuffer |
955
+
956
+ 共需 **3 份** buffer:`preReduceResult` + `preReduceResultTail`(sharedTmpBuffer 复用)+ `cacheBuf`(dst)。
957
+
958
+ #### 5.1.5 PostElewise 计算
959
+
960
+ > **post_reduce_input 搬运约束**:搬入 UB 后排布必须与 Reduce 输出的 padded 排布(aUbFactor × innerAProdAlign)一致,按 A 轴切分搬入。
961
+
962
+ 从 cacheBuf 树根取 reduce 结果:`rootOff = (cacheCount - 1) × levelStride`,`rootPtr = cacheBuf + rootOff`。PostElewise 读 `rootPtr`,按 `laneA = aUbFactor × innerAProdAlign`(padded)整行处理(算子专属 elewise + 缩位 Cast),结果写入 outBuf,供 CopyOut 搬出。
963
+
964
+ ```cpp
965
+ constexpr uint32_t kRepF32 = 256 / sizeof(float); // = 64,寄存器 VL
966
+
967
+ // __simd_vf__ 函数
968
+ template <typename DType>
969
+ __simd_vf__ inline void PostElewiseVfImpl(
970
+ __ubuf__ float* src, __ubuf__ DType* outBuf,
971
+ uint32_t laneA, uint16_t repeatTime)
972
+ {
973
+ AscendC::Reg::RegTensor<float> f32Reg;
974
+ AscendC::Reg::MaskReg mask;
975
+ uint32_t remaining = laneA;
976
+
977
+ for (uint16_t i = 0; i < repeatTime; ++i) {
978
+ int32_t off = static_cast<int32_t>(i) * static_cast<int32_t>(kRepF32);
979
+ mask = AscendC::Reg::UpdateMask<float>(remaining);
980
+
981
+ AscendC::Reg::LoadAlign(f32Reg, src + off);
982
+
983
+ // 1) 算子专属 PostElewise(如 mean 的 ×invRTotal;每算子替换)
984
+ PostElewiseOp(f32Reg, mask);
985
+
986
+ // 2) 缩位 Cast + 写出
987
+ if constexpr (NeedCast<DType>) {
988
+ AscendC::Reg::RegTensor<DType> bReg;
989
+ AscendC::Reg::Cast<DType, float, kCastTraitFromFp32>(bReg, f32Reg, mask);
990
+ AscendC::Reg::StoreAlign<DType, AscendC::Reg::StoreDist::DIST_PACK_B32>(outBuf + off, bReg, mask);
991
+ } else {
992
+ AscendC::Reg::StoreAlign(outBuf + off, f32Reg, mask);
993
+ }
994
+ }
995
+ }
996
+
997
+ // 调用侧
998
+ template <typename DType>
999
+ __aicore__ inline void PostElewise(__ubuf__ float* src, __ubuf__ DType* outBuf, uint32_t laneA) {
1000
+ const uint16_t repeatTime = static_cast<uint16_t>((laneA + kRepF32 - 1) / kRepF32);
1001
+ asc_vf_call<PostElewiseVfImpl<DType>>(src, outBuf, laneA, repeatTime);
1002
+ }
1003
+ ```
1004
+
1005
+
1006
+ ### 5.2 Cast知识
1007
+
1008
+ 引用公共知识 [common/cast-rules.md](../../../../../common/cast-rules.md)。
1009
+
1010
+ **使用位置**:
1011
+ - **CopyIn 后、Reduce 前**:b16 输入 `DIST_UNPACK_B16` load → `Cast<b16→fp32>` → fp32 计算
1012
+ - **Reduce 后、CopyOut 前**:fp32 结果 `Cast<fp32→b16>` → `DIST_PACK_B32` store → outBuf
1013
+
1014
+ **必须的 CastTrait**:
1015
+
1016
+ ```cpp
1017
+ // 扩位 b16 → fp32
1018
+ CastTrait{RegLayout::ZERO, SatMode::UNKNOWN, MaskMergeMode::ZEROING, RoundMode::CAST_NONE}
1019
+
1020
+ // 缩位 fp32 → b16
1021
+ CastTrait{RegLayout::ZERO, SatMode::NO_SAT, MaskMergeMode::ZEROING, RoundMode::CAST_RINT}
1022
+ ```
1023
+
1024
+ ### 5.3 VF 编程规则
1025
+
1026
+ 引用公共知识 [common/vf-programming-rules.md](../../../../../common/vf-programming-rules.md)。
1027
+
1028
+ **DoCaching VF 骨架**(BinaryBase 专用,Reduce 结果已在 `cacheBuf[levelOff]`,DoCaching 就地吸收低层):
1029
+
1030
+ ```cpp
1031
+ // __simd_vf__ 函数
1032
+ __simd_vf__ inline void DoCachingVfImpl(
1033
+ __ubuf__ float* cacheBuf, // Reduce 结果已写入 cacheBuf[levelOff]
1034
+ uint32_t laneA, uint32_t levelStride, int32_t levelOff,
1035
+ uint16_t repeatTime, uint16_t cacheLvlU16)
1036
+ {
1037
+ AscendC::Reg::RegTensor<float> aReg, bReg;
1038
+ AscendC::Reg::MaskReg mask;
1039
+ uint32_t remaining = laneA;
1040
+
1041
+ for (uint16_t i = 0; i < repeatTime; ++i) { // A 维分段(kRepF32 = 64 lane)
1042
+ int32_t off = i * kRepF32;
1043
+ mask = AscendC::Reg::UpdateMask<float>(remaining); // 自动递减 kRepF32
1044
+
1045
+ // 读取本层(Reduce 已写入的结果)
1046
+ AscendC::Reg::LoadAlign(aReg, cacheBuf + levelOff + off);
1047
+
1048
+ for (uint16_t j = 0; j < cacheLvlU16; ++j) {
1049
+ int32_t jOff = j * levelStride + off;
1050
+ AscendC::Reg::LoadAlign(bReg, cacheBuf + jOff);
1051
+ AscendC::Reg::Add(aReg, aReg, bReg, mask); // 占位:reducer 的 merge(sum 系 = Add,max/min = Max/Min)
1052
+ }
1053
+
1054
+ AscendC::Reg::StoreAlign(cacheBuf + levelOff + off, aReg, mask);
1055
+ }
1056
+ }
1057
+
1058
+ // 调用侧
1059
+ const uint32_t laneA = aUbFactor * innerAProdAlign; // padded A 维 lane 数(与 Reduce dst 写入形状一致)
1060
+ constexpr uint32_t BLOCK_F32 = 32 / sizeof(float); // = 8
1061
+ const uint32_t levelStride = (laneA + BLOCK_F32 - 1) / BLOCK_F32 * BLOCK_F32;
1062
+ int32_t levelOff = cacheID × levelStride;
1063
+ uint16_t repeatTime = (laneA + kRepF32 - 1) / kRepF32;
1064
+ uint16_t cacheLvlU16 = static_cast<uint16_t>(cacheID);
1065
+
1066
+ asc_vf_call<DoCachingVfImpl>(
1067
+ cacheBuf, laneA, levelStride, levelOff, repeatTime, cacheLvlU16);
1068
+ ```
1069
+
1070
+ **要点**:
1071
+ - **双层 uint16_t 循环**:外层按 A 维 kRepF32 分段,内层按 cacheID 吸收
1072
+ - **`levelStride` 与 `laneA` 的区别**:`laneA`=padded A 维 lane 数(= `aUbFactor × innerAProdAlign`,与 Reduce dst 写入形状一致),`levelStride`=cacheBuf 每层在 fp32 lane 上的物理 stride(CeilAlign 到 32B),AR + A bundle=1 等极小 A 场景两者背离
1073
+
1074
+ ## 6 CopyOut MTE3 逻辑
1075
+
1076
+ ### 6.1 UB Buffer数据排布格式
1077
+
1078
+ Reduce 把 R 合掉之后,UB 上保留的 A_bundle 与 CopyIn 时的结构一致。**关键不同**:输出 GM 上没有 R 轴穿插,纯 A 轴 dense 排列。所以**无论 A_bundle 有几根 A 轴,CopyOut 永远塌成 2D,一次 DataCopyPad 搞定**——不需要 Loop 模式、不需要 for 拆外层。
1079
+
1080
+ | pattern tail | UB 输出布局 | CopyOut 策略 |
1081
+ |---|---|---|
1082
+ | **tail-R** | `[A_bundle 紧密]`(dense,最内 A 不 padded) | **单 burst**:`blockCount=1, blockLen=aLen × innerAProd × sizeof` |
1083
+ | **tail-A + aSplitIdx==LastA** | 单根 A 轴 `[aUbFactor]` | 单 burst:`blockCount=1, blockLen=aLen × sizeof` |
1084
+ | **tail-A + aSplitIdx!=LastA** | `[A_bundle, 最内 A 按 block 对齐]` | 多 burst:`blockCount=aLen×innerAProd/LastA, blockLen=LastA×sizeof`,HW 按 32B 跨 padding |
1085
+
1086
+ > `innerAProd` = ∏ axisShape[aSplitIdx+1..LastA](aSplitIdx 右侧所有 A 轴的真实元素乘积),kernel 端从 `axisShape` 现算,不依赖 TilingData 传递。tail-R 下 `innerAProd == innerAProdAlign`(Climb 不调 CeilAlign)。
1087
+
1088
+ ### 6.2 CopyOut 指令
1089
+
1090
+ CopyOut 字段映射依 tail 类型(`isTailR_` 运行时值)与 `aSplitIdx` 位置分**三条独立路径**,**不能合并为单一通用公式**。
1091
+
1092
+ ```cpp
1093
+ template <typename DType>
1094
+ __aicore__ inline void CopyOut(int64_t outerOutOff, int64_t aLen, AscendC::LocalTensor<D_T>& outDeq) {
1095
+ // innerAProd = ∏ axisShape[aSplitIdx+1..LastA],kernel 端现算
1096
+ int64_t innerAProd = 1;
1097
+ for (int32_t k = aSplitIdx + 2; k <= LastAAxis(); k += 2) {
1098
+ innerAProd *= axisShape[k];
1099
+ }
1100
+
1101
+ DataCopyExtParams outParams;
1102
+ if (isTailR_) {
1103
+ // 路径 1:tail-R,单 burst
1104
+ outParams.blockLen = static_cast<uint32_t>(aLen * innerAProd * static_cast<int64_t>(sizeof(D_T)));
1105
+ outParams.blockCount = 1;
1106
+ } else {
1107
+ const int32_t lastA = LastAAxis();
1108
+ const int64_t lastASize = axisShape[lastA];
1109
+ if (aSplitIdx == lastA) {
1110
+ // 路径 2:tail-A + aSplitIdx == LastA,单 burst
1111
+ outParams.blockLen = static_cast<uint32_t>(aLen * static_cast<int64_t>(sizeof(D_T)));
1112
+ outParams.blockCount = 1;
1113
+ } else {
1114
+ // 路径 3:tail-A + aSplitIdx != LastA,多 burst
1115
+ outParams.blockLen = static_cast<uint32_t>(lastASize * static_cast<int64_t>(sizeof(D_T)));
1116
+ outParams.blockCount = static_cast<uint16_t>(aLen * innerAProd / lastASize);
1117
+ }
1118
+ }
1119
+ outParams.srcStride = 0; // UB 侧 gap=0,HW 自动按 CeilAlign(blockLen, 32B) 读取下一个块
1120
+ outParams.dstStride = 0; // GM 侧 byte 对齐,dense 写出
1121
+ outParams.rsv = 0; // 必须显式填 0(datacopypad-rules.md)
1122
+ DataCopyPad(yGm_[outerOutOff], outDeq, outParams);
1123
+ }
1124
+ ```
1125
+
1126
+ **约束**:
1127
+ - **不要把路径 3 的多 burst 公式套到 tail-R 上**:tail-R 下 A_bundle 是 dense 无 padding,多 burst 的 CeilAlign(blockLen, 32B) 跨度会跳过有效数据
1128
+ - CopyOut 全部用 `srcStride = 0, dstStride = 0`
1129
+ - CopyOut 不需要 `DataCopyPadExtParams`(UB→GM 方向不支持也不需 padParams)
1130
+ - CopyOut 不区分 partial chunk(aLen 自然覆盖 A 切分尾块)
1131
+
1132
+ **4 个典型例**:
1133
+
1134
+ **例 1(路径 1,tail-R)**:pattern `A0R0A1R1`,aSplitIdx=A0,A_bundle = `[aUbFactor(A0), A1]`:
1135
+ ```cpp
1136
+ blockLen = aLen * A1 * sizeof(D_T);
1137
+ blockCount = 1; srcStride = 0; dstStride = 0;
1138
+ ```
1139
+
1140
+ **例 2(路径 2,tail-A 单 A 轴)**:pattern `A0R0A1`,aSplitIdx=A1=LastA:
1141
+ ```cpp
1142
+ blockLen = aLen * sizeof(D_T);
1143
+ blockCount = 1; srcStride = 0; dstStride = 0;
1144
+ ```
1145
+
1146
+ **例 3(路径 3,tail-A 2 根 A)**:pattern `A0R0A1R1A2`,aSplitIdx=A0:
1147
+ ```cpp
1148
+ blockLen = A2 * sizeof(D_T);
1149
+ blockCount = aLen * A1;
1150
+ srcStride = 0; dstStride = 0;
1151
+ ```
1152
+
1153
+ **例 4(路径 3,tail-A 深 pattern 3 根 A)**:pattern `A0R0A1R1A2R2A3R3A4`,aSplitIdx=A0:
1154
+ ```cpp
1155
+ blockLen = A4 * sizeof(D_T);
1156
+ blockCount = aLen * A1 * A2 * A3;
1157
+ srcStride = 0; dstStride = 0;
1158
+ ```
1159
+
1160
+ ## 7 流水同步
1161
+
1162
+ ### 7.1 Sync 知识
1163
+
1164
+ 引用公共知识 [common/sync-and-consistency.md](../../../../../common/sync-and-consistency.md) §2.2(SetFlag/WaitFlag + 持有法则)。
1165
+
1166
+ **TBuf 模型**:手动 SetFlag/WaitFlag 实现跨流水同步。单流水内:Ascend950 上不同的 VF 间硬件保证串行,不需要 PipeBarrier<PIPE_V>()。使用规则见公共知识。
1167
+
1168
+ **同步点推导方法**(持有法则驱动,禁止跳过):
1169
+
1170
+ 1. 取 §2.1 Process 无同步版代码,逐行标注三态持有(`// 执行前/中/后: 持有=[...]`)
1171
+ 2. 遍历每个 buffer 的生命周期,标记跨流水线的 RAW(生产者写→消费者读)和 WAR(消费者读→生产者覆写)
1172
+ 3. 每个 crossing 插入对应的 `SetFlag<HardEvent::XXX>` / `WaitFlag<HardEvent::XXX>` 对
1173
+ 4. VF 链中间无 sync:CastSquare → ClearPad → Merge → Reduce → DoCaching → PostElewise 全在 V 流水线内,硬件保证串行
1174
+ 5. 循环间反向同步(如 `MTE3_V`、`MTE3_MTE2`):首轮跳过 WaitFlag,末轮跳过 SetFlag——**仅在持有法则 trace 确认存在跨迭代 WAR 时才插入**
1175
+
1176
+ > ⚠ **禁止凭直觉预设同步点**。是否存在反向同步、需要几个 eventID,完全取决于持有法则 trace 的结果。不同算子的 buffer 复用方式不同,同步点可能不同。
1177
+
1178
+ **Buffer 非复用约束**(持有法则 trace 的设计输入):
1179
+ - `outBuf`(postReducePhase buffer)与 `preInBuf`(preReducePhase buffer)是独立分配的物理 buffer,跨 aLoopIdx 迭代不复用
1180
+ - 因此 CopyOut(MTE3 读 outBuf)与下轮 CopyIn(MTE2 写 preInBuf)**不构成 WAR**,不需要 `MTE3_MTE2`
1181
+ - `outBuf` 跨 aLoopIdx 迭代复用:本轮 CopyOut(MTE3 读 outBuf)→ 下轮 PostElewise(V 写 outBuf)构成跨迭代 MTE3→V WAR,需要 `MTE3_V` 反向同步
1182
+ - `preInBuf` 在 R chunk 循环内可能复用(Phase A 主块→尾块):循环内 V→MTE2 WAR,需要 `V_MTE2` 反向同步
1183
+ - `preInBuf` 跨 rIdx 迭代复用:本轮 V 链末尾 → 下一轮 rIdx 的 CopyIn 构成跨迭代 V→MTE2 WAR,需要 `V_MTE2` 反向同步
1184
+ - `preInBuf` 跨 aLoopIdx 迭代复用:本轮 aLoop 最后一个 R chunk 的 V → 下一轮 aLoop 第一个 R chunk 的 CopyIn(MTE2 覆写 preInBuf)构成跨 aLoopIdx 的 V→MTE2 WAR,需要 `V_MTE2` 反向同步
1185
+
1186
+ **持有法则 trace 必查项**:
1187
+ - R chunk 循环内 WAR:同一 rIdx 迭代内,是否存在 V 读 buffer → MTE2 覆写同一 buffer 的 Phase A 配对
1188
+ - R chunk 跨迭代 WAR:本轮 V 链末尾读的 buffer,是否在下一轮 rIdx 被 MTE2 覆写
1189
+ - aLoopIdx 跨迭代 WAR:本轮最后一个 R chunk 的 V 链 → 下一轮第一个 R chunk 的 CopyIn(MTE2 覆写 preInBuf),preInBuf 跨 aLoopIdx 复用
1190
+ - outBuf 跨迭代 WAR:本轮 CopyOut(MTE3 读 outBuf)→ 下轮 PostElewise(V 写 outBuf),需要 `MTE3_V` 反向同步
1191
+
1192
+ **Event ID 获取**(Init 中统一获取,按实际需要的事件类型取):
1193
+
1194
+ ```cpp
1195
+ // 按 trace 结果获取需要的事件类型,不需要的不取
1196
+ int32_t evMTE2toV = static_cast<int32_t>(GetTPipePtr()->FetchEventID(HardEvent::MTE2_V));
1197
+ int32_t evVtoMTE3 = static_cast<int32_t>(GetTPipePtr()->FetchEventID(HardEvent::V_MTE3));
1198
+ int32_t evVtoMTE2 = static_cast<int32_t>(GetTPipePtr()->FetchEventID(HardEvent::V_MTE2));
1199
+ // MTE3_V:outBuf 跨迭代 MTE3 读→V 写 WAR
1200
+ int32_t evMte3toV = static_cast<int32_t>(GetTPipePtr()->FetchEventID(HardEvent::MTE3_V));
1201
+ // MTE3_MTE2 按 trace 结果确认
1202
+ int32_t evMTE3toMTE2 = static_cast<int32_t>(GetTPipePtr()->FetchEventID(HardEvent::MTE3_MTE2));
1203
+ ```
1204
+
1205
+ ### 7.2 范式特殊的同步
1206
+
1207
+ **无跨核同步**(Base 模板不调用 SyncAll)。
1208
+
1209
+ **outBuf 跨迭代 MTE3→V WAR**:PostElewise(V 写 outBuf)前 `WaitFlag<MTE3_V>`(首轮跳)、CopyOut(MTE3 读 outBuf)后 `SetFlag<MTE3_V>`(末轮跳)。
1210
+
1211
+ ## 8 kernel 产出校验
1212
+
1213
+ 暂不涉及。