@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.
- package/README.md +105 -3
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/assets/ops-direct-invoke/.cannbot-bundle +1 -0
- package/assets/ops-direct-invoke/.claude-plugin/plugin.json +21 -0
- package/assets/ops-direct-invoke/.codex-plugin/plugin.json +30 -0
- package/assets/ops-direct-invoke/AGENTS.md +93 -0
- package/assets/ops-direct-invoke/LICENSE +38 -0
- package/assets/ops-direct-invoke/QUICKSTART.md +44 -0
- package/assets/ops-direct-invoke/README.md +219 -0
- package/assets/ops-direct-invoke/SKILLS_LICENSE +38 -0
- package/assets/ops-direct-invoke/agents/ops-direct-invoke-architect.md +39 -0
- package/assets/ops-direct-invoke/agents/ops-direct-invoke-developer.md +39 -0
- package/assets/ops-direct-invoke/agents/ops-direct-invoke-verifier.md +38 -0
- package/assets/ops-direct-invoke/init.sh +8 -0
- package/assets/ops-direct-invoke/plugin-install.json +24 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/SKILL.md +88 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/evals/evals.json +207 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-arithmetic.md +399 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-atomic.md +192 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-buffer.md +364 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-cross-gen-fixpipe.md +28 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-cross-gen-migration.md +91 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-crosscore-sync.md +259 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-datacopy.md +405 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-gathermask.md +243 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-gmm.md +260 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-hccl-host.md +187 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-hcomm.md +229 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-host-runtime.md +129 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-loaddata.md +196 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-matmul.md +364 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-mrgsort.md +636 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-pipeline.md +206 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-precision.md +146 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-quickref.md +192 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-reduce-pattern.md +132 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-reduce.md +282 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-repeat-limits.md +144 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-restrictions.md +200 -0
- package/assets/ops-direct-invoke/skills/ascendc-api-best-practices/references/api-transpose.md +234 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/SKILL.md +245 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/block/block_mmad_glu.h +238 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/block/block_scheduler_group_matmul.h +106 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/block/weight_quant_matmul_block_mmad.h +362 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_dequant_swiglu.h +265 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_pertoken_quant_single_pass.h +252 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_pertoken_quant_two_pass_chunked.h +313 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/block_epilogue_swiglu.h +171 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/cv_sync_constants.h +32 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/epilogue_fusion_membase.h +212 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/epilogue_fusion_regbase.h +324 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/online_softmax_cross_core_epilogue.h +396 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/epilogue/online_softmax_per_tile_epilogue.h +421 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/kernel/group_matmul_kernel_cv1_v2.h +150 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/kernel/group_matmul_kernel_glu_fused.h +345 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/kernel/weight_quant_matmul_kernel.h +611 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/policy/dispatch_policy.h +63 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/utils/common_utils.h +101 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/blaze_custom/utils/integral_constant.h +38 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_group_matmul_pertoken_quant_selector.h +119 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_group_matmul_tiling_data.h +38 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_matmul_tiling.h +457 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/matmul/blaze_matmul_tiling_data.h +50 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/mx/quant_matmul_mx_tiling.h +549 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/mx/quant_matmul_mx_tiling_data.h +47 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/weight_quant/weight_quant_tiling.h +428 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/assets/op_tiling/weight_quant/weight_quant_tiling_data.h +59 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/evals/evals.json +234 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/assembly-recovery-method.md +106 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/dependency-trace-method.md +140 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/design-contract-method.md +78 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/investigation-report-template.md +249 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/blaze-investigation/source-investigation-method.md +131 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-cmake-build-guide.md +184 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-framework-overview.md +403 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-matmul-layout.md +322 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/blaze-sync-patterns.md +814 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/fundamentals/tensor-api-reference.md +589 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/blaze-design-template.md +593 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/blaze-plan-template.md +391 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/glu-development.md +755 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/glu-precision-diagnosis.md +113 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/group-matmul-delta.md +299 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/per-token-quant-development.md +450 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/kernel-design/tiling-selection.md +114 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/launcher/launcher-development.md +346 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/cube-matmul-then-vector-softmax-reduce/reduce-adaptation-guide.md +204 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/block-l0c2ub-extension.md +75 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/elementwise-broadcast-epilogue-fusion-design.md +280 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/elementwise-broadcast-epilogue-fusion-development.md +202 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/epilogue-membase-design.md +82 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/epilogue-regbase-design.md +95 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/fused-kernel-development.md +71 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/precision-diagnosis.md +86 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/elementwise-broadcast-epilogue-fusion/splitm-contract-and-debugging.md +86 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/index.md +14 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/scenario-extension-guide.md +84 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/layout-variant-boundary.md +76 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/pitfalls-and-diagnosis.md +124 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/prologue-ub-layout-design.md +135 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/prologue-vf-dequant-design.md +213 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/weight-dequant-prologue-fusion-design.md +289 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/weight-dequant-prologue-fusion-development.md +232 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/scenarios/weight-dequant-prologue-fusion/weight-quant-tiling-contract.md +83 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/troubleshooting/compile-troubleshooting.md +231 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/troubleshooting/optimized-runtime-hang.md +102 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step1-project-setup.md +170 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step2-blaze-investigation.md +192 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step3-kernel-design.md +246 -0
- package/assets/ops-direct-invoke/skills/ascendc-blaze-best-practice/references/workflow/step4-operator-development.md +166 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/SKILL.md +67 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/evals/evals.json +123 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/crash_workflow.md +193 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/memcheck/README.md +137 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/memcheck/automated_workflow.md +418 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/references/memcheck/mssanitizer_guide.md +181 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/scripts/memcheck_input.json.template +44 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/scripts/parse_plog.py +191 -0
- package/assets/ops-direct-invoke/skills/ascendc-crash-debug/scripts/run_memcheck_pre.sh +696 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/SKILL.md +105 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/evals/evals.json +128 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/CMakeLists.txt +131 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/README.md +55 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_extension/add_custom_torch.cpp +82 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_extension/ops.h +23 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_extension/register.cpp +42 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_host/add_custom.asc +149 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_host/data_utils.h +98 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_kernel/add_custom_kernel.asc +136 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/op_kernel/add_custom_tiling.h +31 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/run.sh +86 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/gen_data.py +49 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/golden.py +36 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/test_torch.py +90 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/add_custom/scripts/verify_result.py +54 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kernel_launch_details.md +116 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/CMakeLists.txt +19 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/README.md +214 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/UPSTREAM.md +35 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/add_custom.cpp +99 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/add_custom_tiling.h +25 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeCCECompiler.cmake.in +15 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeCCEInformation.cmake +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeDetermineCCECompiler.cmake +119 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/Modules/CMakeTestCCECompiler.cmake +11 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/cmake/npu/CMakeLists.txt +36 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/data_utils.h +132 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/ext_lib/.gitattributes +1 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/input/.keep +0 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/main.cpp +108 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/output/.keep +0 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/run.sh +141 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/scripts/acl.json +1 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/scripts/gen_data.py +26 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_add_template/scripts/verify_result.py +54 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/kirin_vector_guide.md +172 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_guide.md +348 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/CMakeLists.txt +157 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/common/acl_utils.h +70 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/common/common_utils.h +84 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/common/io_utils.h +163 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_extension/matmul_blaze_torch.cpp +55 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_extension/ops.h +22 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_extension/register.cpp +22 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_kernel/include/blaze_custom/.gitkeep +0 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_kernel/matmul_blaze_kernel.cpp +33 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_kernel/matmul_blaze_kernel.h +99 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_tiling/matmul_constant.h +31 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_tiling/matmul_tiling_data.h +45 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/op_tiling/matmul_tiling_stub.h +77 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/run.sh +94 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/scripts/gen_data_mxfp4.py +152 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/scripts/gen_data_mxfp8.py +114 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/scripts/verify_result.py +132 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/test_matmul_blaze.cpp +145 -0
- package/assets/ops-direct-invoke/skills/ascendc-direct-invoke-template/references/matmul_blaze_template/test_matmul_blaze_torch.py +141 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/SKILL.md +56 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/evals/evals.json +191 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/aclnn-api-doc-template.md +368 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/detailed-design-template.md +388 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/iteration-plan-template.md +45 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/operator-readme-template.md +234 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/operator-readme-template_bak.md +165 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-gen/references/requirement-analysis-template.md +131 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/SKILL.md +163 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/evals/evals.json +197 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/references/api-index.md +207 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/references/compatibility.md +141 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/references/example-catalog.md +197 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/requirements.txt +2 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/__init__.py +6 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/ascend_content_fetcher.py +479 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/ascend_search_client.py +201 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/ascend_search_skill.py +163 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/clean_markdown.py +489 -0
- package/assets/ops-direct-invoke/skills/ascendc-docs-search/scripts/find_api_doc.sh +54 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/SKILL.md +123 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/evals/evals.json +211 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/references/asys_commands.md +64 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/references/env_config_guide.md +96 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/references/kirin_platform_guide.md +11 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/references/npu_commands.md +114 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/references/troubleshooting.md +177 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/_npu_info.py +763 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/check_env.sh +320 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/get_npu_arch.py +488 -0
- package/assets/ops-direct-invoke/skills/ascendc-env-check/scripts/npu_info.sh +228 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/SKILL.md +370 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/CONTEXT.md +85 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/MC2-CAPABILITY-PLAN.md +111 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/adr/0001-mc2-skill-not-plugin.md +31 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/docs/adr/0002-decision-stack-path-registry.md +33 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/evals/evals.json +315 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/capability-declaration.md +97 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/codebase-analysis.md +34 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/architecture.md +444 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/communication.md +669 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/compute.md +587 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/fundamentals/fusion.md +550 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/design-template.md +313 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/dev-methodology.md +111 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/development-guide.md +445 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/host-and-testing.md +285 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/operator-anatomy.md +739 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/paradigm-mapping.md +93 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/operator-design/plan-template.md +235 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/review-checklist.md +96 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/compute-first-reduce-scatter/design.md +107 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/compute-first-reduce-scatter/development.md +272 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/get-all-gather-quant-matmul/design.md +93 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/get-all-gather-quant-matmul/development.md +70 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/index.md +47 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-gather-quant-matmul/design.md +83 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-gather-quant-matmul/development.md +62 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-to-all-quant-matmul/design.md +106 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/scenarios/put-all-to-all-quant-matmul/development.md +74 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/troubleshooting/failure-navigation.md +47 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/troubleshooting/optimization-playbook.md +143 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step1-project-setup.md +52 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step2-investigation.md +89 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step3-design.md +69 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow/step4-implementation.md +29 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/apace/workflow_integration.md +122 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/api-rules/index.md +71 -0
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/combine-reading-guide.md +102 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/common-reading-method.md +226 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/design-overview.md +558 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/dispatch-reading-guide.md +81 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/reading/kernel-execution-units.md +189 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/build-framework.md +177 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/change-routing.md +18 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/combine-dataflow.md +144 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/dispatch-dataflow.md +128 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/index.md +98 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/sample-helper-map.md +47 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/samples/spec-template.md +78 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/ascendc-api/moe-dispatch-combine/tiling-scheme/index.md +111 -0
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/CMakeLists.txt +95 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/cmake/ascend.cmake +59 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/cmake/shmem.cmake +75 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/cmake/tensor_api.cmake +48 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/include/utils/constant.h +106 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/run.sh +65 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/scripts/extract_perf.py +57 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/scripts/gen_data.py +139 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/scripts/verify_result.py +152 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/all_to_all_matmul/src/utils.h +168 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/codebase_map.md +342 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/comm_shmem.md +280 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/matmul_blaze.md +259 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/mc2_architecture.md +199 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/review-checklist.md +29 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/blaze-shmem/workflow_integration.md +215 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/CMakeLists.txt +559 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/build.sh +319 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/config.cmake +232 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/func.cmake +478 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/intf.cmake +4 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/intf_pub.cmake +67 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/modules/Findalog.cmake +105 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/cmake/scripts/prepare.sh +129 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/golden.py +27 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/run_test.sh +33 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/single_server_config.ini +17 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/single_server_run.py +116 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/all_gather_matmul/examples/test_golden_cpu.py +63 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/codebase_map.md +281 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/comm_hccl.md +201 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/matmul_fusion.md +50 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/mc2_architecture.md +142 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/op_architecture.md +167 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/pipeline_tuning.md +47 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/review-checklist.md +39 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/foundations/hccl-matmul/workflow_integration.md +152 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/operators/collective-comm.md +145 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/classification.md +27 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/comm-path-decision.md +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/grill-protocol.md +202 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/quality-checklist.md +57 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/requirement-analysis/template.md +208 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/shared/pipeline_tuning.md +232 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/references/shared/profiling_mc2.md +278 -0
- package/assets/ops-direct-invoke/skills/ascendc-mc2-best-practice/scripts/fetch_apace.sh +96 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/SKILL.md +121 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/evals/evals.json +138 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/advanced_tiling.md +92 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/broadcast_design.md +160 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/broadcast_add_kernel.cpp +118 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/broadcast_add_tiling.cpp +126 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/broadcast_common.h +344 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/onedim_add_kernel.cpp +97 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/code/onedim_add_tiling.cpp +57 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/datacopypad_design.md +46 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/nddma_design.md +53 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/onedim_design.md +114 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/broadcast/ub_broadcast_design.md +67 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/core_shrink_design.md +126 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/datacopy_optimization_design.md +351 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/tail_block_design.md +268 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/common/ub_resident_design.md +342 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/guide.md +69 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_base.template +81 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_big_dim.template +217 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_cut_one_axis.template +336 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_cut_two_axis.template +781 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_n_last.template +340 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_small_shape.template +321 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_tensor_move.template +102 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_transdata_5hd.template +480 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_transdata_5hd_021axis.template +533 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/dav3510/transpose_with_gather.template +688 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/templates/transpose_tiling_data.template +192 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_big_dim.md +220 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_cut_one_axis.md +175 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_cut_two_axis.md +177 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_fusion_design.md +398 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_gather.md +191 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_n_last.md +276 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_small_shape.md +315 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_tensor_move.md +203 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_tiling_data.md +176 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_vconv_021.md +206 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/conversion/transpose_vconv_5hd.md +179 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/elementwise/double_buffer_design.md +288 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/elementwise/vector_efficiency_design.md +203 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/constant_folding_design.md +466 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/fullload_design.md +344 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/guide.md +16 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/mte2_preload_design.md +320 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/pingpong_design.md +254 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/scale_coalescing_design.md +282 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/small_m_wide_n_pipeline_design.md +137 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/streamk_design.md +374 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/matmul/swat_design.md +423 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/mc2/guide.md +45 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/mc2/local_matmul_design.md +130 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/mc2/pipeline_balancing_design.md +502 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/guide.md +178 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/kernel_utils.template +75 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ar_full_load.template +429 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ar_recompute.template +485 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ar_small_r.template +348 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ara_full_load.template +574 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ara_online.template +324 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_ara_recompute.template +436 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/dav310/softmax_v2_base.template +950 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/fused_attention_online_softmax_design.md +428 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ar_full_load.md +137 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ar_recompute.md +135 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ar_small_r.md +122 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ara_full_load.md +144 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ara_online.md +185 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_ara_recompute.md +163 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_tiling.template +460 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/softmax_v2_tiling_data.template +278 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/state_resident_design.md +337 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/reduce/templates/usage_guide.md +253 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/scalar/coding_principles.md +476 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/scalar/conv_scalar.md +165 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/scalar/guide.md +31 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/simt/optimization-guide.md +110 -0
- package/assets/ops-direct-invoke/skills/ascendc-performance-best-practices/references/sort/radix_sort.md +354 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/SKILL.md +361 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/evals/evals.json +161 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/ascendc-dumptensor-refs/api-reference.md +92 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/ascendc-dumptensor-refs/error-patterns.md +40 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/ascendc-dumptensor.md +205 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/best-practices.md +317 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/binary-search-debug.md +275 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/case-studies.md +459 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/common-traps.md +492 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/data-comparison.md +308 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/debug-summary-template.md +198 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/diagnosis-workflow.md +180 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/printf-debug.md +296 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/simt-precision-debug.md +76 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/references/tools-reference.md +364 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/scripts/error_analysis.py +148 -0
- package/assets/ops-direct-invoke/skills/ascendc-precision-debug/scripts/gen_boundary_test.py +169 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/SKILL.md +47 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/evals/evals.json +115 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/arithmetic_and_reduce.md +228 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/compute_api_membase_vs_regbase.md +107 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/datacopy_best_practices.md +139 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/index.md +38 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/pipeline_and_buffer.md +105 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/regbase_api_reference.md +303 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/regbase_api_sync.md +173 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/api/regbase_api_whitelist.md +142 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/index.md +24 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/regbase_build_notes.md +49 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/regbase_performance_practices.md +52 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/regbase_programming_notes.md +120 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/tiling_review_notes.md +86 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/dev-experience/working_vs_failed_dav_3510_cases.md +49 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/README.md +190 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/CMakeLists.txt +328 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/README.md +163 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_graph/xdivy_proto.h +42 -0
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_host/xdivy_def.cpp +60 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_host/xdivy_infershape.cpp +58 -0
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/op_kernel/xdivy.cpp +42 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/aclnn/CMakeLists.txt +67 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/aclnn/run.sh +56 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/aclnn/test_aclnn.cpp +354 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/geir/CMakeLists.txt +69 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/geir/run.sh +58 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/geir/test_geir.cpp +407 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/tiling/CMakeLists.txt +185 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/tiling/run.sh +61 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/example/xdivy_custom_package/tests/tiling/test_tiling.cpp +386 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/patterns.md +324 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-kernel-entrance.md +95 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-overview.md +252 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-compute-flow.md +214 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-dag-buffers.md +285 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-kernel-helpers.md +209 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-kernel-template.md +611 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-tiling-preprocess.md +545 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/broadcast/references/broadcast-template-standard/broadcast-standard-tiling.md +471 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/broadcast-rules.md +126 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/cast-rules.md +414 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/datacopypad-rules.md +185 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/nddma-rules.md +255 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/sync-and-consistency.md +314 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/value-depend-process.md +40 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/common/vf-programming-rules.md +150 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/dynamic_shape/knowledge.md +382 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/dynamic_shape/patterns.md +260 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/elewise/patterns.md +46 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/elewise/tiling.md +215 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/example-routes.yaml +17 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/general-methodology.md +94 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/mask_predicate/patterns.md +99 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/numerical_stable/knowledge.md +233 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/numerical_stable/patterns.md +390 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/CMakeLists.txt +289 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/README.md +148 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/aclnn/CMakeLists.txt +59 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/aclnn/run.sh +36 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/aclnn/test_aclnn.cpp +227 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/geir/CMakeLists.txt +84 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/geir/run.sh +48 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/geir/test_geir.cpp +297 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/tiling/CMakeLists.txt +143 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/tiling/run.sh +40 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/example/euclidean_norm_package/tests/tiling/test_tiling.cpp +318 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/patterns.md +527 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-binary-sum.md +260 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-highlevel-api.md +146 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-kernel-entrance.md +96 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-survival-node.md +74 -0
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-empty/reduction-empty-dag-buffers.md +292 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-empty/reduction-empty-kernel-template.md +360 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-empty/reduction-empty-tiling.md +234 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-template-overview.md +238 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-tiling-preprocess.md +218 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-tuple-reduce.md +72 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/references/reduction-vf-fusion-rules.md +95 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/reduction/validate_gates.py +194 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/resolve_example.py +106 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/routes.yaml +39 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/stateful/patterns.md +146 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/variable_output/knowledge.md +366 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/paradigms/variable_output/patterns.md +203 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/api_misuse.md +50 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/common_traps.md +67 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/index.md +25 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/precision_failures.md +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/precision_guide.md +85 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/regbase_vs_membase_confusions.md +52 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/pitfalls/symptom_to_cause.md +38 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/reference-ops/open_source_operator_table.md +740 -0
- package/assets/ops-direct-invoke/skills/ascendc-regbase-best-practice/references/regbase_development_guide.md +334 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/SKILL.md +107 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/evals/evals.json +44 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/compute-operators.md +34 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/data-transfer.md +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/debug-api.md +530 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/index-calculation.md +49 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/intra-core-shared.md +70 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/macro-api.md +65 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/multi-core-sync.md +39 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/overview.md +128 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/tensorlist-handling.md +92 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/thread-stride-pattern.md +49 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/vf-call.md +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-best-practices/references/vf-declaration.md +39 -0
- 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
- package/assets/ops-direct-invoke/skills/ascendc-simt-tiling-design/SKILL.md +42 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-tiling-design/evals/evals.json +44 -0
- package/assets/ops-direct-invoke/skills/ascendc-simt-tiling-design/references/guide.md +73 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/SKILL.md +316 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/evals/evals.json +44 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/references/constraint-examples.md +392 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/references/dependency-yaml-spec.md +625 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/references/empty-tensor-guide.md +236 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/references/parameter-definition.md +491 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/references/standards.md +11 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_empty_tensor_cases_derive.py +815 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_factor_values.py +1287 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_implicit_constraints.py +511 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_solver_config.py +618 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_test_cases.py +2800 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/generate_test_factors.py +762 -0
- package/assets/ops-direct-invoke/skills/ascendc-st-design/scripts/utils.py +1931 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/SKILL.md +91 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/evals/evals.json +72 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/dynamic-ub-broadcast.md +87 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/nddma-broadcast.md +199 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/onedim.md +152 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/patterns.md +165 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/broadcast/ub-broadcast.md +331 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/conversion/patterns.md +261 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/elewise/patterns.md +46 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/elewise/tiling.md +215 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/_governance.md +132 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/execution.md +469 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/resources.md +339 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/design/shape.md +271 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/composition.md +138 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/extension_points.md +173 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/fundamentals.md +245 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/foundation/roofline.md +227 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/implementation_ref.md +201 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/patterns.md +239 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/specialization/feature_flags.md +216 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/specialization/sparse_design.md +198 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/subfamilies/base_design.md +395 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/flashattention/subfamilies/quantization_design.md +233 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/gather.md +273 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/index_add.md +434 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/index_select.md +185 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/patterns.md +199 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/repeat_interleave.md +251 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/index/scatter.md +341 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/matmul/ascendc-api-gmm-tiling.md +313 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/matmul/ascendc-api-matmul-tiling.md +408 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/matmul/patterns.md +32 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/alg-dichotomy.md +56 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/alg-group-reduce.md +101 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/alg-welford.md +74 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/algorithms.md +35 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ar-colsplit.md +149 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ar-fullload.md +151 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ara-fullload.md +228 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/ara-rowsplit.md +219 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/multi-axis-transform.md +83 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/multi-output-buffer.md +115 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/patterns.md +212 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/tiling-fields.md +94 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/reduction/with-index.md +247 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/scatter/patterns.md +827 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/sort/alg-two-level-mrgsort.md +681 -0
- package/assets/ops-direct-invoke/skills/ascendc-tiling-design/references/sort/patterns.md +249 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/SKILL.md +109 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/coverage_files_question.json +24 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_cmake.txt +46 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_inferdtype.cpp +139 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_inferdtype.csv +5 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_infershape.cpp +122 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_infershape.csv +5 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_param.h +319 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_tiling.cpp +154 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/csv-refactor/template_tiling.csv +5 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/question.json +100 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/template_report.md +112 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/assets/todo.json +24 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/evals/evals.json +198 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/coverage-guide/coverage-extraction.md +78 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/coverage-guide/test-implementation.md +136 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/custom/custom.md +5 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/csv-format-spec.md +263 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/csv-refactor-workflow.md +494 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/legacy-code-extraction.md +325 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ops-transformer/ops-transformer.md +75 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/build_ut.md +65 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/op-api-ut-guide.md +237 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/op-host-ut-guide.md +240 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/ut-guide/op-kernel-ut-guide.md +198 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step1.md +43 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step2.md +26 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step3.md +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step4.md +130 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/references/workflow/step5.md +5 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/scripts/extract_dtype_combinations.py +200 -0
- package/assets/ops-direct-invoke/skills/ascendc-ut-develop/scripts/generate_csv_template.py +270 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/SKILL.md +125 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/evals/evals.json +198 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/S1-input-collection.md +125 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/00-execution-order.md +58 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/01-variable-semantics.md +250 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/02-generate-mapper.md +218 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/S5_case_json_schema.md +373 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/S5_mapped_case_schema.md +131 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/case-mapper/s5_case_mapper_template.py +411 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/design-verifier/00-execution-order.md +114 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/00-execution-order.md +291 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/01-code-analyzer.md +121 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/02-interface-analyzer.md +417 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/03-param-derivation.md +45 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/04-test-design-template.md +231 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/source-analysis/05-network-search.md +154 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/00-overview.md +66 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/01-step1-tiling.md +114 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/02-step2-trace.md +81 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/03-step3-kernel.md +51 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-a/04-path-config-schema.md +342 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/00-execution-order.md +26 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/01-step1-merge.md +54 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/02-step2-group.md +44 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/03-step3-derive.md +416 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/04-step4-output.md +122 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/task-d/05-step5-gen-cases.md +156 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/00-execution-order.md +108 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/01-csv-common.md +33 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/02-kernel-fields.md +64 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/ttk-converter/03-kernel-mode.md +142 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/references/workflow.md +193 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/_scout_common.py +53 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/assemble_dim_spec.py +232 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/build_param_def.py +134 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/build_path_list.py +520 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/format_json.py +135 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/gen_cases_template.py +196 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/generate_test_design.py +555 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/normalize_op_name.py +157 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/pick_dims.py +173 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/run_ttk_kernel_module.py +750 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s2p0_verify.py +302 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s3_task_d_gate.py +365 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s5_append_empty.py +180 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s5_check_mapper_outputs.py +292 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/s5_expand_high.py +208 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/scout_k.py +723 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/scout_t.py +983 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/ttk_generate_kernel_csv.py +346 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/ttk_precheck_env.py +248 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/ttk_validate_csv.py +315 -0
- package/assets/ops-direct-invoke/skills/ascendc-whitebox-design/scripts/update_path_list.py +143 -0
- package/assets/ops-direct-invoke/skills/cann-env-setup/SKILL.md +177 -0
- package/assets/ops-direct-invoke/skills/cann-env-setup/evals/evals.json +144 -0
- package/assets/ops-direct-invoke/skills/cann-env-setup/references/env_dependence.md +77 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/SKILL.md +51 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/overall-implementation.md +226 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/aclnn-adaptation.md +34 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/aicpu-load-balance-metadata.md +116 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/channel-buffer.md +36 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/compilation-launch.md +144 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/host-validation.md +34 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/layout-tail.md +53 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/synchronization.md +80 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/torch-registration.md +66 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/vf.md +144 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/patterns/workspace.md +67 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-best-practice/references/production-code.md +120 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/SKILL.md +25 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/core/methodology.md +104 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/references/readability-rules.md +280 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/steps/clause-review.md +59 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/steps/report-write.md +60 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/workflows/file-review.md +49 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-code-reviewer/workflows/pr-review.md +58 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/SKILL.md +97 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/references/checks-and-troubleshooting.md +96 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/references/env-selected-soc-schema.md +43 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/references/environment-schema.md +112 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/check_env.sh +34 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/env_check.py +946 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/probe_compile_stage.py +99 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/scripts/probe_kernel.py +33 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-env-check/tests/test_env_report.py +90 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/SKILL.md +60 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/references/pipeline-design.md +84 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/references/stage-cost-model.md +77 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/DESIGN-BRANCH.md.templ +119 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/INDEX.md.templ +34 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/API.md.templ +67 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/DevView.md.templ +67 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/HostLaunch.md.templ +119 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/InferShapeDtype.md.templ +56 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Interface.md.templ +61 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Kernel.md.templ +183 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/LaunchData.md.templ +126 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Overview.md.templ +57 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/TemplatePartition.md.templ +69 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-op-design/templates/design/Validation.md.templ +80 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/SKILL.md +64 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/assets/case_contract.py +269 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/assets/test.py +571 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/references/cases.md +29 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/references/evidence.md +67 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/references/golden.md +12 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/build_blackbox_cases.py +536 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/build_tdd_cases.py +498 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/build_whitebox_cases.py +183 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/casebook.py +71 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/generator_support.py +95 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/prepare_golden.py +390 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/scripts/recipe_validation.py +144 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/tests/test_evidence_chain.py +339 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/tests/test_skills.py +547 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-test-generator/tests/test_synthesize_dtype.py +85 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-unit-planner/SKILL.md +35 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-unit-planner/references/decomposition-checks.md +46 -0
- package/assets/ops-direct-invoke/skills/cannbot-dsl-unit-planner/references/unit-format.md +77 -0
- package/assets/ops-direct-invoke/skills/npu-arch/SKILL.md +87 -0
- package/assets/ops-direct-invoke/skills/npu-arch/evals/evals.json +356 -0
- package/assets/ops-direct-invoke/skills/npu-arch/references/npu-arch-guide-triton.md +312 -0
- package/assets/ops-direct-invoke/skills/npu-arch/references/npu-arch-guide.md +454 -0
- package/assets/ops-direct-invoke/skills/npu-arch/references/npu-hardware-params.md +248 -0
- package/assets/ops-direct-invoke/skills/npu-arch/references/simt-arch-guide.md +303 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/SKILL.md +41 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/index.md +32 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/arithmetic_and_reduce.md +96 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/datacopy_best_practices.md +87 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/index.md +37 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/pipeline_and_buffer.md +87 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/precision_and_runtime.md +98 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/regbase_api_reference.md +88 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/regbase_api_sync.md +112 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/api/regbase_api_whitelist.md +121 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/complexity_and_route_selection.md +113 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/index.md +55 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/process_memory_cards.md +54 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_build_notes.md +87 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_kernel_case_notes.md +103 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_performance_practices.md +92 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/regbase_programming_notes.md +108 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/requirements_analysis_patterns.md +97 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/small_channel_transpose_notes.md +78 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/tiling_review_notes.md +87 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/dev-experience/working_vs_failed_950_cases.md +85 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/index.md +30 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/broadcast_patterns.md +132 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/index.md +48 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/inplace_operator_patterns.md +182 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/kernel_design_patterns.md +117 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/reduction_patterns.md +152 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_buffer_partitioning.md +122 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_kernel_dataflow_patterns.md +164 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_operator_patterns.md +138 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/regbase_sync_patterns.md +113 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/tiling_input_validation.md +267 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/patterns/tiling_patterns.md +124 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/api_misuse.md +161 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/common_traps.md +199 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/index.md +41 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/precision_failures.md +176 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/precision_guide.md +190 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/regbase_vs_membase_confusions.md +89 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/pitfalls/symptom_to_cause.md +58 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/knowledge/regbase_development_guide.md +290 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/flash_attn-arch35-best-practices.md +80 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/quant_flash_attn-arch35-best-practices.md +67 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/sparse_flash_attention-arch35-best-practices.md +66 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/design_sample/sparse_flash_mla-arch35-best-practices.md +69 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/patterns.md +65 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/advanced.md +37 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/buffer.md +241 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/compute-flow.md +111 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/load-balancing.md +42 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/pipeline-example.md +173 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/pipeline.md +60 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/pre-knowledge.md +197 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/roofline.md +220 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/selection.md +32 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/stage-cost.md +63 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/trait-mla.md +36 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/trait-quantization.md +51 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/FA/references/trait-sparse.md +35 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/README.md +20 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/capability-mapping.md +41 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/dag-buffers.md +285 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/design-spec.md +24 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/CMakeLists.txt +328 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/README.md +162 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/op_kernel/xdivy.cpp +44 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/aclnn/CMakeLists.txt +67 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/aclnn/run.sh +57 -0
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/geir/CMakeLists.txt +69 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/geir/run.sh +59 -0
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/tiling/CMakeLists.txt +185 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/example/xdivy_custom_package/tests/tiling/run.sh +62 -0
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/index.md +48 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/kernel-entrance.md +95 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/kernel-helpers.md +208 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/kernel-template.md +617 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/overview.md +250 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/pitfalls.md +50 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/tiling-preprocess.md +487 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/ascendc/tiling.md +374 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/dsl/capability-mapping.md +50 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/dsl/implementation-guide.md +52 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/adapters/dsl/index.md +33 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/capability-contract.md +41 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/compute-flow.md +216 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/index.md +23 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/liveness-fusion.md +200 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/scene.md +68 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/shape-preprocessing.md +209 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/splitting.md +158 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/sync-model.md +79 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/generic/verification.md +131 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/broadcast/patterns.md +62 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/broadcast-rules.md +126 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/cast-rules.md +414 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/datacopypad-rules.md +186 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/nddma-rules.md +257 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/sync-and-consistency.md +315 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/value-depend-process.md +40 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/common/vf-programming-rules.md +150 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/example-routes.yaml +31 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/general-methodology-dsl.md +11 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/general-methodology.md +94 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/binary-tree.md +260 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/capability-mapping.md +49 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/design-spec.md +26 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/CMakeLists.txt +289 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/README.md +147 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/aclnn/CMakeLists.txt +59 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/aclnn/run.sh +37 -0
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/geir/CMakeLists.txt +84 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/geir/run.sh +49 -0
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/tiling/CMakeLists.txt +143 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/example/euclidean_norm_package/tests/tiling/run.sh +41 -0
- 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
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/highlevel-api.md +146 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/index.md +48 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/kernel-entrance.md +97 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/overview.md +237 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/survival-node.md +74 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-base/dag-buffers.md +612 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-base/kernel-template.md +1213 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-base/tiling.md +511 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-group/dag-buffers.md +209 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-group/kernel-template.md +577 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/binary-group/tiling.md +199 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/empty/dag-buffers.md +292 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/empty/kernel-template.md +349 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/templates/empty/tiling.md +230 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/tiling-preprocess.md +218 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/tuple-reduce.md +72 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/adapters/ascendc/vf-fusion-rules.md +95 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/axis-preprocessing.md +109 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/capability-contract.md +48 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/index.md +23 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/liveness-fusion.md +111 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/scene.md +92 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/splitting.md +230 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/sync-model.md +86 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/tree-reduction.md +160 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/generic/tuple-reduce.md +53 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/patterns.md +62 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/reduction/validate_gates.py +196 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/resolve_example.py +170 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/paradigms/routes.yaml +39 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/references/reference-ops/open_source_operator_table.md +715 -0
- package/assets/ops-direct-invoke/skills/ops-design-paradigms/tests/test_language_route.py +142 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/SKILL.md +249 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/assemble_cannbotdsl_design.py +156 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/assemble_workflow.py +571 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/build_implementation_subgraph.py +320 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/generate_workflow_guide.py +94 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/run_workflow.py +121 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/scripts/validate_unit_contracts.py +228 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/cannbot-dsl//344/272/244/344/273/230.yaml +15 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/tasks/common/.gitkeep +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/ascendc/basic.yaml +57 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/ascendc/feasibility.yaml +13 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/cannbot-dsl/op-dev.graph-preview.yaml +18 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke/workflows/cannbot-dsl/op-dev.yaml +142 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/SKILL.md +115 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/agents-entry.md +23 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/documentation.md +52 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/ops-direct-invoke.md +67 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/repo-skills.md +85 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/subagents.md +43 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/task-authoring.md +83 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/reference/tests.md +33 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/dsl_generation/test.py +499 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/support.py +122 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/test_all.py +59 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/variables/test.py +100 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/workflow_execution/test.py +134 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/workflow_generation/test.py +457 -0
- package/assets/ops-direct-invoke/skills/ops-direct-invoke-maintain/test/ut/workflow_guide/test.py +91 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/SKILL.md +22 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/evals/evals.json +120 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/benchmark_construction.md +77 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/float_compute.md +126 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/integer_compute.md +105 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/non_compute.md +81 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/quantization.md +49 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/random_generation.md +198 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/references/test_case_generation.md +61 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/bitwise_match.py +103 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/integer_compute_check.py +157 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/mixed_tolerance_check.py +178 -0
- package/assets/ops-direct-invoke/skills/ops-precision-standard/scripts/random_distribution_check.py +247 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/SKILL.md +185 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/evals/evals.json +196 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/SKILL.md +259 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/VERSION +10 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/evals/evals.json +33 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/collection-workflow.md +91 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/data-contract.md +63 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/environment-and-failure.md +82 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/validation-and-performance.md +63 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/references/visualization-contract.md +86 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/collect.py +2209 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/collect_discovery.py +987 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/collect_validate.py +607 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/environment_context.py +723 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/estimate_runtime.py +131 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/run_pipeline.py +339 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/runtime_guard.py +589 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/self_check.py +465 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize.py +1004 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_common.py +258 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_parsers.py +1555 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_render.py +286 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_resolvers.py +1224 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/scripts/visualize_source.py +1288 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/msopprof-visualization/templates/report_template.html +253 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/references/csv_fields_reference.md +260 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/references/msprof-guide.md +252 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/references/msprof-op-guide.md +241 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/references/optimization_quickref.md +265 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/scripts/msprof_perf_summary.py +2469 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/scripts/msprof_profile_run.sh +400 -0
- package/assets/ops-direct-invoke/skills/ops-profiling/scripts/perf_summary.py +448 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/SKILL.md +233 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/evals/evals.json +128 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/pc-source-mapping.md +76 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-aic.md +557 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-aiv.md +674 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-general.md +199 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-issues-template.md +143 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/performance-metrics-reference.md +350 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/pipeline-bubble-analysis.md +269 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/simulator-advanced.md +174 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/references/troubleshooting.md +105 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/scripts/map_pc_to_source.py +741 -0
- package/assets/ops-direct-invoke/skills/ops-simulator/scripts/trace_bubble_analyzer.py +971 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/SKILL.md +350 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/evals/evals.json +114 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/README.md +71 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/add/spec.yaml +161 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/complex/spec.yaml +154 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/cumsum/spec.yaml +176 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/dropout/spec.yaml +170 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/fused_quant_matmul/spec.yaml +331 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/matmul/spec.yaml +201 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/nonzero/spec.yaml +174 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/reduce_sum/spec.yaml +151 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/reduce_sum_all/spec.yaml +135 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/reduce_sum_fixed/spec.yaml +143 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/softmax/spec.yaml +231 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/examples/split/spec.yaml +160 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/references/accumulation_order.md +63 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/references/error-codes.md +199 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/references/spec-cheatsheet.md +358 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/references/stage-rules.md +476 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/references/usage-scenarios.md +265 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/anti_pattern_registry.yaml +51 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/boundary_min_cases.yaml +215 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/category_enum.yaml +37 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/category_paradigm_map.yaml +145 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/chip_registry.yaml +82 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/error_code_enum.yaml +25 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/framework_oracle_registry.yaml +22 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/invariant_kind_registry.yaml +130 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/machine_check_kind_registry.yaml +84 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/paradigm_enum.yaml +48 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/primitive_whitelist.yaml +67 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/synthesize_pattern_registry.yaml +58 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/registries/tolerance_defaults.yaml +53 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/schemas/op-spec.json +762 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/check_registry_schema_sync.py +167 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/dump_rule_ids.py +168 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/__init__.py +8 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/_ast_sandbox.py +142 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/broadcast.py +270 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/dtype_eval.py +186 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/extreme_inputs_check.py +355 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/formula_eval.py +431 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/formula_oracle_equiv.py +603 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/invariant_exec.py +569 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/oracle_check.py +465 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/parser.py +71 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/promote.py +254 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/shape_eval.py +368 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/stages.py +995 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/evaluators/types.py +130 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/generate_spec.py +1571 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/scripts/validate_spec.py +1848 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/templates/spec.yaml.tmpl +100 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/conftest.py +21 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_attr_resolve.py +72 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_broadcast.py +85 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_doc_drift.py +45 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_dtype_eval.py +163 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_examples.py +54 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_extreme_inputs_check.py +181 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_formula_eval.py +154 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_formula_oracle_equiv.py +281 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_generate_spec.py +98 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_invariant_exec.py +235 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_main_pipeline.py +419 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_oracle.py +255 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_promote.py +127 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_registry_schema_sync.py +32 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_sandbox_escape.py +90 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_shape_eval.py +220 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_shape_literal.py +82 -0
- package/assets/ops-direct-invoke/skills/ops-spec-gen/tests/test_stage2_constraints.py +213 -0
- package/assets/ops-direct-invoke/skills/repo-build-guide/SKILL.md +10 -0
- package/assets/ops-direct-invoke/skills/repo-build-guide/references/build-guide.md +42 -0
- package/assets/ops-direct-invoke/skills/repo-coding-rules/SKILL.md +10 -0
- package/assets/ops-direct-invoke/skills/repo-coding-rules/references/red-lines.md +42 -0
- package/assets/ops-direct-invoke/skills/repo-env-check/SKILL.md +44 -0
- 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
- package/assets/ops-direct-invoke/skills/repo-knowledge/SKILL.md +12 -0
- package/assets/ops-direct-invoke/skills/repo-knowledge/references/evaluation-contract.md +48 -0
- package/assets/ops-direct-invoke/skills/repo-op-templates/SKILL.md +15 -0
- package/assets/ops-direct-invoke/skills/repo-op-templates/references/operator-template.md +27 -0
- package/assets/ops-direct-invoke/skills/repo-op-templates/references/project-skeleton.md +41 -0
- package/assets/ops-direct-invoke/skills/repo-requirement/SKILL.md +39 -0
- package/assets/ops-direct-invoke/skills/repo-requirement/references/requirement-checklist.md +70 -0
- package/assets/ops-direct-invoke/skills/repo-test-develop/SKILL.md +17 -0
- package/assets/ops-direct-invoke/skills/repo-test-develop/references/blackbox-design.md +30 -0
- package/assets/ops-direct-invoke/skills/repo-test-develop/references/cannbench-integration.md +75 -0
- package/assets/ops-direct-invoke/skills/repo-test-develop/references/precision-and-perf.md +36 -0
- package/assets/ops-direct-invoke/skills/repo-test-develop/references/test-framework.md +75 -0
- package/assets/ops-direct-invoke/skills/repo-test-develop/references/whitebox-design.md +19 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/README.md +145 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/SKILL.md +84 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/approve_task.py +98 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/get_task.py +1133 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/init_status.py +131 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/link_agent_config.py +89 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/orchestrator.py +738 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/poll_workflow.py +392 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/task_graph.py +144 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/update_status.py +149 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/verdict_common.py +103 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/verdict_fail.py +22 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/scripts/verdict_pass.py +21 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/templates/basic_workflow.yaml +113 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_agent_exit.py +91 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_approval.py +490 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_link_agent_config.py +202 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_nested_subgraphs.py +337 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_orchestrator.py +1383 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_poll_workflow.py +371 -0
- package/assets/ops-direct-invoke/skills/workflow-orchestrator/tests/test_verdict.py +148 -0
- package/cordis.patch.yml +3 -0
- package/icon.svg +1 -0
- package/lib/client.js +255 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +15 -0
- package/locale/en.json +1 -0
- package/locale/zh.json +1 -0
- package/package.json +62 -3
- package/upstream.json +10 -0
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 Huawei Technologies Co., Ltd.
|
|
3
|
+
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
|
|
4
|
+
* CANN Open Software License Agreement Version 2.0 (the "License").
|
|
5
|
+
* Please refer to the License for details. You may not use this file except in compliance with the License.
|
|
6
|
+
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
|
7
|
+
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
8
|
+
* See LICENSE in the root of the software repository for the full text of the License.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*!
|
|
12
|
+
* \file euclidean_norm_tiling_arch35.cpp
|
|
13
|
+
* \brief EuclideanNorm 算子 host tiling 实现(新范式)。
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include <algorithm>
|
|
17
|
+
#include <set>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <vector>
|
|
20
|
+
#include <cstring>
|
|
21
|
+
|
|
22
|
+
#include "euclidean_norm_tiling_arch35.h"
|
|
23
|
+
|
|
24
|
+
#include "log/log.h"
|
|
25
|
+
#include "util/math_util.h"
|
|
26
|
+
#include "util/platform_util.h"
|
|
27
|
+
#include "graph/utils/type_utils.h"
|
|
28
|
+
#include "../../op_kernel/arch35/euclidean_norm_tiling_data.h"
|
|
29
|
+
#include "../../op_kernel/arch35/euclidean_norm_tiling_key.h"
|
|
30
|
+
|
|
31
|
+
namespace optiling {
|
|
32
|
+
|
|
33
|
+
// 输入索引:x = 0,axes = 1(与 TilingInputsDataDependency({1}) 的值依赖声明对应)
|
|
34
|
+
static constexpr size_t INPUT_X_IDX = 0;
|
|
35
|
+
static constexpr size_t INPUT_AXES_IDX = 1;
|
|
36
|
+
|
|
37
|
+
// A/R 规整后轴数合法区间:上限取通用类别 MAX_PATTERN_RANK = 9。
|
|
38
|
+
static constexpr int32_t MIN_AXIS_NUM = 2;
|
|
39
|
+
static constexpr int32_t MAX_AXIS_NUM = MAX_PATTERN_RANK;
|
|
40
|
+
|
|
41
|
+
// cacheBuf(kernel 二分树缓存)固定 16KB 预算;FP32 单元素字节数(中间精度换算)。
|
|
42
|
+
static constexpr int64_t CACHE_BUF_BYTES = 16 * 1024;
|
|
43
|
+
static constexpr int64_t FP32_BYTES = 4;
|
|
44
|
+
|
|
45
|
+
// UB 预算系数:pre 侧共 3 个 buffer(preIn + preRes + preResTail = P_PRE + P_PRE_EXT),
|
|
46
|
+
// post 侧 1 个(outBuf = P_POST)。
|
|
47
|
+
static constexpr int64_t P_PRE = 2;
|
|
48
|
+
static constexpr int64_t P_PRE_EXT = 1;
|
|
49
|
+
static constexpr int64_t P_POST = 1;
|
|
50
|
+
|
|
51
|
+
// A/R 轴模式化后偶位 A、奇位 R,相邻同类型轴(同为 A 或同为 R)的固定间距。
|
|
52
|
+
static constexpr int32_t AXIS_INTERVAL = 2;
|
|
53
|
+
// Group 触发阈值分母:A 迭代总数 ≤ 核数/2(A 并行度不足半数核)且 R 迭代 >1 时走 Group 2D 分核。
|
|
54
|
+
static constexpr int64_t GROUP_CORE_RATIO = 2;
|
|
55
|
+
|
|
56
|
+
// 空 tensor 三分类:NORMAL(正常)/ EMPTY_A(非归约维含 0 → 输出 0 元素)/
|
|
57
|
+
// EMPTY_R(仅归约维含 0 → 每输出 = sqrt(0) = 0)。
|
|
58
|
+
enum class EuclideanNormEmptyKind {
|
|
59
|
+
NORMAL = 0,
|
|
60
|
+
EMPTY_A,
|
|
61
|
+
EMPTY_R,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// tiling 全程工作状态:一次 TilingFunc 调用内的全部中间量,按生产阶段分区。
|
|
65
|
+
struct EuclideanNormCtx {
|
|
66
|
+
// ── 平台参数(GetPlatformInfo 填充)──
|
|
67
|
+
int64_t coreNum = 0;
|
|
68
|
+
int64_t ubSize = 0;
|
|
69
|
+
int64_t blockSize = 0;
|
|
70
|
+
int64_t cacheLineSize = 0;
|
|
71
|
+
|
|
72
|
+
// ── 输入信息(GetShapeAndDtype / ParseAxesTensor 填充)──
|
|
73
|
+
ge::DataType xDtype = ge::DT_UNDEFINED;
|
|
74
|
+
int64_t dtypeSize = 0;
|
|
75
|
+
int64_t maxDtypeSize = 0;
|
|
76
|
+
std::vector<int64_t> xShape;
|
|
77
|
+
std::vector<int64_t> reduceAxes;
|
|
78
|
+
|
|
79
|
+
// ── 空 tensor 分类(ClassifyEmptyTensor 填充)──
|
|
80
|
+
EuclideanNormEmptyKind emptyKind = EuclideanNormEmptyKind::NORMAL;
|
|
81
|
+
int64_t aTotalEmpty = 0;
|
|
82
|
+
|
|
83
|
+
// ── A/R 规整模式(BuildInitialAxisList + PreprocessPattern 填充)──
|
|
84
|
+
std::vector<int64_t> axisShape;
|
|
85
|
+
std::vector<bool> isReduceAxis;
|
|
86
|
+
int32_t axisNum = 0;
|
|
87
|
+
bool isTailR = false;
|
|
88
|
+
|
|
89
|
+
// ── UB 切分参数(ComputeAUbFactor / ComputeRUbFactor / ExpandAIfRFullyLoaded 填充)──
|
|
90
|
+
int32_t aSplitIdx = 0;
|
|
91
|
+
int32_t rSplitIdx = 0;
|
|
92
|
+
int64_t aUbFactor = 0;
|
|
93
|
+
int64_t rUbFactor = 0;
|
|
94
|
+
int64_t rUbFactorAlign = 0;
|
|
95
|
+
int64_t innerAProdAlign = 0;
|
|
96
|
+
int64_t innerRProdAlign = 0;
|
|
97
|
+
|
|
98
|
+
// ── A 方向多核参数(ComputeFusedALoopSplit 填充)──
|
|
99
|
+
int64_t aLoopCntTotal = 0;
|
|
100
|
+
int64_t aSplitChunkCnt = 0;
|
|
101
|
+
int64_t aBigCoreLoopCnt = 0;
|
|
102
|
+
int64_t aSmallCoreLoopCnt = 0;
|
|
103
|
+
int32_t aBigCoreCnt = 0;
|
|
104
|
+
int32_t usedCoreNum = 0;
|
|
105
|
+
|
|
106
|
+
// ── R 方向迭代数(ComputeRLoopCnt 填充)──
|
|
107
|
+
int64_t rLoopCntTotal = 0;
|
|
108
|
+
|
|
109
|
+
// ── UB buffer 尺寸(ComputeUbSizes 填充)──
|
|
110
|
+
int64_t preBufSize = 0;
|
|
111
|
+
int64_t postBufSize = 0;
|
|
112
|
+
|
|
113
|
+
// ── Group 2D 分核参数(ComputeGroupSplit 填充)──
|
|
114
|
+
bool isGroup = false;
|
|
115
|
+
int64_t rGroupCnt = 0;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// 获取平台硬件参数:AIV 核数、UB 容量、32B block 大小、cache line 大小。
|
|
119
|
+
// 全走 platform 接口(禁止写死),任一参数为 0 视为环境异常直接失败。
|
|
120
|
+
static ge::graphStatus GetPlatformInfo(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
121
|
+
{
|
|
122
|
+
fe::PlatFormInfos* platformInfoPtr = context->GetPlatformInfo();
|
|
123
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, platformInfoPtr);
|
|
124
|
+
|
|
125
|
+
auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformInfoPtr);
|
|
126
|
+
ctx.coreNum = ascendcPlatform.GetCoreNumAiv();
|
|
127
|
+
OP_CHECK_IF(ctx.coreNum == 0,
|
|
128
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(context->GetNodeName(), "platform.coreNum",
|
|
129
|
+
"GetCoreNumAiv returned 0"),
|
|
130
|
+
return ge::GRAPH_FAILED);
|
|
131
|
+
|
|
132
|
+
uint64_t ub = 0;
|
|
133
|
+
ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, ub);
|
|
134
|
+
ctx.ubSize = static_cast<int64_t>(ub);
|
|
135
|
+
OP_CHECK_IF(ctx.ubSize == 0,
|
|
136
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(context->GetNodeName(), "platform.ubSize",
|
|
137
|
+
"GetCoreMemSize(UB) returned 0"),
|
|
138
|
+
return ge::GRAPH_FAILED);
|
|
139
|
+
|
|
140
|
+
ctx.blockSize = static_cast<int64_t>(Ops::Base::GetUbBlockSize(context));
|
|
141
|
+
ctx.cacheLineSize = static_cast<int64_t>(Ops::Base::GetCacheLineSize(context));
|
|
142
|
+
OP_CHECK_IF(ctx.blockSize == 0 || ctx.cacheLineSize == 0,
|
|
143
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(context->GetNodeName(), "platform.blockSize/cacheLineSize",
|
|
144
|
+
"BlockSize=" + std::to_string(ctx.blockSize) +
|
|
145
|
+
" or cacheLineSize=" + std::to_string(ctx.cacheLineSize) +
|
|
146
|
+
" is 0"),
|
|
147
|
+
return ge::GRAPH_FAILED);
|
|
148
|
+
return ge::GRAPH_SUCCESS;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// 读取输入 x 的 shape 与 dtype:rank 0(标量)视作 [1];负 dim(动态 shape 防御)报错;
|
|
152
|
+
// dtype 白名单 {fp16, bf16, fp32, int32};派生 dtypeSize 与 maxDtypeSize(fp32 中间精度
|
|
153
|
+
// 使 b16 输入也按 4 字节预算 UB)
|
|
154
|
+
static ge::graphStatus GetShapeAndDtype(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
155
|
+
{
|
|
156
|
+
auto xShapePtr = context->GetInputShape(INPUT_X_IDX);
|
|
157
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, xShapePtr);
|
|
158
|
+
const gert::Shape& xS = xShapePtr->GetStorageShape();
|
|
159
|
+
const size_t rank = xS.GetDimNum();
|
|
160
|
+
ctx.xShape.clear();
|
|
161
|
+
if (rank == 0) {
|
|
162
|
+
ctx.xShape.push_back(1);
|
|
163
|
+
} else {
|
|
164
|
+
for (size_t i = 0; i < rank; ++i) {
|
|
165
|
+
OP_CHECK_IF(
|
|
166
|
+
xS.GetDim(i) < 0,
|
|
167
|
+
OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON(
|
|
168
|
+
context->GetNodeName(), "x", std::to_string(xS.GetDim(i)),
|
|
169
|
+
"dim[" + std::to_string(i) + "] is negative (dynamic shape must be instantiated before tiling)"),
|
|
170
|
+
return ge::GRAPH_FAILED);
|
|
171
|
+
ctx.xShape.push_back(xS.GetDim(i));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
auto xDesc = context->GetInputDesc(INPUT_X_IDX);
|
|
176
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, xDesc);
|
|
177
|
+
ctx.xDtype = xDesc->GetDataType();
|
|
178
|
+
const std::set<ge::DataType> supportedDtypes = {ge::DT_FLOAT16, ge::DT_BF16, ge::DT_FLOAT, ge::DT_INT32};
|
|
179
|
+
OP_CHECK_IF(supportedDtypes.count(ctx.xDtype) == 0,
|
|
180
|
+
OP_LOGE_FOR_INVALID_DTYPE_WITH_REASON(context->GetNodeName(), "x",
|
|
181
|
+
ge::TypeUtils::DataTypeToSerialString(ctx.xDtype).c_str(),
|
|
182
|
+
"only DT_FLOAT16/DT_BF16/DT_FLOAT/DT_INT32 are supported"),
|
|
183
|
+
return ge::GRAPH_FAILED);
|
|
184
|
+
ctx.dtypeSize = static_cast<int64_t>(ge::GetSizeByDataType(ctx.xDtype));
|
|
185
|
+
ctx.maxDtypeSize = std::max(ctx.dtypeSize, FP32_BYTES);
|
|
186
|
+
|
|
187
|
+
std::string shapeStr = "[";
|
|
188
|
+
for (size_t i = 0; i < ctx.xShape.size(); ++i) {
|
|
189
|
+
if (i > 0) {
|
|
190
|
+
shapeStr += ", ";
|
|
191
|
+
}
|
|
192
|
+
shapeStr += std::to_string(ctx.xShape[i]);
|
|
193
|
+
}
|
|
194
|
+
shapeStr += "]";
|
|
195
|
+
OP_LOGI(context, "EuclideanNorm input: xShape=%s xDtype=%d dtypeSize=%ld", shapeStr.c_str(),
|
|
196
|
+
static_cast<int>(ctx.xDtype), ctx.dtypeSize);
|
|
197
|
+
return ge::GRAPH_SUCCESS;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// 归一化并追加单个 axis:负索引 +xRank 归一到 [0, xRank);越界/重复打 ERROR 并返回 false。
|
|
201
|
+
static bool PushOneAxis(const char* nodeName, int64_t v, int64_t idx, int64_t xRank, std::set<int64_t>& seen,
|
|
202
|
+
std::vector<int64_t>& axesOut)
|
|
203
|
+
{
|
|
204
|
+
if (v < -xRank || v >= xRank) {
|
|
205
|
+
OP_LOGE_FOR_INVALID_VALUE_WITH_REASON(nodeName, "axes", std::to_string(v),
|
|
206
|
+
"axes[" + std::to_string(idx) + "] out of range [-" +
|
|
207
|
+
std::to_string(xRank) + ", " + std::to_string(xRank) + ")");
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
const int64_t norm = (v < 0) ? (v + xRank) : v;
|
|
211
|
+
if (!seen.insert(norm).second) {
|
|
212
|
+
OP_LOGE_FOR_INVALID_VALUE_WITH_REASON(nodeName, "axes", std::to_string(norm),
|
|
213
|
+
"duplicate axis in axes (input idx=" + std::to_string(idx) + ")");
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
axesOut.push_back(norm);
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// 按 T(int32/int64)逐元素读取 axes 并归一化入 axesOut——模板化消 dtype 双分支循环重复
|
|
221
|
+
template <typename T>
|
|
222
|
+
static bool LoadAxesLoop(const char* nodeName, const T* data, int64_t axesNum, int64_t xRank, std::set<int64_t>& seen,
|
|
223
|
+
std::vector<int64_t>& axesOut)
|
|
224
|
+
{
|
|
225
|
+
axesOut.reserve(static_cast<size_t>(axesNum));
|
|
226
|
+
for (int64_t i = 0; i < axesNum; ++i) {
|
|
227
|
+
if (!PushOneAxis(nodeName, static_cast<int64_t>(data[i]), i, xRank, seen, axesOut)) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// 解析值依赖输入 axes 的具体数值到 ctx.reduceAxes(升序去重):
|
|
235
|
+
// 空 axes → full reduce 展开 [0..rank-1](与 infershape 端空 axes 语义一致);
|
|
236
|
+
// 负索引归一化 v+rank;越界 / 重复 → GRAPH_FAILED;
|
|
237
|
+
// 末尾 sort 升序保证合轴确定性(bitwise_reproducible)。
|
|
238
|
+
static ge::graphStatus ParseAxesTensor(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
239
|
+
{
|
|
240
|
+
const gert::Tensor* axesTensor = context->GetInputTensor(INPUT_AXES_IDX);
|
|
241
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, axesTensor);
|
|
242
|
+
const int64_t axesNum = axesTensor->GetShapeSize();
|
|
243
|
+
const int64_t xRank = static_cast<int64_t>(ctx.xShape.size());
|
|
244
|
+
ctx.reduceAxes.clear();
|
|
245
|
+
|
|
246
|
+
if (axesNum == 0) {
|
|
247
|
+
ctx.reduceAxes.resize(static_cast<size_t>(xRank));
|
|
248
|
+
for (int64_t i = 0; i < xRank; ++i) {
|
|
249
|
+
ctx.reduceAxes[static_cast<size_t>(i)] = i;
|
|
250
|
+
}
|
|
251
|
+
return ge::GRAPH_SUCCESS;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const char* nodeName = context->GetNodeName();
|
|
255
|
+
std::set<int64_t> seen;
|
|
256
|
+
const ge::DataType dt = axesTensor->GetDataType();
|
|
257
|
+
if (dt == ge::DT_INT32) {
|
|
258
|
+
const int32_t* data = axesTensor->GetData<int32_t>();
|
|
259
|
+
OP_CHECK_IF(
|
|
260
|
+
data == nullptr,
|
|
261
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(nodeName, "axes", "axes const tensor data ptr is null (int32)"),
|
|
262
|
+
return ge::GRAPH_FAILED);
|
|
263
|
+
if (!LoadAxesLoop<int32_t>(nodeName, data, axesNum, xRank, seen, ctx.reduceAxes)) {
|
|
264
|
+
return ge::GRAPH_FAILED; // 失败细节已在 LoadAxesLoop 内打 ERROR
|
|
265
|
+
}
|
|
266
|
+
} else if (dt == ge::DT_INT64) {
|
|
267
|
+
const int64_t* data = axesTensor->GetData<int64_t>();
|
|
268
|
+
OP_CHECK_IF(
|
|
269
|
+
data == nullptr,
|
|
270
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(nodeName, "axes", "axes const tensor data ptr is null (int64)"),
|
|
271
|
+
return ge::GRAPH_FAILED);
|
|
272
|
+
if (!LoadAxesLoop<int64_t>(nodeName, data, axesNum, xRank, seen, ctx.reduceAxes)) {
|
|
273
|
+
return ge::GRAPH_FAILED; // 失败细节已在 LoadAxesLoop 内打 ERROR
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
OP_LOGE_FOR_INVALID_DTYPE_WITH_REASON(nodeName, "axes", ge::TypeUtils::DataTypeToSerialString(dt).c_str(),
|
|
277
|
+
"only int32/int64 are supported");
|
|
278
|
+
return ge::GRAPH_FAILED;
|
|
279
|
+
}
|
|
280
|
+
std::sort(ctx.reduceAxes.begin(), ctx.reduceAxes.end());
|
|
281
|
+
return ge::GRAPH_SUCCESS;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// 初始化轴列表:axisShape 拷贝 xShape,按 reduceAxes 给各轴打 R(归约轴)标记,其余为 A(保留轴)。
|
|
285
|
+
// 在 ClassifyEmptyTensor 之前执行,使空分类能在原始轴语义上判零维。
|
|
286
|
+
static void BuildInitialAxisList(EuclideanNormCtx& ctx)
|
|
287
|
+
{
|
|
288
|
+
const size_t rank = ctx.xShape.size();
|
|
289
|
+
ctx.axisShape = ctx.xShape;
|
|
290
|
+
ctx.isReduceAxis.assign(rank, false);
|
|
291
|
+
for (int64_t reduceAxis : ctx.reduceAxes) {
|
|
292
|
+
ctx.isReduceAxis[static_cast<size_t>(reduceAxis)] = true;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// A/R 规整第 1 步(共 4 步,顺序不可换):删除所有 size-1 轴(对归约数值无贡献;
|
|
297
|
+
// A=1 不影响输出、R=1 退化为 |x|);全删空则保留 [A1] 占位。
|
|
298
|
+
static void DropSizeOneAxes(EuclideanNormCtx& ctx)
|
|
299
|
+
{
|
|
300
|
+
std::vector<int64_t> newShape;
|
|
301
|
+
std::vector<bool> newIsR;
|
|
302
|
+
for (size_t i = 0; i < ctx.axisShape.size(); ++i) {
|
|
303
|
+
if (ctx.axisShape[i] != 1) {
|
|
304
|
+
newShape.push_back(ctx.axisShape[i]);
|
|
305
|
+
newIsR.push_back(ctx.isReduceAxis[i]);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (newShape.empty()) {
|
|
309
|
+
newShape.push_back(1);
|
|
310
|
+
newIsR.push_back(false);
|
|
311
|
+
}
|
|
312
|
+
ctx.axisShape = std::move(newShape);
|
|
313
|
+
ctx.isReduceAxis = std::move(newIsR);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// A/R 规整第 2 步:相邻同类型轴(同 A 或同 R)乘积合并——A 合并 = 输出维乘积、
|
|
317
|
+
// R 合并 = 归约长度乘积(ND 连续布局下数值等价),压缩为最短交替模式。
|
|
318
|
+
static void FuseAxis(EuclideanNormCtx& ctx)
|
|
319
|
+
{
|
|
320
|
+
std::vector<int64_t> fusedShape;
|
|
321
|
+
std::vector<bool> fusedIsR;
|
|
322
|
+
for (size_t i = 0; i < ctx.axisShape.size(); ++i) {
|
|
323
|
+
if (!fusedShape.empty() && fusedIsR.back() == ctx.isReduceAxis[i]) {
|
|
324
|
+
fusedShape.back() *= ctx.axisShape[i];
|
|
325
|
+
} else {
|
|
326
|
+
fusedShape.push_back(ctx.axisShape[i]);
|
|
327
|
+
fusedIsR.push_back(ctx.isReduceAxis[i]);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
ctx.axisShape = std::move(fusedShape);
|
|
331
|
+
ctx.isReduceAxis = std::move(fusedIsR);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// A/R 规整第 3 步:首轴为 R 时在最前补一根 size-1 的 A 轴,保证模式以 A 起头
|
|
335
|
+
// (偶位 A / 奇位 R 下标不变量的前提)。
|
|
336
|
+
static void PadLeadingOneA(EuclideanNormCtx& ctx)
|
|
337
|
+
{
|
|
338
|
+
if (!ctx.axisShape.empty() && ctx.isReduceAxis.front()) {
|
|
339
|
+
ctx.axisShape.insert(ctx.axisShape.begin(), 1);
|
|
340
|
+
ctx.isReduceAxis.insert(ctx.isReduceAxis.begin(), false);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// A/R 规整第 4 步:纯 A 退化(无 R 轴)时补 R——全 1 退化 [A1] 末尾补 R=1(成 tail-R);
|
|
345
|
+
// 其余前置 [A1, R1](成 tail-A,保持最内轴为 A 的内存连续性——禁止末尾补 R=1,
|
|
346
|
+
// 否则最内轴变成长度 1 的 R,每 A 元素独占 1 元素 burst,搬运效率崩塌)。
|
|
347
|
+
static void PadRIfPureA(EuclideanNormCtx& ctx)
|
|
348
|
+
{
|
|
349
|
+
bool hasR = false;
|
|
350
|
+
for (bool isReduce : ctx.isReduceAxis) {
|
|
351
|
+
if (isReduce) {
|
|
352
|
+
hasR = true;
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (!hasR) {
|
|
357
|
+
if (ctx.axisShape.size() == 1 && ctx.axisShape[0] == 1) {
|
|
358
|
+
ctx.axisShape.push_back(1);
|
|
359
|
+
ctx.isReduceAxis.push_back(true);
|
|
360
|
+
} else {
|
|
361
|
+
ctx.axisShape.insert(ctx.axisShape.begin(), {1, 1});
|
|
362
|
+
ctx.isReduceAxis.insert(ctx.isReduceAxis.begin(), {false, true});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// 空 tensor 三分类(在原始 shape 上扫描零维,先于规整执行以免合轴/预算退化):
|
|
368
|
+
// A 轴含 0 → EMPTY_A(输出 0 元素);仅 R 轴含 0 → EMPTY_R(空归约 sum=0 → 每输出 = sqrt(0) = 0,
|
|
369
|
+
// aTotalEmpty = 非零 A 轴乘积 = 输出元素数);否则 NORMAL 走主 tiling 路径。
|
|
370
|
+
static void ClassifyEmptyTensor(EuclideanNormCtx& ctx)
|
|
371
|
+
{
|
|
372
|
+
bool hasZeroA = false;
|
|
373
|
+
bool hasZeroR = false;
|
|
374
|
+
int64_t aTotal = 1;
|
|
375
|
+
for (size_t i = 0; i < ctx.xShape.size(); ++i) {
|
|
376
|
+
const bool isR = ctx.isReduceAxis[i];
|
|
377
|
+
const int64_t sz = ctx.xShape[i];
|
|
378
|
+
if (!isR) {
|
|
379
|
+
if (sz == 0) {
|
|
380
|
+
hasZeroA = true;
|
|
381
|
+
} else {
|
|
382
|
+
aTotal *= sz;
|
|
383
|
+
}
|
|
384
|
+
} else {
|
|
385
|
+
if (sz == 0) {
|
|
386
|
+
hasZeroR = true;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (hasZeroA) {
|
|
391
|
+
ctx.emptyKind = EuclideanNormEmptyKind::EMPTY_A;
|
|
392
|
+
ctx.aTotalEmpty = 0;
|
|
393
|
+
} else if (hasZeroR) {
|
|
394
|
+
ctx.emptyKind = EuclideanNormEmptyKind::EMPTY_R;
|
|
395
|
+
ctx.aTotalEmpty = aTotal;
|
|
396
|
+
} else {
|
|
397
|
+
ctx.emptyKind = EuclideanNormEmptyKind::NORMAL;
|
|
398
|
+
ctx.aTotalEmpty = 0;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// A/R 规整总装(仅 NORMAL 路径):依次执行去 1 → 合轴 → 补 leading A → 补 R 增广,
|
|
403
|
+
// 校验 axisNum ∈ [MIN_AXIS_NUM, MAX_AXIS_NUM] 与"偶位 A / 奇位 R"不变量(防御性自检),
|
|
404
|
+
// 按轴数奇偶定 isTailR:偶数轴 → tail-R(最内轴为 R),奇数轴 → tail-A。
|
|
405
|
+
static ge::graphStatus PreprocessPattern(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
406
|
+
{
|
|
407
|
+
DropSizeOneAxes(ctx);
|
|
408
|
+
FuseAxis(ctx);
|
|
409
|
+
PadLeadingOneA(ctx);
|
|
410
|
+
PadRIfPureA(ctx);
|
|
411
|
+
|
|
412
|
+
ctx.axisNum = static_cast<int32_t>(ctx.axisShape.size());
|
|
413
|
+
OP_CHECK_IF(ctx.axisNum < MIN_AXIS_NUM || ctx.axisNum > MAX_AXIS_NUM,
|
|
414
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(
|
|
415
|
+
context->GetNodeName(), "axisNum",
|
|
416
|
+
"after A/R pattern regularization, axisNum=" + std::to_string(ctx.axisNum) + " out of [" +
|
|
417
|
+
std::to_string(MIN_AXIS_NUM) + ", " + std::to_string(MAX_AXIS_NUM) + "]"),
|
|
418
|
+
return ge::GRAPH_FAILED);
|
|
419
|
+
|
|
420
|
+
for (int32_t i = 0; i < ctx.axisNum; ++i) {
|
|
421
|
+
const bool wantR = (i % AXIS_INTERVAL == 1);
|
|
422
|
+
OP_CHECK_IF(ctx.isReduceAxis[static_cast<size_t>(i)] != wantR,
|
|
423
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(context->GetNodeName(), "isReduceAxis",
|
|
424
|
+
"axis[" + std::to_string(i) +
|
|
425
|
+
"] type mismatch after A/R regularization "
|
|
426
|
+
"(expected alternating [A,R] pattern)"),
|
|
427
|
+
return ge::GRAPH_FAILED);
|
|
428
|
+
}
|
|
429
|
+
ctx.isTailR = (ctx.axisNum % AXIS_INTERVAL == 0);
|
|
430
|
+
std::string axisStr = "[";
|
|
431
|
+
for (int32_t i = 0; i < ctx.axisNum; ++i) {
|
|
432
|
+
if (i > 0) {
|
|
433
|
+
axisStr += ", ";
|
|
434
|
+
}
|
|
435
|
+
axisStr += std::to_string(ctx.axisShape[static_cast<size_t>(i)]);
|
|
436
|
+
axisStr += ctx.isReduceAxis[static_cast<size_t>(i)] ? "(R)" : "(A)";
|
|
437
|
+
}
|
|
438
|
+
axisStr += "]";
|
|
439
|
+
OP_LOGD(context->GetNodeName(), "PreprocessPattern: axisNum=%d isTailR=%d axes=%s", ctx.axisNum,
|
|
440
|
+
static_cast<int>(ctx.isTailR), axisStr.c_str());
|
|
441
|
+
return ge::GRAPH_SUCCESS;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// 计算规整后各轴在输入 GM 上的步长:stride[i] = ∏_{j>i} axisShape[j]
|
|
445
|
+
// (ND 连续布局,最内轴 stride=1),供 kernel 侧 Unravel 解码 GM 偏移。
|
|
446
|
+
static void ComputeAxisStrides(const EuclideanNormCtx& ctx, int64_t outStride[])
|
|
447
|
+
{
|
|
448
|
+
int64_t strideAcc = 1;
|
|
449
|
+
for (int32_t i = ctx.axisNum - 1; i >= 0; --i) {
|
|
450
|
+
outStride[i] = strideAcc;
|
|
451
|
+
strideAcc *= ctx.axisShape[static_cast<size_t>(i)];
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// 返回最后一个 A 轴(最大偶下标)的位置;规整后恒存在,兜底返回 0(防御)。
|
|
456
|
+
static int32_t LastAAxisIdx(const EuclideanNormCtx& ctx)
|
|
457
|
+
{
|
|
458
|
+
for (int32_t i = ctx.axisNum - 1; i >= 0; --i) {
|
|
459
|
+
if (i % AXIS_INTERVAL == 0) {
|
|
460
|
+
return i;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
return 0;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// 返回最后一个 R 轴(最大奇下标)的位置;规整后恒存在,兜底返回 1(防御)。
|
|
467
|
+
static int32_t LastRAxisIdx(const EuclideanNormCtx& ctx)
|
|
468
|
+
{
|
|
469
|
+
for (int32_t i = ctx.axisNum - 1; i >= 0; --i) {
|
|
470
|
+
if (i % AXIS_INTERVAL == 1) {
|
|
471
|
+
return i;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
return 1;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// 计算全部 A 轴长度乘积 = 输出元素总数 aTotal(Group workspace 列数 / 扩 A 上限)。
|
|
478
|
+
static int64_t TotalAProd(const EuclideanNormCtx& ctx)
|
|
479
|
+
{
|
|
480
|
+
int64_t total = 1;
|
|
481
|
+
for (int32_t i = 0; i < ctx.axisNum; i += AXIS_INTERVAL) {
|
|
482
|
+
total *= ctx.axisShape[static_cast<size_t>(i)];
|
|
483
|
+
}
|
|
484
|
+
return total;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// 计算 aSplitIdx 内侧 A 轴的对齐乘积 innerAProdAlign:仅 tail-A 的最内 A 轴(搬运 burst 轴)
|
|
488
|
+
// 按 32B 元素数(bsElem)向上对齐,其余轴原值累乘;aSplit 变化后需重算。
|
|
489
|
+
static void ComputeInnerAProdAlign(EuclideanNormCtx& ctx)
|
|
490
|
+
{
|
|
491
|
+
const int64_t bsElem = ctx.blockSize / ctx.dtypeSize;
|
|
492
|
+
ctx.innerAProdAlign = 1;
|
|
493
|
+
for (int32_t k = ctx.aSplitIdx + AXIS_INTERVAL; k < ctx.axisNum; k += AXIS_INTERVAL) {
|
|
494
|
+
if (k == ctx.axisNum - 1 && !ctx.isTailR) {
|
|
495
|
+
ctx.innerAProdAlign *= Ops::Base::CeilAlign(ctx.axisShape[static_cast<size_t>(k)], bsElem);
|
|
496
|
+
} else {
|
|
497
|
+
ctx.innerAProdAlign *= ctx.axisShape[static_cast<size_t>(k)];
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// UB 切分 Step 1:以 1 条 cache line 为初始预算确定 A 切分(aSplitIdx / aUbFactor),
|
|
503
|
+
// 使 A 单元(aUbFactor × innerAProdAlign)驻留单条 cache line(Reduce 主循环热数据局部性)。
|
|
504
|
+
// 从最内轴向外逐轴累乘,超预算即停:停在 A 轴 → 按剩余预算切该轴 chunk;
|
|
505
|
+
// 停在 R 轴 → 退到外侧 A 轴、因子 1;全部装得下 → 不切(aSplitIdx=0)。
|
|
506
|
+
static void ComputeAUbFactor(EuclideanNormCtx& ctx)
|
|
507
|
+
{
|
|
508
|
+
const int64_t bsElem = ctx.blockSize / ctx.dtypeSize;
|
|
509
|
+
const int64_t maxInnerAInitElem = ctx.cacheLineSize / ctx.dtypeSize;
|
|
510
|
+
const int64_t cachelineTmp = (maxInnerAInitElem / bsElem) * bsElem;
|
|
511
|
+
|
|
512
|
+
int64_t product = 1;
|
|
513
|
+
int32_t idx = ctx.axisNum - 1;
|
|
514
|
+
while (idx >= 0) {
|
|
515
|
+
int64_t axisSize = (idx == ctx.axisNum - 1) ?
|
|
516
|
+
Ops::Base::CeilAlign(ctx.axisShape[static_cast<size_t>(idx)], bsElem) :
|
|
517
|
+
ctx.axisShape[static_cast<size_t>(idx)];
|
|
518
|
+
if (product * axisSize > cachelineTmp) {
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
product *= axisSize;
|
|
522
|
+
idx--;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (idx < 0) {
|
|
526
|
+
ctx.aSplitIdx = 0;
|
|
527
|
+
ctx.aUbFactor = ctx.axisShape[0];
|
|
528
|
+
} else if (idx % AXIS_INTERVAL == 0) {
|
|
529
|
+
ctx.aSplitIdx = idx;
|
|
530
|
+
ctx.aUbFactor = std::min(cachelineTmp / product, ctx.axisShape[static_cast<size_t>(idx)]);
|
|
531
|
+
ctx.aUbFactor = std::max<int64_t>(ctx.aUbFactor, 1);
|
|
532
|
+
} else {
|
|
533
|
+
ctx.aSplitIdx = idx - 1;
|
|
534
|
+
ctx.aUbFactor = 1;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
ComputeInnerAProdAlign(ctx);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// 反解单次 R 迭代可用元素上限 rIMax(UB 预算不等式的逆):
|
|
541
|
+
// (ubSize − 16KB cacheBuf − outBuf) / (3 个 pre buffer × aUnit × maxDtypeSize);
|
|
542
|
+
// aUnit 非法或预算不足时返回 -1(由调用方报 TILING_FAIL)。
|
|
543
|
+
static int64_t ComputeRiMax(const EuclideanNormCtx& ctx)
|
|
544
|
+
{
|
|
545
|
+
const int64_t ubAvailable = ctx.ubSize - CACHE_BUF_BYTES;
|
|
546
|
+
const int64_t aUnit = ctx.aUbFactor * ctx.innerAProdAlign;
|
|
547
|
+
const int64_t postBufSize = Ops::Base::CeilAlign(aUnit * ctx.maxDtypeSize, ctx.blockSize);
|
|
548
|
+
const int64_t aOnlyBytes = P_POST * postBufSize;
|
|
549
|
+
const int64_t bytesPerRElem = (P_PRE + P_PRE_EXT) * aUnit * ctx.maxDtypeSize;
|
|
550
|
+
if (aUnit <= 0 || bytesPerRElem <= 0) {
|
|
551
|
+
return -1;
|
|
552
|
+
}
|
|
553
|
+
const int64_t numer = ubAvailable - aOnlyBytes;
|
|
554
|
+
if (numer <= 0) {
|
|
555
|
+
return -1;
|
|
556
|
+
}
|
|
557
|
+
return numer / bytesPerRElem;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// UB 切分 Step 2:在 rIMax 预算内从最内 R 轴向外吸收 R 轴(得 innerRProdAlign 与 rSplitIdx),
|
|
561
|
+
// 再定 rUbFactor;切在最内 R 轴(isTailR 且 rSplitIdx==lastR)时做 32B burst 对齐得
|
|
562
|
+
// rUbFactorAlign——全载 CeilAlign / 部分 FloorAlign(对齐到 0 报错),对齐后超预算回退
|
|
563
|
+
// FloorAlign(无条件 FloorAlign 会误判 TILING_FAIL);actual 与 padded 之差由 kernel 侧清零兜底。
|
|
564
|
+
static ge::graphStatus ComputeRUbFactor(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
565
|
+
{
|
|
566
|
+
const int32_t lastR = LastRAxisIdx(ctx);
|
|
567
|
+
const int64_t rIMax = ComputeRiMax(ctx);
|
|
568
|
+
OP_CHECK_IF(rIMax < 1,
|
|
569
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(
|
|
570
|
+
context->GetNodeName(), "rIMax",
|
|
571
|
+
"R_i_max=" + std::to_string(rIMax) + " < 1 (aUbFactor=" + std::to_string(ctx.aUbFactor) +
|
|
572
|
+
", innerAProdAlign=" + std::to_string(ctx.innerAProdAlign) + ")"),
|
|
573
|
+
return ge::GRAPH_FAILED);
|
|
574
|
+
|
|
575
|
+
const int64_t bsElem = ctx.blockSize / ctx.dtypeSize;
|
|
576
|
+
ctx.innerRProdAlign = 1;
|
|
577
|
+
ctx.rSplitIdx = lastR;
|
|
578
|
+
while (ctx.rSplitIdx > 1) {
|
|
579
|
+
int64_t axisSize = (ctx.rSplitIdx == lastR && ctx.isTailR) ?
|
|
580
|
+
Ops::Base::CeilAlign(ctx.axisShape[static_cast<size_t>(ctx.rSplitIdx)], bsElem) :
|
|
581
|
+
ctx.axisShape[static_cast<size_t>(ctx.rSplitIdx)];
|
|
582
|
+
if (axisSize * ctx.innerRProdAlign > rIMax) {
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
ctx.innerRProdAlign *= axisSize;
|
|
586
|
+
ctx.rSplitIdx -= AXIS_INTERVAL;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
const int64_t rAxisSize = ctx.axisShape[static_cast<size_t>(ctx.rSplitIdx)];
|
|
590
|
+
ctx.rUbFactor = std::min(rIMax / ctx.innerRProdAlign, rAxisSize);
|
|
591
|
+
ctx.rUbFactor = std::max<int64_t>(ctx.rUbFactor, 1);
|
|
592
|
+
|
|
593
|
+
const bool isBurstTailR = (ctx.isTailR && ctx.rSplitIdx == lastR);
|
|
594
|
+
if (isBurstTailR) {
|
|
595
|
+
if (ctx.rUbFactor < rAxisSize) {
|
|
596
|
+
ctx.rUbFactor = Ops::Base::FloorAlign(ctx.rUbFactor, bsElem);
|
|
597
|
+
OP_CHECK_IF(
|
|
598
|
+
ctx.rUbFactor == 0,
|
|
599
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(context->GetNodeName(), "rUbFactor",
|
|
600
|
+
"rUbFactor floor-aligned to 0 (tail-R burst alignment)"),
|
|
601
|
+
return ge::GRAPH_FAILED);
|
|
602
|
+
ctx.rUbFactorAlign = ctx.rUbFactor;
|
|
603
|
+
} else {
|
|
604
|
+
ctx.rUbFactorAlign = Ops::Base::CeilAlign(ctx.rUbFactor, bsElem);
|
|
605
|
+
if (ctx.rUbFactorAlign * ctx.innerRProdAlign > rIMax) {
|
|
606
|
+
ctx.rUbFactor = Ops::Base::FloorAlign(ctx.rUbFactor, bsElem);
|
|
607
|
+
OP_CHECK_IF(ctx.rUbFactor == 0,
|
|
608
|
+
OP_LOGE_FOR_INVALID_ARGUMENT_WITH_REASON(
|
|
609
|
+
context->GetNodeName(), "rUbFactor",
|
|
610
|
+
"rUbFactor floor-aligned to 0 (retry after CeilAlign overflow)"),
|
|
611
|
+
return ge::GRAPH_FAILED);
|
|
612
|
+
ctx.rUbFactorAlign = ctx.rUbFactor;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
ctx.rUbFactorAlign = ctx.rUbFactor;
|
|
617
|
+
}
|
|
618
|
+
OP_LOGD(context->GetNodeName(),
|
|
619
|
+
"ComputeRUbFactor: rSplitIdx=%d rUbFactor=%ld rUbFactorAlign=%ld innerRProdAlign=%ld", ctx.rSplitIdx,
|
|
620
|
+
ctx.rUbFactor, ctx.rUbFactorAlign, ctx.innerRProdAlign);
|
|
621
|
+
return ge::GRAPH_SUCCESS;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// 判定整个 R 空间是否单次迭代全载:rUbFactor 占满 rSplit 轴长度,且 rSplitIdx 外侧无 R 轴
|
|
625
|
+
// (即 rLoopCntTotal 将为 1)——全载时才值得把剩余 UB 让给 A。
|
|
626
|
+
static bool RIsFullyLoaded(const EuclideanNormCtx& ctx)
|
|
627
|
+
{
|
|
628
|
+
if (ctx.rUbFactor != ctx.axisShape[static_cast<size_t>(ctx.rSplitIdx)]) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
for (int32_t i = ctx.rSplitIdx - 1; i >= 0; --i) {
|
|
632
|
+
if (i % AXIS_INTERVAL == 1) {
|
|
633
|
+
return false;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
return true;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// R 全载时把 UB 预算反解为 A 上限:每 A lane 耗 3×rPadded 个 pre 元素 + 1 个 out 元素,
|
|
640
|
+
// aUnitMax = ubAvailable / (3 × rPaddedElems × maxDtypeSize + maxDtypeSize);预算非法返回 -1。
|
|
641
|
+
static int64_t SolveAUnitMax(const EuclideanNormCtx& ctx)
|
|
642
|
+
{
|
|
643
|
+
const int64_t ubAvailable = ctx.ubSize - CACHE_BUF_BYTES;
|
|
644
|
+
const int64_t rPaddedElems = ctx.rUbFactorAlign * ctx.innerRProdAlign;
|
|
645
|
+
const int64_t coeff = (P_PRE + P_PRE_EXT) * rPaddedElems * ctx.maxDtypeSize + P_POST * ctx.maxDtypeSize;
|
|
646
|
+
if (coeff <= 0) {
|
|
647
|
+
return -1;
|
|
648
|
+
}
|
|
649
|
+
return ubAvailable / coeff;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// UB 切分 Step 3:R 全载时用剩余 UB 扩张 A 单元,减少 A 迭代次数。
|
|
653
|
+
// aUnitMax 受三重约束:UB 反解值 / totalA / cacheBuf 行宽上限(16KB÷4 = 4096,cacheBuf 硬约束);
|
|
654
|
+
// tail-A 时按 32B 元素数向下对齐(最内 A 轴是 burst 轴);从 lastA 向内重新累积定
|
|
655
|
+
// aSplitIdx / aUbFactor 并重算 innerAProdAlign;无利可图(≤ 当前值)则保持不变。
|
|
656
|
+
static ge::graphStatus ExpandAIfRFullyLoaded(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
657
|
+
{
|
|
658
|
+
if (!RIsFullyLoaded(ctx)) {
|
|
659
|
+
return ge::GRAPH_SUCCESS;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const int64_t bsElem = ctx.blockSize / ctx.dtypeSize;
|
|
663
|
+
const int64_t cacheLaneLimit = CACHE_BUF_BYTES / FP32_BYTES;
|
|
664
|
+
int64_t totalA = TotalAProd(ctx);
|
|
665
|
+
|
|
666
|
+
int64_t aUnitMax = std::min(SolveAUnitMax(ctx), totalA);
|
|
667
|
+
aUnitMax = std::min(aUnitMax, cacheLaneLimit);
|
|
668
|
+
if (!ctx.isTailR) {
|
|
669
|
+
aUnitMax = Ops::Base::FloorAlign(aUnitMax, bsElem);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
const int64_t curAUnit = ctx.aUbFactor * ctx.innerAProdAlign;
|
|
673
|
+
if (aUnitMax <= curAUnit) {
|
|
674
|
+
return ge::GRAPH_SUCCESS;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
int64_t product = 1;
|
|
678
|
+
int32_t idx = LastAAxisIdx(ctx);
|
|
679
|
+
while (idx >= 0) {
|
|
680
|
+
int64_t axisSize = (idx == ctx.axisNum - 1 && !ctx.isTailR) ?
|
|
681
|
+
Ops::Base::CeilAlign(ctx.axisShape[static_cast<size_t>(idx)], bsElem) :
|
|
682
|
+
ctx.axisShape[static_cast<size_t>(idx)];
|
|
683
|
+
if (product * axisSize > aUnitMax) {
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
product *= axisSize;
|
|
687
|
+
idx -= AXIS_INTERVAL;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
if (idx < 0) {
|
|
691
|
+
ctx.aSplitIdx = 0;
|
|
692
|
+
ctx.aUbFactor = ctx.axisShape[0];
|
|
693
|
+
} else {
|
|
694
|
+
ctx.aSplitIdx = idx;
|
|
695
|
+
ctx.aUbFactor = std::min(aUnitMax / product, ctx.axisShape[static_cast<size_t>(idx)]);
|
|
696
|
+
ctx.aUbFactor = std::max<int64_t>(ctx.aUbFactor, 1);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
ComputeInnerAProdAlign(ctx);
|
|
700
|
+
OP_LOGD(context->GetNodeName(), "ExpandAIfRFullyLoaded: triggered, aSplitIdx=%d aUbFactor=%ld innerAProdAlign=%ld",
|
|
701
|
+
ctx.aSplitIdx, ctx.aUbFactor, ctx.innerAProdAlign);
|
|
702
|
+
return ge::GRAPH_SUCCESS;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// A 方向多核切分:aLoopCntTotal = aSplitIdx 外侧 A 轴乘积 × 切分轴 chunk 数(外层 A 轴
|
|
706
|
+
// 视作一个混合进制循环,即 "fused");按核数做大小核均分——前 aLoopCntTotal%coreNum 个核
|
|
707
|
+
// 多干 1 轮;usedCoreNum = 全核(小核轮数>0)或仅大核数。迭代-核映射固定,保证
|
|
708
|
+
// bitwise_reproducible。
|
|
709
|
+
static void ComputeFusedALoopSplit(EuclideanNormCtx& ctx)
|
|
710
|
+
{
|
|
711
|
+
int64_t outerAProd = 1;
|
|
712
|
+
for (int32_t i = 0; i < ctx.aSplitIdx; i += AXIS_INTERVAL) {
|
|
713
|
+
outerAProd *= ctx.axisShape[static_cast<size_t>(i)];
|
|
714
|
+
}
|
|
715
|
+
const int64_t aSplitAxisSize = ctx.axisShape[static_cast<size_t>(ctx.aSplitIdx)];
|
|
716
|
+
ctx.aSplitChunkCnt = Ops::Base::CeilDiv(aSplitAxisSize, ctx.aUbFactor);
|
|
717
|
+
ctx.aLoopCntTotal = outerAProd * ctx.aSplitChunkCnt;
|
|
718
|
+
|
|
719
|
+
ctx.aSmallCoreLoopCnt = ctx.aLoopCntTotal / ctx.coreNum;
|
|
720
|
+
ctx.aBigCoreCnt = static_cast<int32_t>(ctx.aLoopCntTotal % ctx.coreNum);
|
|
721
|
+
ctx.aBigCoreLoopCnt = ctx.aSmallCoreLoopCnt + (ctx.aBigCoreCnt > 0 ? 1 : 0);
|
|
722
|
+
ctx.usedCoreNum = (ctx.aSmallCoreLoopCnt > 0) ? static_cast<int32_t>(ctx.coreNum) : ctx.aBigCoreCnt;
|
|
723
|
+
ctx.usedCoreNum = std::max(ctx.usedCoreNum, 1);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// R 方向总迭代数:rLoopCntTotal = rSplitIdx 外侧 R 轴乘积 × CeilDiv(切分轴长, rUbFactor);
|
|
727
|
+
// 供 kernel Init 推导二分树参数(bisectionPos/Tail/cacheCount)与 Group 触发判定。
|
|
728
|
+
static void ComputeRLoopCnt(EuclideanNormCtx& ctx)
|
|
729
|
+
{
|
|
730
|
+
int64_t outerR = 1;
|
|
731
|
+
for (int32_t i = 1; i < ctx.rSplitIdx; i += AXIS_INTERVAL) {
|
|
732
|
+
outerR *= ctx.axisShape[static_cast<size_t>(i)];
|
|
733
|
+
}
|
|
734
|
+
const int64_t rChunks = Ops::Base::CeilDiv(ctx.axisShape[static_cast<size_t>(ctx.rSplitIdx)], ctx.rUbFactor);
|
|
735
|
+
ctx.rLoopCntTotal = outerR * rChunks;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// 计算 UB buffer 尺寸:preBufSize = aUnit × rPaddedElems × maxDtypeSize
|
|
739
|
+
// (preIn / preRes / preResTail 三个 buffer 同尺寸,统一按 maxDtypeSize 预算,b16 也按 4B 计);
|
|
740
|
+
// postBufSize = CeilAlign(aUnit × maxDtypeSize, 32B)。
|
|
741
|
+
static void ComputeUbSizes(EuclideanNormCtx& ctx)
|
|
742
|
+
{
|
|
743
|
+
const int64_t aUnit = ctx.aUbFactor * ctx.innerAProdAlign;
|
|
744
|
+
const int64_t rPaddedElems = ctx.rUbFactorAlign * ctx.innerRProdAlign;
|
|
745
|
+
ctx.preBufSize = aUnit * rPaddedElems * ctx.maxDtypeSize;
|
|
746
|
+
ctx.postBufSize = Ops::Base::CeilAlign(aUnit * ctx.maxDtypeSize, ctx.blockSize);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// Group 2D 分核触发判定:A 迭代总数 ≤ 核数/GROUP_CORE_RATIO(A 方向并行度吃不满半数核)
|
|
750
|
+
// 且 R 迭代数 > 1(R 方向有多轮迭代可切)——半数核闲置且 R 有并行度时才值得 2D 分核。
|
|
751
|
+
static bool ShouldUseGroup(const EuclideanNormCtx& ctx)
|
|
752
|
+
{
|
|
753
|
+
if (ctx.aLoopCntTotal > ctx.coreNum / GROUP_CORE_RATIO) {
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
if (ctx.rLoopCntTotal <= 1) {
|
|
757
|
+
return false;
|
|
758
|
+
}
|
|
759
|
+
return true;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// Group 2D 分核参数:totalOuter = aLoopCntTotal × rLoopCntTotal 按核均分得 numBlocks,
|
|
763
|
+
// 再把 numBlocks 对齐到 aLoopCntTotal 的整数倍(CeilAlign 超核数则 FloorAlign)——保证每核
|
|
764
|
+
// = 整数个完整 A chunk × 一段完整 R 区间(Phase1 核号分解 blockIdx = aChunkIdx×rGroupCnt +
|
|
765
|
+
// rChunkIdx 依赖此性质);得 usedCoreNum 与 rGroupCnt(R 分组数 = Phase2 workspace 行数)。
|
|
766
|
+
static void ComputeGroupSplit(EuclideanNormCtx& ctx)
|
|
767
|
+
{
|
|
768
|
+
int64_t totalOuter = ctx.aLoopCntTotal * ctx.rLoopCntTotal;
|
|
769
|
+
int64_t perCoreNum = Ops::Base::CeilDiv(totalOuter, ctx.coreNum);
|
|
770
|
+
int64_t numBlocks = Ops::Base::CeilDiv(totalOuter, perCoreNum);
|
|
771
|
+
|
|
772
|
+
if (Ops::Base::CeilAlign(numBlocks, ctx.aLoopCntTotal) <= ctx.coreNum) {
|
|
773
|
+
numBlocks = Ops::Base::CeilAlign(numBlocks, ctx.aLoopCntTotal);
|
|
774
|
+
} else {
|
|
775
|
+
numBlocks = Ops::Base::FloorAlign(numBlocks, ctx.aLoopCntTotal);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
ctx.usedCoreNum = static_cast<int32_t>(numBlocks);
|
|
779
|
+
ctx.rGroupCnt = numBlocks / ctx.aLoopCntTotal;
|
|
780
|
+
ctx.isGroup = true;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// 申报 workspace 大小:Group 时用户 workspace = rGroupCnt × aTotal × sizeof(float)
|
|
784
|
+
// ([rGroupCnt 行, aTotal 列] fp32 行优先 dense 部分和矩阵,Phase1 写入 / Phase2 RA 归约读出),
|
|
785
|
+
// 叠加系统 workspace(GetLibApiWorkSpaceSize);normal / empty 仅需系统部分。
|
|
786
|
+
static ge::graphStatus SetWorkspaceSize(gert::TilingContext* context, const EuclideanNormCtx& ctx)
|
|
787
|
+
{
|
|
788
|
+
size_t* ws = context->GetWorkspaceSizes(1);
|
|
789
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, ws);
|
|
790
|
+
size_t usrSize = 0;
|
|
791
|
+
if (ctx.isGroup) {
|
|
792
|
+
int64_t aTotal = TotalAProd(ctx);
|
|
793
|
+
usrSize = static_cast<size_t>(ctx.rGroupCnt) * static_cast<size_t>(aTotal) * sizeof(float);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
|
|
797
|
+
size_t sysWorkspaceSize = ascendcPlatform.GetLibApiWorkSpaceSize();
|
|
798
|
+
ws[0] = usrSize + sysWorkspaceSize;
|
|
799
|
+
OP_LOGI(context, "Set ws size:%lu, usrSize:%lu", ws[0], usrSize);
|
|
800
|
+
return ge::GRAPH_SUCCESS;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
// 把 ctx 全量写入 EuclideanNormTilingData:memset_s 清零后逐字段填充(未用轴槽
|
|
804
|
+
// axisShape=1 / axisStride=0,定长数组约定),cacheBufUbSize 直填固定 16KB;
|
|
805
|
+
// axisStride 现场由 ComputeAxisStrides 计算;随后打全量 INFO 日志(pattern / 切分 / 多核参数)。
|
|
806
|
+
static ge::graphStatus FillAndLogTilingData(gert::TilingContext* context, const EuclideanNormCtx& ctx)
|
|
807
|
+
{
|
|
808
|
+
EuclideanNormTilingData* td = context->GetTilingData<EuclideanNormTilingData>();
|
|
809
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, td);
|
|
810
|
+
OP_CHECK_IF(memset_s(td, sizeof(EuclideanNormTilingData), 0, sizeof(EuclideanNormTilingData)) != EOK,
|
|
811
|
+
OP_LOGE(context, "Memset tilingdata error"), return ge::GRAPH_FAILED);
|
|
812
|
+
|
|
813
|
+
int64_t axisStride[MAX_PATTERN_RANK] = {0};
|
|
814
|
+
ComputeAxisStrides(ctx, axisStride);
|
|
815
|
+
|
|
816
|
+
td->axisNum = ctx.axisNum;
|
|
817
|
+
for (int32_t i = 0; i < MAX_PATTERN_RANK; ++i) {
|
|
818
|
+
td->axisShape[i] = (i < ctx.axisNum) ? ctx.axisShape[static_cast<size_t>(i)] : 1;
|
|
819
|
+
td->axisStride[i] = (i < ctx.axisNum) ? axisStride[i] : 0;
|
|
820
|
+
}
|
|
821
|
+
td->aLoopCntTotal = ctx.aLoopCntTotal;
|
|
822
|
+
td->aSplitChunkCnt = ctx.aSplitChunkCnt;
|
|
823
|
+
td->aBigCoreLoopCnt = ctx.aBigCoreLoopCnt;
|
|
824
|
+
td->aSmallCoreLoopCnt = ctx.aSmallCoreLoopCnt;
|
|
825
|
+
td->aBigCoreCnt = ctx.aBigCoreCnt;
|
|
826
|
+
td->usedCoreNum = ctx.usedCoreNum;
|
|
827
|
+
td->aSplitIdx = ctx.aSplitIdx;
|
|
828
|
+
td->rSplitIdx = ctx.rSplitIdx;
|
|
829
|
+
td->aUbFactor = ctx.aUbFactor;
|
|
830
|
+
td->rUbFactor = ctx.rUbFactor;
|
|
831
|
+
td->rUbFactorAlign = ctx.rUbFactorAlign;
|
|
832
|
+
td->innerAProdAlign = ctx.innerAProdAlign;
|
|
833
|
+
td->innerRProdAlign = ctx.innerRProdAlign;
|
|
834
|
+
td->rLoopCntTotal = ctx.rLoopCntTotal;
|
|
835
|
+
td->preBufSize = ctx.preBufSize;
|
|
836
|
+
td->postBufSize = ctx.postBufSize;
|
|
837
|
+
td->cacheBufUbSize = CACHE_BUF_BYTES;
|
|
838
|
+
td->rGroupCnt = ctx.rGroupCnt;
|
|
839
|
+
|
|
840
|
+
OP_LOGI(context, "EuclideanNorm tiling: dtype=%d axisNum=%d isTailR=%d usedCoreNum=%d isGroup=%d",
|
|
841
|
+
static_cast<int>(ctx.xDtype), ctx.axisNum, static_cast<int>(ctx.isTailR), ctx.usedCoreNum,
|
|
842
|
+
static_cast<int>(ctx.isGroup));
|
|
843
|
+
OP_LOGI(context, " aSplitIdx=%d aUbFactor=%ld rSplitIdx=%d rUbFactor=%ld rUbFactorAlign=%ld", td->aSplitIdx,
|
|
844
|
+
td->aUbFactor, td->rSplitIdx, td->rUbFactor, td->rUbFactorAlign);
|
|
845
|
+
OP_LOGI(context, " innerAProdAlign=%ld innerRProdAlign=%ld rLoopCntTotal=%ld", td->innerAProdAlign,
|
|
846
|
+
td->innerRProdAlign, td->rLoopCntTotal);
|
|
847
|
+
OP_LOGI(context, " UB: preBuf=%ld postBuf=%ld cache=%ld", td->preBufSize, td->postBufSize, td->cacheBufUbSize);
|
|
848
|
+
OP_LOGI(context, " aLoopCntTotal=%ld aSplitChunkCnt=%ld aBigCoreLoopCnt=%ld aSmallCoreLoopCnt=%ld aBigCoreCnt=%d",
|
|
849
|
+
td->aLoopCntTotal, td->aSplitChunkCnt, td->aBigCoreLoopCnt, td->aSmallCoreLoopCnt, td->aBigCoreCnt);
|
|
850
|
+
OP_LOGI(context, " rGroupCnt=%ld", td->rGroupCnt);
|
|
851
|
+
std::string shapeStr = "[";
|
|
852
|
+
for (int32_t i = 0; i < td->axisNum; ++i) {
|
|
853
|
+
if (i > 0) {
|
|
854
|
+
shapeStr += ", ";
|
|
855
|
+
}
|
|
856
|
+
shapeStr += std::to_string(td->axisShape[i]);
|
|
857
|
+
}
|
|
858
|
+
shapeStr += "]";
|
|
859
|
+
OP_LOGI(context, " axisShape=%s", shapeStr.c_str());
|
|
860
|
+
std::string strideStr = "[";
|
|
861
|
+
for (int32_t i = 0; i < td->axisNum; ++i) {
|
|
862
|
+
if (i > 0) {
|
|
863
|
+
strideStr += ", ";
|
|
864
|
+
}
|
|
865
|
+
strideStr += std::to_string(td->axisStride[i]);
|
|
866
|
+
}
|
|
867
|
+
strideStr += "]";
|
|
868
|
+
OP_LOGI(context, " axisStride=%s", strideStr.c_str());
|
|
869
|
+
return ge::GRAPH_SUCCESS;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// EMPTY_R 输出填充切分(无需读输入,仅向 y 写 aTotal 个 0):
|
|
873
|
+
// aUbFactor = clamp(max(每核 ≥4KB 防碎片, CeilDiv(aTotal, coreNum)), 单 buf ≤64KB 上限, aTotal);
|
|
874
|
+
// 输出区间按大小核协议均分;postBufSize = CeilAlign(max(aUbFactor×maxDtypeSize, 32B), 32B);
|
|
875
|
+
// preBufSize = 0(不申请任何输入侧 buffer)。
|
|
876
|
+
static void ComputeEmptyRTiling(EuclideanNormCtx& ctx)
|
|
877
|
+
{
|
|
878
|
+
constexpr int64_t MAX_SINGLE_UB_BYTES = 64 * 1024;
|
|
879
|
+
const int64_t maxUbFactor =
|
|
880
|
+
std::min(MAX_SINGLE_UB_BYTES / ctx.maxDtypeSize, ctx.ubSize / P_POST / ctx.maxDtypeSize);
|
|
881
|
+
|
|
882
|
+
constexpr int64_t MIN_BYTES_PER_CORE = 4096;
|
|
883
|
+
const int64_t minAPerCore = Ops::Base::CeilDiv(MIN_BYTES_PER_CORE, ctx.maxDtypeSize);
|
|
884
|
+
const int64_t aTotal = ctx.aTotalEmpty;
|
|
885
|
+
|
|
886
|
+
int64_t aUbFactor = std::max(minAPerCore, Ops::Base::CeilDiv(aTotal, ctx.coreNum));
|
|
887
|
+
aUbFactor = std::min(aUbFactor, maxUbFactor);
|
|
888
|
+
aUbFactor = std::min(aUbFactor, aTotal);
|
|
889
|
+
aUbFactor = std::max<int64_t>(aUbFactor, 1);
|
|
890
|
+
|
|
891
|
+
const int64_t aLoopCntTotal = Ops::Base::CeilDiv(aTotal, aUbFactor);
|
|
892
|
+
const int64_t aSmallCoreLoopCnt = aLoopCntTotal / ctx.coreNum;
|
|
893
|
+
const int32_t aBigCoreCnt = static_cast<int32_t>(aLoopCntTotal % ctx.coreNum);
|
|
894
|
+
const int64_t aBigCoreLoopCnt = aSmallCoreLoopCnt + (aBigCoreCnt > 0 ? 1 : 0);
|
|
895
|
+
const int32_t usedCoreNum = (aSmallCoreLoopCnt > 0) ? static_cast<int32_t>(ctx.coreNum) : std::max(aBigCoreCnt, 1);
|
|
896
|
+
|
|
897
|
+
ctx.aUbFactor = aUbFactor;
|
|
898
|
+
ctx.aLoopCntTotal = aLoopCntTotal;
|
|
899
|
+
ctx.aSplitChunkCnt = aLoopCntTotal;
|
|
900
|
+
ctx.aSmallCoreLoopCnt = aSmallCoreLoopCnt;
|
|
901
|
+
ctx.aBigCoreLoopCnt = aBigCoreLoopCnt;
|
|
902
|
+
ctx.aBigCoreCnt = aBigCoreCnt;
|
|
903
|
+
ctx.usedCoreNum = usedCoreNum;
|
|
904
|
+
|
|
905
|
+
int64_t outRaw = aUbFactor * ctx.maxDtypeSize;
|
|
906
|
+
outRaw = std::max(outRaw, ctx.blockSize);
|
|
907
|
+
ctx.postBufSize = Ops::Base::CeilAlign(outRaw, ctx.blockSize);
|
|
908
|
+
ctx.preBufSize = 0;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// 填充 EuclideanNormEmptyTilingData:memset 清零后,EMPTY_A 全零直接返回(kernel 全核早退);
|
|
912
|
+
// EMPTY_R 填输出切分 7 字段(usedCoreNum / aTotal / aUbFactor / 大小核三参 / postBufSize)。
|
|
913
|
+
static ge::graphStatus FillEmptyTilingData(gert::TilingContext* context, const EuclideanNormCtx& ctx)
|
|
914
|
+
{
|
|
915
|
+
EuclideanNormEmptyTilingData* td = context->GetTilingData<EuclideanNormEmptyTilingData>();
|
|
916
|
+
OP_CHECK_NULL_WITH_CONTEXT(context, td);
|
|
917
|
+
OP_CHECK_IF(memset_s(td, sizeof(EuclideanNormEmptyTilingData), 0, sizeof(EuclideanNormEmptyTilingData)) != EOK,
|
|
918
|
+
OP_LOGE(context, "Memset tilingdata error"), return ge::GRAPH_FAILED);
|
|
919
|
+
|
|
920
|
+
if (ctx.emptyKind == EuclideanNormEmptyKind::EMPTY_A) {
|
|
921
|
+
OP_LOGI(context, "EuclideanNorm EMPTY_A: dtype=%d usedCoreNum=0", static_cast<int>(ctx.xDtype));
|
|
922
|
+
return ge::GRAPH_SUCCESS;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
td->aTotal = ctx.aTotalEmpty;
|
|
926
|
+
td->usedCoreNum = ctx.usedCoreNum;
|
|
927
|
+
td->aUbFactor = ctx.aUbFactor;
|
|
928
|
+
td->aBigCoreCnt = ctx.aBigCoreCnt;
|
|
929
|
+
td->aBigCoreLoopCnt = ctx.aBigCoreLoopCnt;
|
|
930
|
+
td->aSmallCoreLoopCnt = ctx.aSmallCoreLoopCnt;
|
|
931
|
+
td->postBufSize = ctx.postBufSize;
|
|
932
|
+
|
|
933
|
+
OP_LOGI(context, "EuclideanNorm EMPTY_R: dtype=%d aTotal=%ld aUbFactor=%ld usedCoreNum=%d postBuf=%ld",
|
|
934
|
+
static_cast<int>(ctx.xDtype), ctx.aTotalEmpty, td->aUbFactor, td->usedCoreNum, td->postBufSize);
|
|
935
|
+
return ge::GRAPH_SUCCESS;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// 空 tensor 快速路径总装(主流程短路出口,跳过整套 normal 切分):
|
|
939
|
+
// EMPTY_R → ComputeEmptyRTiling;EMPTY_A → usedCoreNum=0(kernel 全核零操作)→
|
|
940
|
+
// FillEmptyTilingData → 固定 tilingKey(isGroup=0, isEmptyTensor=1) →
|
|
941
|
+
// SetBlockDim(max(usedCoreNum,1))(EMPTY_A 启 1 核即退)→ SetWorkspaceSize(仅系统 ws)。
|
|
942
|
+
static ge::graphStatus HandleEmptyTensor(gert::TilingContext* context, EuclideanNormCtx& ctx)
|
|
943
|
+
{
|
|
944
|
+
if (ctx.emptyKind == EuclideanNormEmptyKind::EMPTY_R) {
|
|
945
|
+
ComputeEmptyRTiling(ctx);
|
|
946
|
+
OP_LOGD(context->GetNodeName(), "EmptyR: aUbFactor=%ld usedCoreNum=%d postBufSize=%ld", ctx.aUbFactor,
|
|
947
|
+
ctx.usedCoreNum, ctx.postBufSize);
|
|
948
|
+
} else {
|
|
949
|
+
ctx.usedCoreNum = 0;
|
|
950
|
+
}
|
|
951
|
+
OP_CHECK_IF(FillEmptyTilingData(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
952
|
+
|
|
953
|
+
const uint64_t tilingKey = GET_TPL_TILING_KEY(static_cast<uint64_t>(0U), static_cast<uint64_t>(1U));
|
|
954
|
+
context->SetTilingKey(tilingKey);
|
|
955
|
+
context->SetBlockDim(static_cast<uint32_t>(std::max(ctx.usedCoreNum, 1)));
|
|
956
|
+
|
|
957
|
+
OP_CHECK_IF(SetWorkspaceSize(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
958
|
+
return ge::GRAPH_SUCCESS;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// TilingFunc 主入口(IMPL_OP_OPTILING 注册),编排全链:
|
|
962
|
+
// ① 平台/输入/axes 解析 → ② 空分类(非 NORMAL 走 HandleEmptyTensor 直接返回)→
|
|
963
|
+
// ③ A/R 规整 → ④ A 切分 → R 切分 → R 全载扩 A(UB 三步算法)→
|
|
964
|
+
// ⑤ A 多核均分 + R 迭代数 → ⑥ Group 判定(触发则 ComputeGroupSplit + SetScheduleMode(1)
|
|
965
|
+
// batch mode,kernel SyncAll 依赖)→ ⑦ UB 尺寸 + 填 TilingData →
|
|
966
|
+
// ⑧ SetTilingKey(isGroup, isEmptyTensor=0) + SetBlockDim + SetWorkspaceSize。
|
|
967
|
+
static ge::graphStatus EuclideanNormTilingFunc(gert::TilingContext* context)
|
|
968
|
+
{
|
|
969
|
+
OP_LOGD(context, "Begin EuclideanNormTilingFunc");
|
|
970
|
+
EuclideanNormCtx ctx;
|
|
971
|
+
|
|
972
|
+
OP_CHECK_IF(GetPlatformInfo(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
973
|
+
OP_CHECK_IF(GetShapeAndDtype(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
974
|
+
OP_CHECK_IF(ParseAxesTensor(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
975
|
+
|
|
976
|
+
BuildInitialAxisList(ctx);
|
|
977
|
+
ClassifyEmptyTensor(ctx);
|
|
978
|
+
|
|
979
|
+
if (ctx.emptyKind != EuclideanNormEmptyKind::NORMAL) {
|
|
980
|
+
return HandleEmptyTensor(context, ctx);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
OP_CHECK_IF(PreprocessPattern(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
984
|
+
|
|
985
|
+
ComputeAUbFactor(ctx);
|
|
986
|
+
OP_LOGD(context->GetNodeName(), "ComputeAUbFactor: aSplitIdx=%d aUbFactor=%ld innerAProdAlign=%ld", ctx.aSplitIdx,
|
|
987
|
+
ctx.aUbFactor, ctx.innerAProdAlign);
|
|
988
|
+
OP_CHECK_IF(ComputeRUbFactor(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
989
|
+
OP_CHECK_IF(ExpandAIfRFullyLoaded(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
990
|
+
|
|
991
|
+
ComputeFusedALoopSplit(ctx);
|
|
992
|
+
ComputeRLoopCnt(ctx);
|
|
993
|
+
OP_LOGD(context->GetNodeName(), "MultiCore: aLoopCntTotal=%ld aSplitChunkCnt=%ld usedCoreNum=%d rLoopCntTotal=%ld",
|
|
994
|
+
ctx.aLoopCntTotal, ctx.aSplitChunkCnt, ctx.usedCoreNum, ctx.rLoopCntTotal);
|
|
995
|
+
if (ShouldUseGroup(ctx)) {
|
|
996
|
+
ComputeGroupSplit(ctx);
|
|
997
|
+
OP_LOGD(context->GetNodeName(), "Group: rGroupCnt=%ld usedCoreNum=%d", ctx.rGroupCnt, ctx.usedCoreNum);
|
|
998
|
+
OP_CHECK_IF(context->SetScheduleMode(1) != ge::GRAPH_SUCCESS,
|
|
999
|
+
OP_LOGE(context->GetNodeName(), "Failed to set ScheduleMode!"), return ge::GRAPH_FAILED);
|
|
1000
|
+
}
|
|
1001
|
+
ComputeUbSizes(ctx);
|
|
1002
|
+
OP_LOGD(context->GetNodeName(), "UbSizes: preBufSize=%ld postBufSize=%ld", ctx.preBufSize, ctx.postBufSize);
|
|
1003
|
+
|
|
1004
|
+
OP_CHECK_IF(FillAndLogTilingData(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
1005
|
+
|
|
1006
|
+
const uint64_t tilingKey =
|
|
1007
|
+
GET_TPL_TILING_KEY(static_cast<uint64_t>(ctx.isGroup ? 1U : 0U), static_cast<uint64_t>(0U));
|
|
1008
|
+
context->SetTilingKey(tilingKey);
|
|
1009
|
+
context->SetBlockDim(static_cast<uint32_t>(std::max(ctx.usedCoreNum, 1)));
|
|
1010
|
+
|
|
1011
|
+
OP_CHECK_IF(SetWorkspaceSize(context, ctx) != ge::GRAPH_SUCCESS, , return ge::GRAPH_FAILED);
|
|
1012
|
+
return ge::GRAPH_SUCCESS;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// TilingParse 空实现:EuclideanNormCompileInfo 为空结构(本算子无跨次编译缓存信息),
|
|
1016
|
+
// 恒返回成功;后续若做 binary 复用,缓存字段挂 CompileInfo 并在此解析。
|
|
1017
|
+
static ge::graphStatus TilingParseForEuclideanNorm([[maybe_unused]] gert::TilingParseContext* context)
|
|
1018
|
+
{
|
|
1019
|
+
return ge::GRAPH_SUCCESS;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
IMPL_OP_OPTILING(EuclideanNorm)
|
|
1023
|
+
.Tiling(EuclideanNormTilingFunc)
|
|
1024
|
+
.TilingParse<EuclideanNormCompileInfo>(TilingParseForEuclideanNorm)
|
|
1025
|
+
.TilingInputsDataDependency({1});
|
|
1026
|
+
|
|
1027
|
+
} // namespace optiling
|