@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,1287 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2026 Huawei Technologies Co., Ltd.
|
|
4
|
+
# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
|
|
5
|
+
# CANN Open Software License Agreement Version 2.0 (the "License").
|
|
6
|
+
# Please refer to the License for details. You may not use this file except in compliance with the License.
|
|
7
|
+
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
|
8
|
+
# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE in the root of the software repository for the full text of the License.
|
|
10
|
+
#
|
|
11
|
+
"""
|
|
12
|
+
因子取值生成器
|
|
13
|
+
|
|
14
|
+
功能:
|
|
15
|
+
1. 解析求解配置、约束定义、测试因子
|
|
16
|
+
2. 对锚点因子进行BC组合
|
|
17
|
+
3. 逐层推导其他因子(优先非shape类因子)
|
|
18
|
+
4. 返回取值范围而非随机值
|
|
19
|
+
5. 支持value_range_dtype扩展
|
|
20
|
+
6. 生成完整的因子取值表
|
|
21
|
+
|
|
22
|
+
使用方法:
|
|
23
|
+
python generate_factor_values.py <求解配置.yaml> <约束定义.yaml> <测试因子.yaml> [输出.csv]
|
|
24
|
+
|
|
25
|
+
示例:
|
|
26
|
+
python generate_factor_values.py 07_求解配置.yaml 05_约束定义.yaml 04_测试因子.yaml factor_values.csv
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
import sys
|
|
30
|
+
import yaml
|
|
31
|
+
import csv
|
|
32
|
+
import random
|
|
33
|
+
import copy
|
|
34
|
+
from typing import Dict, List, Set, Any, Optional, Tuple, Union
|
|
35
|
+
from pathlib import Path
|
|
36
|
+
from itertools import product
|
|
37
|
+
from collections import defaultdict
|
|
38
|
+
import math
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
from utils import (
|
|
42
|
+
infer_dtypes,
|
|
43
|
+
infer_two_dtypes,
|
|
44
|
+
normalize_dtype,
|
|
45
|
+
normalize_dtype_list,
|
|
46
|
+
get_convertible_source_dtypes,
|
|
47
|
+
generate_random_shape,
|
|
48
|
+
generate_random_value_by_dtype,
|
|
49
|
+
FLOAT_DTYPES,
|
|
50
|
+
INTEGER_DTYPES,
|
|
51
|
+
generate_broadcast_shapes,
|
|
52
|
+
generate_unidirectional_broadcast_shapes,
|
|
53
|
+
get_broadcast_result,
|
|
54
|
+
MAX_SHAPE_PRODUCT
|
|
55
|
+
)
|
|
56
|
+
except ImportError:
|
|
57
|
+
import os
|
|
58
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
59
|
+
from utils import (
|
|
60
|
+
infer_dtypes,
|
|
61
|
+
infer_two_dtypes,
|
|
62
|
+
normalize_dtype,
|
|
63
|
+
normalize_dtype_list,
|
|
64
|
+
get_convertible_source_dtypes,
|
|
65
|
+
generate_random_shape,
|
|
66
|
+
generate_random_value_by_dtype,
|
|
67
|
+
FLOAT_DTYPES,
|
|
68
|
+
INTEGER_DTYPES,
|
|
69
|
+
generate_broadcast_shapes,
|
|
70
|
+
generate_unidirectional_broadcast_shapes,
|
|
71
|
+
get_broadcast_result,
|
|
72
|
+
MAX_SHAPE_PRODUCT
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class FactorValueGenerator:
|
|
77
|
+
"""因子取值生成器"""
|
|
78
|
+
|
|
79
|
+
TENSOR_TYPES = {'aclTensor', 'aclTensorList'}
|
|
80
|
+
ARRAY_TYPES = {'aclIntArray', 'aclFloatArray', 'aclBoolArray', 'aclScalarList'}
|
|
81
|
+
SCALAR_TYPES = {
|
|
82
|
+
'int4_t', 'int8_t', 'int16_t', 'int32_t', 'int64_t',
|
|
83
|
+
'uint1_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t',
|
|
84
|
+
'bool', 'float', 'float16', 'bfloat16', 'float32', 'double',
|
|
85
|
+
'char', 'string',
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
SHAPE_RELATED_ATTRS = {'shape'}
|
|
89
|
+
|
|
90
|
+
def __init__(self):
|
|
91
|
+
self.solver_config = {}
|
|
92
|
+
self.constraints_data = {}
|
|
93
|
+
self.test_factors = {}
|
|
94
|
+
self.factors_def = {}
|
|
95
|
+
self.constraints = []
|
|
96
|
+
self.anchors = []
|
|
97
|
+
self.derivation_order = {}
|
|
98
|
+
|
|
99
|
+
@staticmethod
|
|
100
|
+
def _make_hashable(value):
|
|
101
|
+
"""
|
|
102
|
+
将值转换为可哈希类型
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
value: 任意值
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
可哈希的值
|
|
109
|
+
"""
|
|
110
|
+
if isinstance(value, list):
|
|
111
|
+
return tuple(FactorValueGenerator._make_hashable(v) for v in value)
|
|
112
|
+
elif isinstance(value, dict):
|
|
113
|
+
return frozenset((k, FactorValueGenerator._make_hashable(v)) for k, v in value.items())
|
|
114
|
+
else:
|
|
115
|
+
return value
|
|
116
|
+
|
|
117
|
+
def load_configs(self, solver_config_path: str, constraints_path: str, factors_path: str):
|
|
118
|
+
"""加载配置文件"""
|
|
119
|
+
with open(solver_config_path, 'r', encoding='utf-8') as f:
|
|
120
|
+
self.solver_config = yaml.safe_load(f)
|
|
121
|
+
|
|
122
|
+
with open(constraints_path, 'r', encoding='utf-8') as f:
|
|
123
|
+
self.constraints_data = yaml.safe_load(f)
|
|
124
|
+
|
|
125
|
+
with open(factors_path, 'r', encoding='utf-8') as f:
|
|
126
|
+
self.test_factors = yaml.safe_load(f)
|
|
127
|
+
|
|
128
|
+
self.factors_def = self.constraints_data.get('factors', {})
|
|
129
|
+
self.constraints = self.constraints_data.get('constraints', [])
|
|
130
|
+
|
|
131
|
+
solver = self.solver_config.get('solver', {})
|
|
132
|
+
self.anchors = solver.get('anchors', [])
|
|
133
|
+
self.derivation_order = solver.get('derivation_order', {})
|
|
134
|
+
|
|
135
|
+
def get_factor_domain(self, factor_name: str) -> List[Any]:
|
|
136
|
+
"""获取因子的取值范围"""
|
|
137
|
+
parts = factor_name.split('.')
|
|
138
|
+
if len(parts) != 2:
|
|
139
|
+
return []
|
|
140
|
+
|
|
141
|
+
param_name, attr = parts
|
|
142
|
+
param_data = self.test_factors.get(param_name, {})
|
|
143
|
+
factors = param_data.get('factors', {})
|
|
144
|
+
|
|
145
|
+
if attr == 'exist':
|
|
146
|
+
return factors.get(f'{param_name}.exist', [True])
|
|
147
|
+
elif attr == 'format':
|
|
148
|
+
format_list = factors.get(f'{param_name}.format', [])
|
|
149
|
+
return format_list
|
|
150
|
+
elif attr == 'dimensions':
|
|
151
|
+
return factors.get(f'{param_name}.dimensions', [])
|
|
152
|
+
elif attr == 'dtype':
|
|
153
|
+
return factors.get(f'{param_name}.dtype', [])
|
|
154
|
+
elif attr == 'enum_values':
|
|
155
|
+
return factors.get(f'{param_name}.enum_values', [])
|
|
156
|
+
# elif attr == 'value':
|
|
157
|
+
# return factors.get(f'{param_name}.enum_values', [])
|
|
158
|
+
|
|
159
|
+
exact_key = f'{param_name}.{attr}'
|
|
160
|
+
if exact_key in factors:
|
|
161
|
+
return factors[exact_key]
|
|
162
|
+
|
|
163
|
+
if attr == 'value':
|
|
164
|
+
return []
|
|
165
|
+
|
|
166
|
+
for key in factors:
|
|
167
|
+
if key.startswith(f'{param_name}.{attr}_'):
|
|
168
|
+
return factors[key]
|
|
169
|
+
|
|
170
|
+
return []
|
|
171
|
+
|
|
172
|
+
def get_value_range_for_dtype(self, param_name: str, dtype: str) -> List[Any]:
|
|
173
|
+
"""根据dtype获取value_range取值范围"""
|
|
174
|
+
param_data = self.test_factors.get(param_name, {})
|
|
175
|
+
factors = param_data.get('factors', {})
|
|
176
|
+
|
|
177
|
+
key = f'{param_name}.value_range_{dtype}'
|
|
178
|
+
if key in factors:
|
|
179
|
+
return factors[key]
|
|
180
|
+
|
|
181
|
+
key = f'{param_name}.value_range'
|
|
182
|
+
if key in factors:
|
|
183
|
+
return factors[key]
|
|
184
|
+
|
|
185
|
+
return []
|
|
186
|
+
|
|
187
|
+
def is_shape_factor(self, factor_name: str) -> bool:
|
|
188
|
+
"""判断是否为shape类因子"""
|
|
189
|
+
parts = factor_name.split('.')
|
|
190
|
+
if len(parts) != 2:
|
|
191
|
+
return False
|
|
192
|
+
return parts[1] in self.SHAPE_RELATED_ATTRS
|
|
193
|
+
|
|
194
|
+
def factor_depends_on_shape(self, factor_name: str) -> bool:
|
|
195
|
+
"""
|
|
196
|
+
检查因子的约束是否依赖shape类因子
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
factor_name: 因子名称
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
True如果该因子依赖shape类因子,否则False
|
|
203
|
+
|
|
204
|
+
注意:
|
|
205
|
+
检查所有约束,只要任一约束依赖shape类因子就返回True
|
|
206
|
+
"""
|
|
207
|
+
constraints = self.find_all_constraints_for_factor(factor_name)
|
|
208
|
+
if not constraints:
|
|
209
|
+
return False
|
|
210
|
+
|
|
211
|
+
for constraint in constraints:
|
|
212
|
+
sources = constraint.get('sources', [])
|
|
213
|
+
for source in sources:
|
|
214
|
+
if self.is_shape_factor(source):
|
|
215
|
+
return True
|
|
216
|
+
|
|
217
|
+
return False
|
|
218
|
+
|
|
219
|
+
def generate_bc_combinations(self, max_combinations: int = 100000000000) -> List[Dict[str, Any]]:
|
|
220
|
+
"""生成锚点因子的BC组合"""
|
|
221
|
+
anchor_domains = {}
|
|
222
|
+
|
|
223
|
+
for anchor in self.anchors:
|
|
224
|
+
domain = self.get_factor_domain(anchor)
|
|
225
|
+
if domain:
|
|
226
|
+
anchor_domains[anchor] = domain
|
|
227
|
+
|
|
228
|
+
if not anchor_domains:
|
|
229
|
+
return []
|
|
230
|
+
|
|
231
|
+
all_combinations = list(product(*[anchor_domains[a] for a in anchor_domains.keys()]))
|
|
232
|
+
|
|
233
|
+
if len(all_combinations) > max_combinations:
|
|
234
|
+
random.seed(42)
|
|
235
|
+
all_combinations = random.sample(all_combinations, max_combinations)
|
|
236
|
+
|
|
237
|
+
combinations = []
|
|
238
|
+
anchor_names = list(anchor_domains.keys())
|
|
239
|
+
|
|
240
|
+
for combo in all_combinations:
|
|
241
|
+
case = {}
|
|
242
|
+
for i, anchor in enumerate(anchor_names):
|
|
243
|
+
case[anchor] = combo[i]
|
|
244
|
+
combinations.append(case)
|
|
245
|
+
|
|
246
|
+
return combinations
|
|
247
|
+
|
|
248
|
+
def find_all_constraints_for_factor(self, factor_name: str) -> List[Dict]:
|
|
249
|
+
"""
|
|
250
|
+
查找所有匹配的约束定义
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
factor_name: 因子名称
|
|
254
|
+
|
|
255
|
+
Returns:
|
|
256
|
+
所有target为该因子的约束列表
|
|
257
|
+
"""
|
|
258
|
+
matched_constraints = []
|
|
259
|
+
for constraint in self.constraints:
|
|
260
|
+
target = constraint.get('target', '')
|
|
261
|
+
if target == factor_name:
|
|
262
|
+
matched_constraints.append(constraint)
|
|
263
|
+
|
|
264
|
+
return matched_constraints
|
|
265
|
+
|
|
266
|
+
def solve_constraint_range(self, constraint: Dict, context: Dict[str, Any]) -> Union[List[Any], Any]:
|
|
267
|
+
"""
|
|
268
|
+
求解约束,返回取值范围而非单个值
|
|
269
|
+
|
|
270
|
+
根据参数类型分发到对应的推导方法:
|
|
271
|
+
- aclTensorList: _solve_tensor_list_derivation
|
|
272
|
+
- aclIntArray/aclFloatArray/aclBoolArray/aclScalarList: _solve_array_derivation
|
|
273
|
+
- aclScalar/18种标量类型: _solve_scalar_derivation
|
|
274
|
+
- aclTensor: 原有逻辑
|
|
275
|
+
"""
|
|
276
|
+
constraint_type = constraint.get('type', '')
|
|
277
|
+
sources = constraint.get('sources', [])
|
|
278
|
+
target = constraint.get('target', '')
|
|
279
|
+
|
|
280
|
+
source_values = [context.get(s) for s in sources]
|
|
281
|
+
|
|
282
|
+
if any(v is None for v in source_values):
|
|
283
|
+
return None
|
|
284
|
+
|
|
285
|
+
if constraint_type == 'calculate':
|
|
286
|
+
expression = constraint.get('expression', 'sources[0]')
|
|
287
|
+
param_name = target.split('.')[0]
|
|
288
|
+
param_type = self._get_param_type(param_name)
|
|
289
|
+
target_attr = target.split('.')[-1] if '.' in target else ''
|
|
290
|
+
|
|
291
|
+
try:
|
|
292
|
+
result = self._dispatch_derivation(
|
|
293
|
+
expression, param_type, target_attr,
|
|
294
|
+
source_values, context, target
|
|
295
|
+
)
|
|
296
|
+
if result is not None:
|
|
297
|
+
return result
|
|
298
|
+
return eval(expression, {
|
|
299
|
+
'sources': source_values,
|
|
300
|
+
'get_broadcast_result': lambda *shapes: get_broadcast_result(list(shapes)),
|
|
301
|
+
})
|
|
302
|
+
except:
|
|
303
|
+
return None
|
|
304
|
+
|
|
305
|
+
elif constraint_type == 'inferable_filter':
|
|
306
|
+
return random.choice(self._solve_inferable_filter_range(constraint, context))
|
|
307
|
+
|
|
308
|
+
elif constraint_type == 'convertible':
|
|
309
|
+
return random.choice(self._solve_convertible_range(constraint, context))
|
|
310
|
+
|
|
311
|
+
elif constraint_type == 'match':
|
|
312
|
+
return random.choice(self._solve_match_range(constraint, context))
|
|
313
|
+
|
|
314
|
+
elif constraint_type == 'broadcast_dim':
|
|
315
|
+
return random.choice(self._solve_broadcast_dim_range(constraint, context))
|
|
316
|
+
|
|
317
|
+
elif constraint_type == 'broadcast_shape':
|
|
318
|
+
return self._solve_broadcast_shape_range(constraint, context)
|
|
319
|
+
|
|
320
|
+
return None
|
|
321
|
+
|
|
322
|
+
def _get_param_type(self, param_name: str) -> str:
|
|
323
|
+
param_data = self.test_factors.get(param_name, {})
|
|
324
|
+
return param_data.get('type', '')
|
|
325
|
+
|
|
326
|
+
def _dispatch_derivation(self, expression, param_type, target_attr,
|
|
327
|
+
source_values, context, target):
|
|
328
|
+
"""
|
|
329
|
+
按参数类型分发推导逻辑
|
|
330
|
+
|
|
331
|
+
(1) aclTensorList:
|
|
332
|
+
a. derive_length_from_length_ranges: 根据 length_ranges 随机生成 length
|
|
333
|
+
b. derive_shape_list_from_length_and_dimensions: length 决定 shape_list 长度,
|
|
334
|
+
根据 dimensions 生成每个 shape
|
|
335
|
+
c. derive_value_range_from_dtype / derive_shape_from_dimensions: 同 aclTensor
|
|
336
|
+
|
|
337
|
+
(2) aclIntArray/aclFloatArray/aclBoolArray/aclScalarList:
|
|
338
|
+
a. derive_length_from_length_ranges: 根据 length_ranges 随机生成 length
|
|
339
|
+
b. derive_array_value_from_length_and_value_range: 根据 value_range 随机生成
|
|
340
|
+
length 个值,保存在 list 中
|
|
341
|
+
c. derive_value_range_from_dtype: 同 aclTensor
|
|
342
|
+
|
|
343
|
+
(3) 18种标量类型 + aclScalar:
|
|
344
|
+
a. derive_value_from_range: 根据 value_range 随机生成 value
|
|
345
|
+
b. derive_value_range_from_dtype: 同 aclTensor
|
|
346
|
+
"""
|
|
347
|
+
hashable_context = frozenset((k, self._make_hashable(v)) for k, v in context.items())
|
|
348
|
+
seed = hash(hashable_context) % (2**32)
|
|
349
|
+
|
|
350
|
+
# === 通用推导:shape from dimensions ===
|
|
351
|
+
if expression.startswith('derive_shape_from_dimensions'):
|
|
352
|
+
dimensions = source_values[0]
|
|
353
|
+
if isinstance(dimensions, int):
|
|
354
|
+
return generate_random_shape(dimensions, seed=seed)
|
|
355
|
+
return None
|
|
356
|
+
|
|
357
|
+
# === 通用推导:value_range from dtype ===
|
|
358
|
+
if expression.startswith('derive_value_range_from_dtype'):
|
|
359
|
+
dtype = source_values[0]
|
|
360
|
+
param_name = target.split('.')[0]
|
|
361
|
+
value_ranges = self.get_value_range_for_dtype(param_name, dtype)
|
|
362
|
+
if value_ranges:
|
|
363
|
+
random.seed(seed)
|
|
364
|
+
return random.choice(value_ranges)
|
|
365
|
+
return None
|
|
366
|
+
|
|
367
|
+
# === 通用推导:value from value_range ===
|
|
368
|
+
if expression.startswith('derive_value_from_range'):
|
|
369
|
+
value_range = source_values[0]
|
|
370
|
+
param_name = target.split('.')[0]
|
|
371
|
+
dtype_value = context.get(f'{param_name}.dtype', 'float32')
|
|
372
|
+
return self._derive_scalar_value(value_range, dtype_value, seed)
|
|
373
|
+
|
|
374
|
+
# === (1) aclTensorList 专属推导 ===
|
|
375
|
+
if param_type == 'aclTensorList':
|
|
376
|
+
if expression.startswith('derive_length_from_length_ranges'):
|
|
377
|
+
return self._derive_length(source_values[0], seed)
|
|
378
|
+
|
|
379
|
+
if expression.startswith('derive_shape_list_from_length_and_dimensions'):
|
|
380
|
+
return self._derive_shape_list(source_values[0], source_values[1], seed)
|
|
381
|
+
|
|
382
|
+
# === 通用推导:多shape广播结果计算 ===
|
|
383
|
+
if expression.startswith('get_broadcast_result'):
|
|
384
|
+
shapes = [v for v in source_values if isinstance(v, list)]
|
|
385
|
+
if len(shapes) >= 2:
|
|
386
|
+
result = get_broadcast_result(shapes[:2])
|
|
387
|
+
if result is not None:
|
|
388
|
+
return result
|
|
389
|
+
elif len(shapes) == 1:
|
|
390
|
+
return shapes[0]
|
|
391
|
+
return None
|
|
392
|
+
|
|
393
|
+
# === (2) Array 类型专属推导 ===
|
|
394
|
+
if param_type in self.ARRAY_TYPES:
|
|
395
|
+
if expression.startswith('derive_length_from_length_ranges'):
|
|
396
|
+
return self._derive_length(source_values[0], seed)
|
|
397
|
+
|
|
398
|
+
if expression.startswith('derive_array_value_from_length_and_value_range'):
|
|
399
|
+
return self._derive_array_value(
|
|
400
|
+
source_values[0], source_values[1],
|
|
401
|
+
context, target, seed
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
return None
|
|
405
|
+
|
|
406
|
+
def _derive_scalar_value(self, value_range, dtype_value, seed):
|
|
407
|
+
"""根据 value_range 和 dtype 随机生成标量 value"""
|
|
408
|
+
if not isinstance(value_range, list) or len(value_range) != 2:
|
|
409
|
+
return None
|
|
410
|
+
signed_zero = self._check_signed_zero_range(value_range)
|
|
411
|
+
if signed_zero is not None:
|
|
412
|
+
return signed_zero
|
|
413
|
+
result = generate_random_value_by_dtype(dtype_value, value_range, seed=seed)
|
|
414
|
+
if isinstance(result, list):
|
|
415
|
+
if len(result) == 2 and all(isinstance(v, (int, float)) for v in result):
|
|
416
|
+
mid = (result[0] + result[1]) / 2
|
|
417
|
+
if dtype_value in INTEGER_DTYPES or dtype_value in ('bool',):
|
|
418
|
+
mid = int(mid)
|
|
419
|
+
return mid
|
|
420
|
+
return None
|
|
421
|
+
return result
|
|
422
|
+
|
|
423
|
+
def _derive_length(self, length_ranges, seed):
|
|
424
|
+
"""根据 length_ranges 随机生成 length"""
|
|
425
|
+
if not isinstance(length_ranges, list) or not length_ranges:
|
|
426
|
+
return None
|
|
427
|
+
random.seed(seed)
|
|
428
|
+
if isinstance(length_ranges[0], list):
|
|
429
|
+
selected_range = random.choice(length_ranges)
|
|
430
|
+
return random.randint(int(selected_range[0]), int(selected_range[1]))
|
|
431
|
+
else:
|
|
432
|
+
return random.randint(int(length_ranges[0]), int(length_ranges[1]))
|
|
433
|
+
|
|
434
|
+
def _derive_shape_list(self, length_val, dimensions_val, seed):
|
|
435
|
+
"""
|
|
436
|
+
根据 length 和 dimensions 生成 shape_list
|
|
437
|
+
length 决定 shape_list 中包含几个 shape
|
|
438
|
+
根据 dimensions 生成每个 shape(参考 aclTensor 的 shape 生成规则)
|
|
439
|
+
"""
|
|
440
|
+
if not isinstance(length_val, int) or not isinstance(dimensions_val, int):
|
|
441
|
+
return None
|
|
442
|
+
return [generate_random_shape(dimensions_val, seed=seed + i) for i in range(length_val)]
|
|
443
|
+
|
|
444
|
+
@staticmethod
|
|
445
|
+
def _check_signed_zero_range(value_range):
|
|
446
|
+
if isinstance(value_range, list) and len(value_range) == 2:
|
|
447
|
+
if value_range[0] == '+0' and value_range[1] == '+0':
|
|
448
|
+
return '+0'
|
|
449
|
+
if value_range[0] == '-0' and value_range[1] == '-0':
|
|
450
|
+
return '-0'
|
|
451
|
+
return None
|
|
452
|
+
|
|
453
|
+
def _derive_array_value(self, length_val, value_range_val, context, target, seed):
|
|
454
|
+
"""
|
|
455
|
+
根据 value_range 随机生成 length 个数,保存在 list 中
|
|
456
|
+
适用于 aclIntArray/aclFloatArray/aclBoolArray/aclScalarList
|
|
457
|
+
"""
|
|
458
|
+
if not isinstance(length_val, int):
|
|
459
|
+
return None
|
|
460
|
+
if not isinstance(value_range_val, list) or len(value_range_val) != 2:
|
|
461
|
+
return None
|
|
462
|
+
signed_zero = self._check_signed_zero_range(value_range_val)
|
|
463
|
+
if signed_zero is not None:
|
|
464
|
+
return [signed_zero] * length_val
|
|
465
|
+
param_name = target.split('.')[0]
|
|
466
|
+
dtype_value = context.get(f'{param_name}.dtype', 'float32')
|
|
467
|
+
random.seed(seed)
|
|
468
|
+
return [generate_random_value_by_dtype(dtype_value, value_range_val) for _ in range(length_val)]
|
|
469
|
+
|
|
470
|
+
def solve_all_constraints_for_factor(self, factor_name: str, context: Dict[str, Any]) -> Union[List[Any], Any, None]:
|
|
471
|
+
"""
|
|
472
|
+
求解因子的所有约束,返回满足所有约束的值
|
|
473
|
+
|
|
474
|
+
Args:
|
|
475
|
+
factor_name: 因子名称
|
|
476
|
+
context: 上下文(已知因子的值)
|
|
477
|
+
|
|
478
|
+
Returns:
|
|
479
|
+
- List: 返回取值范围列表
|
|
480
|
+
- 单个值: 固定值
|
|
481
|
+
- None: 无法求解
|
|
482
|
+
|
|
483
|
+
处理策略:
|
|
484
|
+
1. 获取所有约束
|
|
485
|
+
2. 用第一个约束推导初始候选值
|
|
486
|
+
3. 用后续约束验证和过滤候选值
|
|
487
|
+
4. 返回满足所有约束的值
|
|
488
|
+
"""
|
|
489
|
+
constraints = self.find_all_constraints_for_factor(factor_name)
|
|
490
|
+
|
|
491
|
+
if not constraints:
|
|
492
|
+
return None
|
|
493
|
+
|
|
494
|
+
result = None
|
|
495
|
+
|
|
496
|
+
for i, constraint in enumerate(constraints):
|
|
497
|
+
new_result = self.solve_constraint_range(constraint, context)
|
|
498
|
+
if new_result is not None and new_result != [] and new_result:
|
|
499
|
+
result = new_result
|
|
500
|
+
context[factor_name] = result if result is not None else new_result
|
|
501
|
+
|
|
502
|
+
return result
|
|
503
|
+
|
|
504
|
+
def _solve_match_range(self, constraint: Dict, context: Dict[str, Any]) -> List[int]:
|
|
505
|
+
"""求解match约束"""
|
|
506
|
+
sources = constraint.get('sources', [])
|
|
507
|
+
target = constraint.get('target', '')
|
|
508
|
+
source_index = constraint.get('source_index')
|
|
509
|
+
target_index = constraint.get('target_index')
|
|
510
|
+
|
|
511
|
+
source_shape = context.get(sources[0])
|
|
512
|
+
target_shape = context.get(target)
|
|
513
|
+
if source_shape is None or not isinstance(source_shape, list):
|
|
514
|
+
return []
|
|
515
|
+
|
|
516
|
+
if source_index is None or source_index >= len(source_shape):
|
|
517
|
+
return []
|
|
518
|
+
|
|
519
|
+
if target_shape is None or target_index >= len(target_shape):
|
|
520
|
+
return []
|
|
521
|
+
|
|
522
|
+
source_dim = source_shape[source_index]
|
|
523
|
+
|
|
524
|
+
return [target_shape[:target_index] + [source_dim] + target_shape[target_index + 1:]]
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
def _solve_inferable_filter_range(self, constraint: Dict, context: Dict[str, Any]) -> List[Any]:
|
|
528
|
+
"""
|
|
529
|
+
求解inferable_filter约束,返回兼容类型列表
|
|
530
|
+
|
|
531
|
+
返回所有与sources兼容的类型列表,而非随机选择一个
|
|
532
|
+
"""
|
|
533
|
+
sources = constraint.get('sources', [])
|
|
534
|
+
target_domain = constraint.get('target_domain', [])
|
|
535
|
+
|
|
536
|
+
source_values = [context.get(s) for s in sources]
|
|
537
|
+
|
|
538
|
+
if any(v is None for v in source_values):
|
|
539
|
+
return []
|
|
540
|
+
|
|
541
|
+
if len(source_values) == 1:
|
|
542
|
+
inferred = source_values[0]
|
|
543
|
+
elif len(source_values) >= 2:
|
|
544
|
+
inferred = source_values[0]
|
|
545
|
+
for i in range(1, len(source_values)):
|
|
546
|
+
if inferred is None or source_values[i] is None:
|
|
547
|
+
return []
|
|
548
|
+
inferred_str = str(inferred) if inferred else None
|
|
549
|
+
source_val_str = str(source_values[i]) if source_values[i] else None
|
|
550
|
+
if inferred_str is None or source_val_str is None:
|
|
551
|
+
return []
|
|
552
|
+
inferred = infer_two_dtypes(inferred_str, source_val_str)
|
|
553
|
+
if inferred is None:
|
|
554
|
+
return []
|
|
555
|
+
else:
|
|
556
|
+
return []
|
|
557
|
+
|
|
558
|
+
if target_domain:
|
|
559
|
+
compatible = []
|
|
560
|
+
inferred_normalized = normalize_dtype(inferred)
|
|
561
|
+
|
|
562
|
+
for candidate in target_domain:
|
|
563
|
+
candidate_normalized = normalize_dtype(candidate)
|
|
564
|
+
if inferred_normalized is None or candidate_normalized is None:
|
|
565
|
+
continue
|
|
566
|
+
result = infer_two_dtypes(candidate_normalized, inferred_normalized)
|
|
567
|
+
# if result == inferred_normalized:
|
|
568
|
+
if result is not None:
|
|
569
|
+
compatible.append(candidate)
|
|
570
|
+
|
|
571
|
+
# return compatible if compatible else ([inferred] if inferred in target_domain else [])
|
|
572
|
+
# else:
|
|
573
|
+
# return [inferred]
|
|
574
|
+
return compatible if compatible else []
|
|
575
|
+
else:
|
|
576
|
+
return []
|
|
577
|
+
|
|
578
|
+
def _solve_convertible_range(self, constraint: Dict, context: Dict[str, Any]) -> List[Any]:
|
|
579
|
+
"""
|
|
580
|
+
求解convertible约束,返回可转换类型列表
|
|
581
|
+
"""
|
|
582
|
+
sources = constraint.get('sources', [])
|
|
583
|
+
target_domain = constraint.get('target_domain', [])
|
|
584
|
+
|
|
585
|
+
target_dtype = context.get(sources[0])
|
|
586
|
+
if target_dtype is None:
|
|
587
|
+
return []
|
|
588
|
+
|
|
589
|
+
if not target_domain:
|
|
590
|
+
return []
|
|
591
|
+
|
|
592
|
+
convertible_types = get_convertible_source_dtypes(target_dtype, target_domain)
|
|
593
|
+
return convertible_types
|
|
594
|
+
|
|
595
|
+
def _solve_broadcast_dim_range(self, constraint: Dict, context: Dict[str, Any]) -> List[int]:
|
|
596
|
+
"""求解broadcast_dim约束"""
|
|
597
|
+
sources = constraint.get('sources', [])
|
|
598
|
+
target = constraint.get('target', '')
|
|
599
|
+
source_index = constraint.get('source_index')
|
|
600
|
+
target_index = constraint.get('target_index')
|
|
601
|
+
|
|
602
|
+
source_shape = context.get(sources[0])
|
|
603
|
+
target_shape = context.get(target)
|
|
604
|
+
if source_shape is None or not isinstance(source_shape, list):
|
|
605
|
+
return []
|
|
606
|
+
|
|
607
|
+
if source_index is None or source_index >= len(source_shape):
|
|
608
|
+
return []
|
|
609
|
+
|
|
610
|
+
if target_shape is None or target_index >= len(target_shape):
|
|
611
|
+
return []
|
|
612
|
+
|
|
613
|
+
source_dim = source_shape[source_index]
|
|
614
|
+
result = [target_shape[:target_index] + [1] + target_shape[target_index + 1:]]
|
|
615
|
+
broadcast_dim_shape = target_shape[:target_index] + [source_dim] + target_shape[target_index + 1:]
|
|
616
|
+
if math.prod(broadcast_dim_shape) <= MAX_SHAPE_PRODUCT:
|
|
617
|
+
result.append(broadcast_dim_shape)
|
|
618
|
+
result = [list(x) for x in dict.fromkeys(map(tuple, result))]
|
|
619
|
+
return result
|
|
620
|
+
|
|
621
|
+
def _solve_broadcast_shape_range(self, constraint: Dict, context: Dict[str, Any]) -> List[List[int]]:
|
|
622
|
+
"""求解broadcast_shape约束"""
|
|
623
|
+
sources = constraint.get('sources', [])
|
|
624
|
+
target = constraint.get('target', '')
|
|
625
|
+
mode = constraint.get('mode', 'unidirectional')
|
|
626
|
+
|
|
627
|
+
source_shape = context.get(sources[0])
|
|
628
|
+
if source_shape is None:
|
|
629
|
+
return []
|
|
630
|
+
|
|
631
|
+
if mode == 'unidirectional':
|
|
632
|
+
return generate_unidirectional_broadcast_shapes(source_shape)
|
|
633
|
+
else:
|
|
634
|
+
param_name = target.split('.')[0]
|
|
635
|
+
target_dims = context.get(f'{param_name}.dimensions')
|
|
636
|
+
|
|
637
|
+
max_attempts = 100
|
|
638
|
+
for _ in range(max_attempts):
|
|
639
|
+
shape = generate_broadcast_shapes(source_shape)
|
|
640
|
+
if target_dims is None or len(shape) == target_dims:
|
|
641
|
+
return shape
|
|
642
|
+
return source_shape
|
|
643
|
+
|
|
644
|
+
def expand_value_range_for_dtype(self, combinations: List[Dict[str, Any]], random_select: bool = False) -> List[Dict[str, Any]]:
|
|
645
|
+
"""
|
|
646
|
+
根据dtype因子值扩展value_range
|
|
647
|
+
|
|
648
|
+
Args:
|
|
649
|
+
combinations: 组合列表
|
|
650
|
+
random_select: 是否随机选择模式
|
|
651
|
+
- False(默认):扩展模式,每个value_range都生成独立组合
|
|
652
|
+
- True:随机选择模式,从value_range列表中随机选择一个
|
|
653
|
+
|
|
654
|
+
当dtype确定后,获取 参数名.value_range_dtype 的取值范围,并更新组合集
|
|
655
|
+
如果该参数的value_range已存在,跳过处理
|
|
656
|
+
"""
|
|
657
|
+
expanded_combos = []
|
|
658
|
+
|
|
659
|
+
for combo in combinations:
|
|
660
|
+
dtype_factors = [(k, v) for k, v in combo.items() if k.endswith('.dtype')]
|
|
661
|
+
|
|
662
|
+
if not dtype_factors:
|
|
663
|
+
expanded_combos.append(combo)
|
|
664
|
+
continue
|
|
665
|
+
|
|
666
|
+
current_combos = [combo]
|
|
667
|
+
|
|
668
|
+
for dtype_factor, dtype_value in dtype_factors:
|
|
669
|
+
param_name = dtype_factor.split('.')[0]
|
|
670
|
+
value_range_key = f'{param_name}.value_range'
|
|
671
|
+
|
|
672
|
+
value_ranges = self.get_value_range_for_dtype(param_name, dtype_value)
|
|
673
|
+
|
|
674
|
+
if not value_ranges:
|
|
675
|
+
continue
|
|
676
|
+
|
|
677
|
+
new_combos = []
|
|
678
|
+
for current in current_combos:
|
|
679
|
+
if value_range_key in current:
|
|
680
|
+
new_combos.append(current)
|
|
681
|
+
continue
|
|
682
|
+
|
|
683
|
+
if isinstance(value_ranges, list) and len(value_ranges) > 0:
|
|
684
|
+
if isinstance(value_ranges[0], list):
|
|
685
|
+
if random_select:
|
|
686
|
+
random.seed(hash(frozenset(current.items())) % (2**32))
|
|
687
|
+
selected_range = random.choice(value_ranges)
|
|
688
|
+
new_combo = dict(current)
|
|
689
|
+
new_combo[value_range_key] = selected_range
|
|
690
|
+
new_combos.append(new_combo)
|
|
691
|
+
else:
|
|
692
|
+
for vr in value_ranges:
|
|
693
|
+
new_combo = dict(current)
|
|
694
|
+
new_combo[value_range_key] = vr
|
|
695
|
+
new_combos.append(new_combo)
|
|
696
|
+
else:
|
|
697
|
+
new_combo = dict(current)
|
|
698
|
+
new_combo[value_range_key] = value_ranges
|
|
699
|
+
new_combos.append(new_combo)
|
|
700
|
+
else:
|
|
701
|
+
new_combo = dict(current)
|
|
702
|
+
new_combo[value_range_key] = value_ranges
|
|
703
|
+
new_combos.append(new_combo)
|
|
704
|
+
|
|
705
|
+
current_combos = new_combos if new_combos else current_combos
|
|
706
|
+
|
|
707
|
+
expanded_combos.extend(current_combos)
|
|
708
|
+
|
|
709
|
+
return expanded_combos
|
|
710
|
+
|
|
711
|
+
def derive_non_shape_factors(self, combinations: List[Dict[str, Any]], skip_shape_dependent: bool = True) -> List[Dict[str, Any]]:
|
|
712
|
+
"""
|
|
713
|
+
推导非shape类因子
|
|
714
|
+
|
|
715
|
+
Args:
|
|
716
|
+
combinations: 组合列表
|
|
717
|
+
skip_shape_dependent: 是否跳过依赖shape类因子的因子
|
|
718
|
+
|
|
719
|
+
Returns:
|
|
720
|
+
更新后的组合列表
|
|
721
|
+
|
|
722
|
+
注意:
|
|
723
|
+
只跳过 *.shape 因子,*.dimensions 因子与其他非shape类因子一样正常处理
|
|
724
|
+
skip_shape_dependent=True 时,额外跳过依赖shape类因子的因子
|
|
725
|
+
"""
|
|
726
|
+
sorted_levels = sorted([k for k in self.derivation_order.keys() if k.startswith('level_')])
|
|
727
|
+
|
|
728
|
+
for level_key in sorted_levels:
|
|
729
|
+
level_factors = self.derivation_order[level_key]
|
|
730
|
+
non_shape_factors = [f for f in level_factors if not self.is_shape_factor(f)]
|
|
731
|
+
|
|
732
|
+
if skip_shape_dependent:
|
|
733
|
+
non_shape_factors = [f for f in non_shape_factors if not self.factor_depends_on_shape(f)]
|
|
734
|
+
|
|
735
|
+
if not non_shape_factors:
|
|
736
|
+
continue
|
|
737
|
+
|
|
738
|
+
combinations = self._derive_factors_for_level(combinations, non_shape_factors)
|
|
739
|
+
|
|
740
|
+
return combinations
|
|
741
|
+
|
|
742
|
+
def _derive_factors_for_level(self, combinations: List[Dict[str, Any]], factors: List[str]) -> List[Dict[str, Any]]:
|
|
743
|
+
"""
|
|
744
|
+
为指定因子列表推导取值范围并扩展组合集
|
|
745
|
+
|
|
746
|
+
更新:使用 solve_all_constraints_for_factor 处理多个约束
|
|
747
|
+
"""
|
|
748
|
+
for factor in factors:
|
|
749
|
+
new_combinations = []
|
|
750
|
+
|
|
751
|
+
for combo in combinations:
|
|
752
|
+
if factor in combo:
|
|
753
|
+
new_combinations.append(combo)
|
|
754
|
+
continue
|
|
755
|
+
|
|
756
|
+
result = self.solve_all_constraints_for_factor(factor, combo)
|
|
757
|
+
|
|
758
|
+
if result is not None:
|
|
759
|
+
new_combo = dict(combo)
|
|
760
|
+
new_combo[factor] = result
|
|
761
|
+
new_combinations.append(new_combo)
|
|
762
|
+
# if isinstance(result, list):
|
|
763
|
+
# for value in result:
|
|
764
|
+
# new_combo = dict(combo)
|
|
765
|
+
# new_combo[factor] = value
|
|
766
|
+
# new_combinations.append(new_combo)
|
|
767
|
+
# else:
|
|
768
|
+
# new_combo = dict(combo)
|
|
769
|
+
# new_combo[factor] = result
|
|
770
|
+
# new_combinations.append(new_combo)
|
|
771
|
+
else:
|
|
772
|
+
domain = self.get_factor_domain(factor)
|
|
773
|
+
if domain:
|
|
774
|
+
for value in domain:
|
|
775
|
+
new_combo = dict(combo)
|
|
776
|
+
new_combo[factor] = value
|
|
777
|
+
new_combinations.append(new_combo)
|
|
778
|
+
else:
|
|
779
|
+
new_combinations.append(combo)
|
|
780
|
+
|
|
781
|
+
combinations = new_combinations
|
|
782
|
+
|
|
783
|
+
if not combinations:
|
|
784
|
+
break
|
|
785
|
+
|
|
786
|
+
return combinations
|
|
787
|
+
|
|
788
|
+
def derive_shape_factors(self, combinations: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
789
|
+
"""
|
|
790
|
+
推导shape类因子
|
|
791
|
+
|
|
792
|
+
按照求解配置中的shape因子顺序依次处理:
|
|
793
|
+
1. 优先根据 参数名.dimensions 生成 参数.shape 因子值
|
|
794
|
+
2. 再根据 shape约束关系 更新shape值
|
|
795
|
+
"""
|
|
796
|
+
sorted_levels = sorted([k for k in self.derivation_order.keys() if k.startswith('level_')])
|
|
797
|
+
|
|
798
|
+
for level_key in sorted_levels:
|
|
799
|
+
level_factors = self.derivation_order[level_key]
|
|
800
|
+
|
|
801
|
+
shape_factors = [f for f in level_factors if self.is_shape_factor(f)]
|
|
802
|
+
|
|
803
|
+
dimensions_factors = [f for f in shape_factors if f.endswith('.dimensions')]
|
|
804
|
+
shape_only_factors = [f for f in shape_factors if f.endswith('.shape')]
|
|
805
|
+
|
|
806
|
+
for dim_factor in dimensions_factors:
|
|
807
|
+
combinations = self._derive_single_factor(combinations, dim_factor)
|
|
808
|
+
|
|
809
|
+
for shape_factor in shape_only_factors:
|
|
810
|
+
combinations = self._derive_shape_factor_with_dimensions(combinations, shape_factor)
|
|
811
|
+
|
|
812
|
+
return combinations
|
|
813
|
+
|
|
814
|
+
def derive_shape_dependent_factors(self, combinations: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
815
|
+
"""
|
|
816
|
+
推导依赖shape类因子的因子
|
|
817
|
+
|
|
818
|
+
在shape类因子推导完成后,继续推导那些依赖shape类因子的因子
|
|
819
|
+
"""
|
|
820
|
+
sorted_levels = sorted([k for k in self.derivation_order.keys() if k.startswith('level_')])
|
|
821
|
+
|
|
822
|
+
for level_key in sorted_levels:
|
|
823
|
+
level_factors = self.derivation_order[level_key]
|
|
824
|
+
|
|
825
|
+
shape_dependent_factors = [
|
|
826
|
+
f for f in level_factors
|
|
827
|
+
if not self.is_shape_factor(f) and self.factor_depends_on_shape(f)
|
|
828
|
+
]
|
|
829
|
+
|
|
830
|
+
if not shape_dependent_factors:
|
|
831
|
+
continue
|
|
832
|
+
|
|
833
|
+
combinations = self._derive_factors_for_level(combinations, shape_dependent_factors)
|
|
834
|
+
|
|
835
|
+
return combinations
|
|
836
|
+
|
|
837
|
+
def _is_enum_param(self, param_name: str, sample_combo: Dict[str, Any]) -> bool:
|
|
838
|
+
"""
|
|
839
|
+
判断参数是否为枚举类型
|
|
840
|
+
|
|
841
|
+
Args:
|
|
842
|
+
param_name: 参数名
|
|
843
|
+
sample_combo: 采样组合(用于检查因子)
|
|
844
|
+
|
|
845
|
+
Returns:
|
|
846
|
+
True 如果是枚举参数,否则 False
|
|
847
|
+
|
|
848
|
+
判断标准:
|
|
849
|
+
- 定义了 param.enum_values 因子
|
|
850
|
+
- 未定义 param.value 因子
|
|
851
|
+
"""
|
|
852
|
+
enum_values_factor = f'{param_name}.enum_values'
|
|
853
|
+
value_factor = f'{param_name}.value'
|
|
854
|
+
|
|
855
|
+
# 判断条件:定义了 enum_values 且未定义 value
|
|
856
|
+
has_enum_values = enum_values_factor in sample_combo
|
|
857
|
+
has_value = value_factor in sample_combo
|
|
858
|
+
|
|
859
|
+
return has_enum_values and not has_value
|
|
860
|
+
|
|
861
|
+
def expand_value_factors(self, combinations: List[Dict[str, Any]], enum_only: bool = False) -> List[Dict[str, Any]]:
|
|
862
|
+
"""
|
|
863
|
+
扩展非tensor类参数的value因子
|
|
864
|
+
|
|
865
|
+
Args:
|
|
866
|
+
combinations: 组合列表
|
|
867
|
+
enum_only: 是否只处理枚举类型参数
|
|
868
|
+
- False(默认):处理所有非tensor类参数(枚举 + 非枚举)
|
|
869
|
+
- True:只处理枚举类型参数
|
|
870
|
+
|
|
871
|
+
对于非tensor类参数(没有shape因子的参数),根据不同场景生成value:
|
|
872
|
+
场景1:存在参数名.enum_values - 扩展参数名.value因子,取值与enum_values相等
|
|
873
|
+
场景2:存在参数名.value_range - 扩展参数名.value因子,调用generate_random_value_by_dtype生成随机值
|
|
874
|
+
"""
|
|
875
|
+
non_tensor_params = self._find_non_tensor_params()
|
|
876
|
+
|
|
877
|
+
if not non_tensor_params:
|
|
878
|
+
return combinations
|
|
879
|
+
|
|
880
|
+
result_combos = list(combinations)
|
|
881
|
+
|
|
882
|
+
for param_name in non_tensor_params:
|
|
883
|
+
value_factor = f'{param_name}.value'
|
|
884
|
+
enum_values_factor = f'{param_name}.enum_values'
|
|
885
|
+
value_range_factor = f'{param_name}.value_range'
|
|
886
|
+
dtype_factor = f'{param_name}.dtype'
|
|
887
|
+
|
|
888
|
+
# 检查是否为枚举类型参数
|
|
889
|
+
is_enum_param = self._is_enum_param(param_name, result_combos[0] if result_combos else {})
|
|
890
|
+
|
|
891
|
+
# 如果 enum_only=True 且不是枚举参数,跳过
|
|
892
|
+
if enum_only and not is_enum_param:
|
|
893
|
+
continue
|
|
894
|
+
|
|
895
|
+
new_result = []
|
|
896
|
+
|
|
897
|
+
for combo in result_combos:
|
|
898
|
+
if value_factor in combo:
|
|
899
|
+
new_result.append(combo)
|
|
900
|
+
continue
|
|
901
|
+
|
|
902
|
+
enum_values = combo.get(enum_values_factor)
|
|
903
|
+
value_range = combo.get(value_range_factor)
|
|
904
|
+
dtype_value = combo.get(dtype_factor)
|
|
905
|
+
|
|
906
|
+
if enum_values is not None:
|
|
907
|
+
if isinstance(enum_values, list):
|
|
908
|
+
for enum_val in enum_values:
|
|
909
|
+
new_combo = dict(combo)
|
|
910
|
+
new_combo[value_factor] = enum_val
|
|
911
|
+
new_result.append(new_combo)
|
|
912
|
+
else:
|
|
913
|
+
new_combo = dict(combo)
|
|
914
|
+
new_combo[value_factor] = enum_values
|
|
915
|
+
new_result.append(new_combo)
|
|
916
|
+
|
|
917
|
+
# 非枚举参数处理:从 value_range 生成 value
|
|
918
|
+
# 只在 enum_only=False 时处理
|
|
919
|
+
elif value_range is not None and not enum_only:
|
|
920
|
+
if dtype_value is None:
|
|
921
|
+
dtype_value = 'float32'
|
|
922
|
+
|
|
923
|
+
if isinstance(value_range, list) and len(value_range) == 2:
|
|
924
|
+
try:
|
|
925
|
+
signed_zero = self._check_signed_zero_range(value_range)
|
|
926
|
+
if signed_zero is not None:
|
|
927
|
+
new_combo = dict(combo)
|
|
928
|
+
new_combo[value_factor] = signed_zero
|
|
929
|
+
new_result.append(new_combo)
|
|
930
|
+
else:
|
|
931
|
+
hashable_combo = frozenset((k, self._make_hashable(v)) for k, v in combo.items())
|
|
932
|
+
random.seed(hash(hashable_combo) % (2**32))
|
|
933
|
+
random_value = generate_random_value_by_dtype(dtype_value, value_range)
|
|
934
|
+
new_combo = dict(combo)
|
|
935
|
+
new_combo[value_factor] = random_value
|
|
936
|
+
new_result.append(new_combo)
|
|
937
|
+
except Exception:
|
|
938
|
+
new_result.append(combo)
|
|
939
|
+
else:
|
|
940
|
+
new_result.append(combo)
|
|
941
|
+
else:
|
|
942
|
+
new_result.append(combo)
|
|
943
|
+
|
|
944
|
+
result_combos = new_result
|
|
945
|
+
|
|
946
|
+
return result_combos
|
|
947
|
+
|
|
948
|
+
def _find_non_tensor_params(self) -> List[str]:
|
|
949
|
+
"""
|
|
950
|
+
查找非tensor类参数(没有shape因子的参数)
|
|
951
|
+
|
|
952
|
+
Returns:
|
|
953
|
+
非tensor类参数名称列表
|
|
954
|
+
"""
|
|
955
|
+
non_tensor_params = []
|
|
956
|
+
|
|
957
|
+
for param_name, param_data in self.test_factors.items():
|
|
958
|
+
factors = param_data.get('factors', {})
|
|
959
|
+
param_type = param_data.get('type', '')
|
|
960
|
+
|
|
961
|
+
if 'Tensor' not in param_type and 'tensor' not in param_type:
|
|
962
|
+
non_tensor_params.append(param_name)
|
|
963
|
+
|
|
964
|
+
# if param_type == 'scalar':
|
|
965
|
+
# non_tensor_params.append(param_name)
|
|
966
|
+
# continue
|
|
967
|
+
|
|
968
|
+
# has_shape = any(
|
|
969
|
+
# k.endswith('.shape') or k.endswith('.dimensions')
|
|
970
|
+
# for k in factors.keys()
|
|
971
|
+
# )
|
|
972
|
+
|
|
973
|
+
# if not has_shape:
|
|
974
|
+
# has_value_factor = any(
|
|
975
|
+
# k.endswith('.value') or k.endswith('.value_range')
|
|
976
|
+
# for k in factors.keys()
|
|
977
|
+
# )
|
|
978
|
+
# if has_value_factor:
|
|
979
|
+
# non_tensor_params.append(param_name)
|
|
980
|
+
|
|
981
|
+
return non_tensor_params
|
|
982
|
+
|
|
983
|
+
def _derive_single_factor(self, combinations: List[Dict[str, Any]], factor: str) -> List[Dict[str, Any]]:
|
|
984
|
+
"""
|
|
985
|
+
推导单个因子
|
|
986
|
+
|
|
987
|
+
更新:使用 solve_all_constraints_for_factor 处理多个约束
|
|
988
|
+
"""
|
|
989
|
+
new_combinations = []
|
|
990
|
+
|
|
991
|
+
for combo in combinations:
|
|
992
|
+
if factor in combo:
|
|
993
|
+
new_combinations.append(combo)
|
|
994
|
+
continue
|
|
995
|
+
|
|
996
|
+
result = self.solve_all_constraints_for_factor(factor, combo)
|
|
997
|
+
|
|
998
|
+
if result is not None:
|
|
999
|
+
new_combo = dict(combo)
|
|
1000
|
+
new_combo[factor] = result
|
|
1001
|
+
new_combinations.append(new_combo)
|
|
1002
|
+
# if isinstance(result, list):
|
|
1003
|
+
# # for value in result:
|
|
1004
|
+
# # new_combo = dict(combo)
|
|
1005
|
+
# # new_combo[factor] = value
|
|
1006
|
+
# # new_combinations.append(new_combo)
|
|
1007
|
+
# value = random.choice(result)
|
|
1008
|
+
# new_combo = dict(combo)
|
|
1009
|
+
# new_combo[factor] = value
|
|
1010
|
+
# new_combinations.append(new_combo)
|
|
1011
|
+
# else:
|
|
1012
|
+
# new_combo = dict(combo)
|
|
1013
|
+
# new_combo[factor] = result
|
|
1014
|
+
# new_combinations.append(new_combo)
|
|
1015
|
+
else:
|
|
1016
|
+
if factor.endswith('.value'):
|
|
1017
|
+
param_name = factor.split('.')[0]
|
|
1018
|
+
value_range = combo.get(f'{param_name}.value_range')
|
|
1019
|
+
dtype_value = combo.get(f'{param_name}.dtype', 'float32')
|
|
1020
|
+
if value_range is not None and isinstance(value_range, list) and len(value_range) == 2:
|
|
1021
|
+
hashable_combo = frozenset((k, self._make_hashable(v)) for k, v in combo.items())
|
|
1022
|
+
seed = hash(hashable_combo) % (2**32)
|
|
1023
|
+
scalar_value = generate_random_value_by_dtype(dtype_value, value_range, seed=seed)
|
|
1024
|
+
if not isinstance(scalar_value, list):
|
|
1025
|
+
new_combo = dict(combo)
|
|
1026
|
+
new_combo[factor] = scalar_value
|
|
1027
|
+
new_combinations.append(new_combo)
|
|
1028
|
+
continue
|
|
1029
|
+
new_combinations.append(combo)
|
|
1030
|
+
else:
|
|
1031
|
+
domain = self.get_factor_domain(factor)
|
|
1032
|
+
if domain:
|
|
1033
|
+
value = random.choice(domain)
|
|
1034
|
+
new_combo = dict(combo)
|
|
1035
|
+
new_combo[factor] = value
|
|
1036
|
+
new_combinations.append(new_combo)
|
|
1037
|
+
else:
|
|
1038
|
+
new_combinations.append(combo)
|
|
1039
|
+
|
|
1040
|
+
return new_combinations
|
|
1041
|
+
|
|
1042
|
+
def _derive_shape_factor_with_dimensions(self, combinations: List[Dict[str, Any]], shape_factor: str) -> List[Dict[str, Any]]:
|
|
1043
|
+
"""
|
|
1044
|
+
根据dimensions因子生成shape因子值
|
|
1045
|
+
|
|
1046
|
+
调用utils.py中的generate_random_shape生成shape
|
|
1047
|
+
|
|
1048
|
+
更新:使用 solve_all_constraints_for_factor 处理多个约束
|
|
1049
|
+
"""
|
|
1050
|
+
param_name = shape_factor.split('.')[0]
|
|
1051
|
+
dim_factor = f'{param_name}.dimensions'
|
|
1052
|
+
|
|
1053
|
+
new_combinations = []
|
|
1054
|
+
|
|
1055
|
+
for idx, combo in enumerate(combinations):
|
|
1056
|
+
if shape_factor not in combo:
|
|
1057
|
+
dimensions_value = combo.get(dim_factor)
|
|
1058
|
+
if dimensions_value is not None and isinstance(dimensions_value, int):
|
|
1059
|
+
hashable_combo = frozenset((k, self._make_hashable(v)) for k, v in combo.items())
|
|
1060
|
+
random.seed(hash(hashable_combo) % (2**32))
|
|
1061
|
+
shape_value = generate_random_shape(dimensions_value)
|
|
1062
|
+
combo[shape_factor] = shape_value
|
|
1063
|
+
|
|
1064
|
+
constraint_result = self.solve_all_constraints_for_factor(shape_factor, combo)
|
|
1065
|
+
|
|
1066
|
+
if constraint_result is not None:
|
|
1067
|
+
if isinstance(constraint_result, list) and constraint_result:
|
|
1068
|
+
if isinstance(constraint_result[0], list):
|
|
1069
|
+
for shape_value in constraint_result:
|
|
1070
|
+
new_combo = dict(combo)
|
|
1071
|
+
new_combo[shape_factor] = shape_value
|
|
1072
|
+
new_combinations.append(new_combo)
|
|
1073
|
+
else:
|
|
1074
|
+
new_combo = dict(combo)
|
|
1075
|
+
new_combo[shape_factor] = constraint_result
|
|
1076
|
+
new_combinations.append(new_combo)
|
|
1077
|
+
else:
|
|
1078
|
+
new_combo = dict(combo)
|
|
1079
|
+
new_combo[shape_factor] = constraint_result
|
|
1080
|
+
new_combinations.append(new_combo)
|
|
1081
|
+
continue
|
|
1082
|
+
|
|
1083
|
+
else:
|
|
1084
|
+
new_combinations.append(combo)
|
|
1085
|
+
|
|
1086
|
+
return new_combinations
|
|
1087
|
+
|
|
1088
|
+
def generate_complete_cases(self, anchor_combinations: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
1089
|
+
"""
|
|
1090
|
+
生成完整的测试用例
|
|
1091
|
+
|
|
1092
|
+
处理流程(简化版):
|
|
1093
|
+
1. 按 06_求解配置.yaml 的层级顺序求解所有因子
|
|
1094
|
+
2. 所有约束(包括隐式约束)统一处理
|
|
1095
|
+
"""
|
|
1096
|
+
combinations = list(anchor_combinations)
|
|
1097
|
+
|
|
1098
|
+
# 按 derivation_order 顺序求解所有因子
|
|
1099
|
+
sorted_levels = sorted([k for k in self.derivation_order.keys() if k.startswith('level_')])
|
|
1100
|
+
|
|
1101
|
+
for level_key in sorted_levels:
|
|
1102
|
+
level_factors = self.derivation_order[level_key]
|
|
1103
|
+
|
|
1104
|
+
# 调整 shape 和 dimensions 的顺序(dimensions 在前)
|
|
1105
|
+
level_factors = self.adjust_shape_dimensions_order(level_factors)
|
|
1106
|
+
|
|
1107
|
+
for factor in level_factors:
|
|
1108
|
+
combinations = self._derive_single_factor(combinations, factor)
|
|
1109
|
+
|
|
1110
|
+
return combinations
|
|
1111
|
+
|
|
1112
|
+
def adjust_shape_dimensions_order(self, level_factors: list[str]) -> list[str]:
|
|
1113
|
+
"""
|
|
1114
|
+
调整level_factors顺序:相同参数名的元素中,确保参数名.dimensions在参数名.shape前面
|
|
1115
|
+
核心:直接在原列表中交换shape和dimensions的位置,不影响其他元素顺序
|
|
1116
|
+
"""
|
|
1117
|
+
# 复制原列表,避免修改输入
|
|
1118
|
+
result = level_factors.copy()
|
|
1119
|
+
|
|
1120
|
+
# 遍历每个元素,找到需要调整的shape位置
|
|
1121
|
+
for i in range(len(result)):
|
|
1122
|
+
current = result[i]
|
|
1123
|
+
if not current.endswith('.shape'):
|
|
1124
|
+
continue
|
|
1125
|
+
|
|
1126
|
+
# 拆分参数名和因子名
|
|
1127
|
+
param_name = current.split('.')[0]
|
|
1128
|
+
dimensions_item = f"{param_name}.dimensions"
|
|
1129
|
+
|
|
1130
|
+
# 查找当前shape之后是否有对应的dimensions
|
|
1131
|
+
for j in range(i + 1, len(result)):
|
|
1132
|
+
if result[j] == dimensions_item:
|
|
1133
|
+
# 交换位置:将dimensions移到shape前面
|
|
1134
|
+
# 步骤1:删除j位置的dimensions
|
|
1135
|
+
dim_item = result.pop(j)
|
|
1136
|
+
# 步骤2:插入到shape(i位置)前面
|
|
1137
|
+
result.insert(i, dim_item)
|
|
1138
|
+
# 调整后跳出内层循环,避免重复处理
|
|
1139
|
+
break
|
|
1140
|
+
|
|
1141
|
+
return result
|
|
1142
|
+
|
|
1143
|
+
def derive_shape_and_dependent_factors(self, combinations: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
1144
|
+
"""
|
|
1145
|
+
推导shape类因子和依赖shape类因子的因子
|
|
1146
|
+
|
|
1147
|
+
按层级顺序处理:
|
|
1148
|
+
1. 先处理dimensions因子
|
|
1149
|
+
2. 再处理shape因子(可能依赖dimensions)z
|
|
1150
|
+
3. 最后处理依赖shape类因子的非shape因子
|
|
1151
|
+
"""
|
|
1152
|
+
sorted_levels = sorted([k for k in self.derivation_order.keys() if k.startswith('level_')])
|
|
1153
|
+
|
|
1154
|
+
for level_key in sorted_levels:
|
|
1155
|
+
level_factors = self.derivation_order[level_key]
|
|
1156
|
+
level_factors = self.adjust_shape_dimensions_order(level_factors)
|
|
1157
|
+
for factor in level_factors:
|
|
1158
|
+
if factor.endswith('.shape'):
|
|
1159
|
+
combinations = self._derive_shape_factor_with_dimensions(combinations, factor)
|
|
1160
|
+
else:
|
|
1161
|
+
combinations = self._derive_single_factor(combinations, factor)
|
|
1162
|
+
|
|
1163
|
+
return combinations
|
|
1164
|
+
|
|
1165
|
+
def generate_all_cases(self, max_cases: int = 10000) -> List[Dict[str, Any]]:
|
|
1166
|
+
anchor_combinations = self.generate_bc_combinations(max_cases)
|
|
1167
|
+
|
|
1168
|
+
all_cases = self.generate_complete_cases(anchor_combinations)
|
|
1169
|
+
while len(all_cases) < max_cases:
|
|
1170
|
+
all_cases = all_cases + self.generate_complete_cases(anchor_combinations)
|
|
1171
|
+
return all_cases[:max_cases]
|
|
1172
|
+
|
|
1173
|
+
def save_to_csv(self, cases: List[Dict[str, Any]], output_path: str):
|
|
1174
|
+
"""保存到CSV文件"""
|
|
1175
|
+
if not cases:
|
|
1176
|
+
return
|
|
1177
|
+
|
|
1178
|
+
all_factors = set()
|
|
1179
|
+
for case in cases:
|
|
1180
|
+
all_factors.update(case.keys())
|
|
1181
|
+
|
|
1182
|
+
sorted_factors = sorted(all_factors)
|
|
1183
|
+
|
|
1184
|
+
def format_value(v):
|
|
1185
|
+
if isinstance(v, list):
|
|
1186
|
+
return str(v)
|
|
1187
|
+
if isinstance(v, float):
|
|
1188
|
+
if v != v:
|
|
1189
|
+
return "'nan'"
|
|
1190
|
+
elif v == float('inf'):
|
|
1191
|
+
return "'inf'"
|
|
1192
|
+
elif v == float('-inf'):
|
|
1193
|
+
return "'-inf'"
|
|
1194
|
+
elif v == 0.0:
|
|
1195
|
+
if math.copysign(1, v) < 0:
|
|
1196
|
+
return '-0'
|
|
1197
|
+
else:
|
|
1198
|
+
return '+0'
|
|
1199
|
+
return v
|
|
1200
|
+
|
|
1201
|
+
with open(output_path, 'w', newline='', encoding='utf-8') as f:
|
|
1202
|
+
writer = csv.DictWriter(f, fieldnames=sorted_factors)
|
|
1203
|
+
writer.writeheader()
|
|
1204
|
+
for case in cases:
|
|
1205
|
+
formatted_case = {k: format_value(v) for k, v in case.items()}
|
|
1206
|
+
writer.writerow(formatted_case)
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
def print_summary(cases: List[Dict[str, Any]]):
|
|
1210
|
+
"""打印摘要"""
|
|
1211
|
+
print("\n" + "=" * 70)
|
|
1212
|
+
print("因子取值生成摘要")
|
|
1213
|
+
print("=" * 70)
|
|
1214
|
+
|
|
1215
|
+
print(f"\n生成用例数: {len(cases)}")
|
|
1216
|
+
|
|
1217
|
+
if cases:
|
|
1218
|
+
all_factors = set()
|
|
1219
|
+
for case in cases:
|
|
1220
|
+
all_factors.update(case.keys())
|
|
1221
|
+
|
|
1222
|
+
print(f"因子总数: {len(all_factors)}")
|
|
1223
|
+
|
|
1224
|
+
dtype_factors = [f for f in all_factors if '.dtype' in f]
|
|
1225
|
+
shape_factors = [f for f in all_factors if '.shape' in f]
|
|
1226
|
+
exist_factors = [f for f in all_factors if '.exist' in f]
|
|
1227
|
+
value_range_factors = [f for f in all_factors if '.value_range' in f]
|
|
1228
|
+
|
|
1229
|
+
print(f"\n因子类型分布:")
|
|
1230
|
+
print(f" - dtype 因子: {len(dtype_factors)}个")
|
|
1231
|
+
print(f" - shape 因子: {len(shape_factors)}个")
|
|
1232
|
+
print(f" - exist 因子: {len(exist_factors)}个")
|
|
1233
|
+
print(f" - value_range 因子: {len(value_range_factors)}个")
|
|
1234
|
+
|
|
1235
|
+
print(f"\n前3个用例预览:")
|
|
1236
|
+
for i, case in enumerate(cases[:3]):
|
|
1237
|
+
dtype_info = {k: v for k, v in case.items() if '.dtype' in k or '.value_range' in k}
|
|
1238
|
+
print(f" 用例{i+1}: {dtype_info}")
|
|
1239
|
+
|
|
1240
|
+
print("\n" + "=" * 70)
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
def main():
|
|
1244
|
+
if len(sys.argv) < 4:
|
|
1245
|
+
print("使用方法: python generate_factor_values.py <求解配置.yaml> <约束定义.yaml> <测试因子.yaml> [输出.csv] [--max-cases N]")
|
|
1246
|
+
print("示例: python generate_factor_values.py 07_求解配置.yaml 05_约束定义.yaml 04_测试因子.yaml factor_values.csv --max-cases 100")
|
|
1247
|
+
sys.exit(1)
|
|
1248
|
+
|
|
1249
|
+
solver_config_path = sys.argv[1]
|
|
1250
|
+
constraints_path = sys.argv[2]
|
|
1251
|
+
factors_path = sys.argv[3]
|
|
1252
|
+
output_path = sys.argv[4] if len(sys.argv) > 4 and not sys.argv[4].startswith('--') else 'factor_values.csv'
|
|
1253
|
+
|
|
1254
|
+
max_cases = 10000
|
|
1255
|
+
for i, arg in enumerate(sys.argv):
|
|
1256
|
+
if arg == '--max-cases' and i + 1 < len(sys.argv):
|
|
1257
|
+
max_cases = int(sys.argv[i + 1])
|
|
1258
|
+
|
|
1259
|
+
for path in [solver_config_path, constraints_path, factors_path]:
|
|
1260
|
+
if not Path(path).exists():
|
|
1261
|
+
print(f"错误: 文件不存在: {path}")
|
|
1262
|
+
sys.exit(1)
|
|
1263
|
+
|
|
1264
|
+
print(f"正在读取配置文件...")
|
|
1265
|
+
print(f" - 求解配置: {solver_config_path}")
|
|
1266
|
+
print(f" - 约束定义: {constraints_path}")
|
|
1267
|
+
print(f" - 测试因子: {factors_path}")
|
|
1268
|
+
|
|
1269
|
+
generator = FactorValueGenerator()
|
|
1270
|
+
generator.load_configs(solver_config_path, constraints_path, factors_path)
|
|
1271
|
+
|
|
1272
|
+
print(f"\n锚点因子: {len(generator.anchors)}个")
|
|
1273
|
+
print(f"推导层级: {len(generator.derivation_order)}层")
|
|
1274
|
+
|
|
1275
|
+
print(f"\n正在生成测试用例 (最大 {max_cases} 个)...")
|
|
1276
|
+
cases = generator.generate_all_cases(max_cases)
|
|
1277
|
+
|
|
1278
|
+
print(f"正在保存到: {output_path}")
|
|
1279
|
+
generator.save_to_csv(cases, output_path)
|
|
1280
|
+
|
|
1281
|
+
print_summary(cases)
|
|
1282
|
+
|
|
1283
|
+
print(f"\n✅ 因子取值已保存到: {output_path}")
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
if __name__ == "__main__":
|
|
1287
|
+
main()
|