@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,1555 @@
|
|
|
1
|
+
# ----------------------------------------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) 2026 Huawei Technologies Co., Ltd.
|
|
3
|
+
# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
|
|
4
|
+
# CANN Open Software License Agreement Version 2.0 (the "License").
|
|
5
|
+
# Please refer to the License for details. You may not use this file except in compliance with the License.
|
|
6
|
+
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
|
7
|
+
# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
8
|
+
# See LICENSE in the root of the software repository for the full text of the License.
|
|
9
|
+
# ----------------------------------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import json
|
|
14
|
+
import logging
|
|
15
|
+
import math
|
|
16
|
+
import re
|
|
17
|
+
import statistics
|
|
18
|
+
from collections import defaultdict
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import Any, Dict, Iterator, List, Mapping, NamedTuple, Optional, Sequence, Tuple
|
|
21
|
+
from visualize_common import (
|
|
22
|
+
ArtifactSet,
|
|
23
|
+
flatten_numeric,
|
|
24
|
+
humanize_key,
|
|
25
|
+
iter_dicts,
|
|
26
|
+
mean,
|
|
27
|
+
metric_is_percent,
|
|
28
|
+
percentile,
|
|
29
|
+
to_float,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
logger = logging.getLogger(__name__)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _parse_embedded_blob(data: bytes, start: int, end: int) -> Tuple[int, Optional[Dict[str, Any]]]:
|
|
36
|
+
"""Parse the balanced blob ``data[start:end + 1]``.
|
|
37
|
+
|
|
38
|
+
Returns ``(next_index, record)``. An unparseable blob yields
|
|
39
|
+
``(start + 1, None)`` so the caller resumes its garbage-skipping rescan one
|
|
40
|
+
byte later; valid JSON that is not a dict yields ``(end + 1, None)``.
|
|
41
|
+
"""
|
|
42
|
+
blob = data[start:end + 1]
|
|
43
|
+
try:
|
|
44
|
+
obj = json.loads(blob.decode("utf-8"))
|
|
45
|
+
except Exception:
|
|
46
|
+
return start + 1, None
|
|
47
|
+
record = obj if isinstance(obj, dict) else None
|
|
48
|
+
return end + 1, record
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _string_scan_state(c: int, in_string: bool, escaped: bool) -> Tuple[bool, bool]:
|
|
52
|
+
"""Advance the string/escape state machine for one byte inside a string."""
|
|
53
|
+
if escaped:
|
|
54
|
+
return in_string, False
|
|
55
|
+
if c == 92:
|
|
56
|
+
return in_string, True
|
|
57
|
+
if c == 34:
|
|
58
|
+
return False, False
|
|
59
|
+
return in_string, escaped
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _scan_embedded_candidate(data: bytes, start: int, n: int) -> Tuple[int, Optional[Dict[str, Any]]]:
|
|
63
|
+
"""Scan one candidate JSON object beginning at ``start``.
|
|
64
|
+
|
|
65
|
+
Returns ``(next_index, record)``; see ``_parse_embedded_blob`` for the
|
|
66
|
+
rescan semantics of unparseable candidates.
|
|
67
|
+
"""
|
|
68
|
+
depth = 0
|
|
69
|
+
in_string = False
|
|
70
|
+
escaped = False
|
|
71
|
+
for j in range(start, n):
|
|
72
|
+
c = data[j]
|
|
73
|
+
if in_string:
|
|
74
|
+
in_string, escaped = _string_scan_state(c, in_string, escaped)
|
|
75
|
+
continue
|
|
76
|
+
if c == 34:
|
|
77
|
+
in_string = True
|
|
78
|
+
continue
|
|
79
|
+
if c == 123:
|
|
80
|
+
depth += 1
|
|
81
|
+
continue
|
|
82
|
+
if c != 125:
|
|
83
|
+
continue
|
|
84
|
+
depth -= 1
|
|
85
|
+
if depth == 0:
|
|
86
|
+
return _parse_embedded_blob(data, start, j)
|
|
87
|
+
return start + 1, None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def extract_embedded_json_records(data: bytes) -> List[Dict[str, Any]]:
|
|
91
|
+
records: List[Dict[str, Any]] = []
|
|
92
|
+
i, n = 0, len(data)
|
|
93
|
+
while i < n:
|
|
94
|
+
start = data.find(b"{", i)
|
|
95
|
+
if start < 0:
|
|
96
|
+
break
|
|
97
|
+
i, record = _scan_embedded_candidate(data, start, n)
|
|
98
|
+
if record is not None:
|
|
99
|
+
records.append(record)
|
|
100
|
+
return records
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def load_visualize_records(path: Optional[Path]) -> List[Dict[str, Any]]:
|
|
104
|
+
if not path or not path.is_file() or path.stat().st_size == 0:
|
|
105
|
+
return []
|
|
106
|
+
try:
|
|
107
|
+
return extract_embedded_json_records(path.read_bytes())
|
|
108
|
+
except Exception as exc:
|
|
109
|
+
logger.debug("Failed to load visualize records from %s: %s", path, exc)
|
|
110
|
+
return []
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def collect_advice(records: Sequence[Mapping[str, Any]]) -> List[str]:
|
|
114
|
+
found: List[str] = []
|
|
115
|
+
|
|
116
|
+
def add(value: Any) -> None:
|
|
117
|
+
if value is None:
|
|
118
|
+
return
|
|
119
|
+
if isinstance(value, str):
|
|
120
|
+
for line in value.splitlines():
|
|
121
|
+
cleaned = re.sub(r"^[\s\t\-\d\)\.]+", "", line).strip()
|
|
122
|
+
if cleaned and cleaned not in found:
|
|
123
|
+
found.append(cleaned)
|
|
124
|
+
elif isinstance(value, list):
|
|
125
|
+
for item in value:
|
|
126
|
+
add(item)
|
|
127
|
+
elif isinstance(value, Mapping):
|
|
128
|
+
for item in value.values():
|
|
129
|
+
add(item)
|
|
130
|
+
|
|
131
|
+
for record in records:
|
|
132
|
+
if "advice" in record:
|
|
133
|
+
add(record.get("advice"))
|
|
134
|
+
for obj in iter_dicts(record):
|
|
135
|
+
if obj is record:
|
|
136
|
+
continue
|
|
137
|
+
if "advice" in obj:
|
|
138
|
+
add(obj.get("advice"))
|
|
139
|
+
return found
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def parse_block_detail(records: Sequence[Mapping[str, Any]]) -> List[Dict[str, Any]]:
|
|
143
|
+
for record in records:
|
|
144
|
+
detail = record.get("block_detail")
|
|
145
|
+
if not isinstance(detail, Mapping):
|
|
146
|
+
continue
|
|
147
|
+
headers = [str(h) for h in (detail.get("head_name") or [])]
|
|
148
|
+
rows: List[Dict[str, Any]] = []
|
|
149
|
+
for item in detail.get("row") or []:
|
|
150
|
+
values = list(item.get("value") or []) if isinstance(item, Mapping) else []
|
|
151
|
+
row: Dict[str, Any] = {}
|
|
152
|
+
for h, v in zip(headers, values):
|
|
153
|
+
row[h] = v
|
|
154
|
+
rows.append(row)
|
|
155
|
+
return rows
|
|
156
|
+
return []
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def parse_basic(records: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
160
|
+
for record in records:
|
|
161
|
+
detail = record.get("block_detail")
|
|
162
|
+
if not isinstance(detail, Mapping):
|
|
163
|
+
continue
|
|
164
|
+
blocks: List[Dict[str, Any]] = []
|
|
165
|
+
for row in parse_block_detail([record]):
|
|
166
|
+
block_id = next((v for k, v in row.items() if "block" in k.lower() and "id" in k.lower()), None)
|
|
167
|
+
core_type = next((v for k, v in row.items() if "core" in k.lower() and "type" in k.lower()), "")
|
|
168
|
+
duration = next((v for k, v in row.items() if "duration" in k.lower()), None)
|
|
169
|
+
duration_us = to_float(duration)
|
|
170
|
+
if block_id is None or duration_us is None:
|
|
171
|
+
continue
|
|
172
|
+
blocks.append({"block_id": str(block_id), "core_type": str(core_type or ""), "duration_us": duration_us})
|
|
173
|
+
current_freq = to_float(record.get("cur_freq"))
|
|
174
|
+
rated_freq = to_float(record.get("rated_freq"))
|
|
175
|
+
frequency_ratio = None
|
|
176
|
+
if current_freq is not None and rated_freq not in (None, 0):
|
|
177
|
+
frequency_ratio = current_freq / rated_freq * 100.0
|
|
178
|
+
return {
|
|
179
|
+
"available": True,
|
|
180
|
+
"name": str(record.get("name", "")),
|
|
181
|
+
"duration_us": to_float(record.get("duration")),
|
|
182
|
+
"op_type": str(record.get("op_type", "")),
|
|
183
|
+
"block_dim": str(record.get("block_dim", "")),
|
|
184
|
+
"mix_block_dim": str(record.get("mix_block_dim", "")),
|
|
185
|
+
"soc": str(record.get("soc", "")),
|
|
186
|
+
"device_id": str(record.get("device_id", "")),
|
|
187
|
+
"current_frequency_mhz": current_freq,
|
|
188
|
+
"rated_frequency_mhz": rated_freq,
|
|
189
|
+
"frequency_ratio_percent": frequency_ratio,
|
|
190
|
+
"blocks": blocks,
|
|
191
|
+
}
|
|
192
|
+
return {"available": False, "blocks": []}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
OCCUPANCY_PACKED_LAYOUTS: Dict[str, Dict[str, Any]] = {
|
|
196
|
+
# Exact SoC string emitted by the supplied Ascend 950 profiler payload.
|
|
197
|
+
"ASCEND950PR9579": {
|
|
198
|
+
"lanes_per_core": 2,
|
|
199
|
+
# Source-slot order verified against the authoritative Ascend 950 occupancy view.
|
|
200
|
+
# Unlisted groups keep source order; raw IDs are always retained.
|
|
201
|
+
"slot_order": {
|
|
202
|
+
0: [1, 2, 3, 0],
|
|
203
|
+
1: [0, 1, 2, 3],
|
|
204
|
+
2: [0, 1, 2, 3],
|
|
205
|
+
3: [3, 2, 1, 0],
|
|
206
|
+
4: [0, 1, 2, 3],
|
|
207
|
+
5: [0, 1, 2, 3],
|
|
208
|
+
6: [0, 1, 2, 3],
|
|
209
|
+
128: [0, 3, 1, 2],
|
|
210
|
+
129: [0, 1, 2, 3],
|
|
211
|
+
130: [0, 1, 2, 3],
|
|
212
|
+
131: [3, 2, 1, 0],
|
|
213
|
+
132: [0, 1, 2, 3],
|
|
214
|
+
133: [0, 1, 2, 3],
|
|
215
|
+
134: [0, 1, 2, 3],
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
OCCUPANCY_PACKED_LAYOUT_ALIASES: Dict[str, str] = {
|
|
222
|
+
"910A5": "ASCEND950PR9579",
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def normalize_soc_name(value: Any) -> str:
|
|
227
|
+
return re.sub(r"[^A-Za-z0-9]", "", str(value or "")).upper()
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def occupancy_packed_schema(raw_items: Sequence[Mapping[str, Any]], soc: str) -> Optional[Dict[str, Any]]:
|
|
231
|
+
if not raw_items:
|
|
232
|
+
return None
|
|
233
|
+
grouped: Dict[str, List[Mapping[str, Any]]] = defaultdict(list)
|
|
234
|
+
for item in raw_items:
|
|
235
|
+
grouped[str(item.get("raw_core_id", ""))].append(item)
|
|
236
|
+
duplicate_groups = [rows for rows in grouped.values() if len(rows) > 1]
|
|
237
|
+
if not duplicate_groups:
|
|
238
|
+
return None
|
|
239
|
+
# Packed schema signature: repeated raw core IDs, identical nested subcore IDs,
|
|
240
|
+
# and one engine family. This avoids rewriting ordinary multi-subcore payloads.
|
|
241
|
+
repeated_subcore_ids = all(len({str(x.get("raw_subcore_id", "")) for x in rows}) == 1 for rows in duplicate_groups)
|
|
242
|
+
engine_types = {str(x.get("subcore_type", "")).lower() for x in raw_items if str(x.get("subcore_type", "")).strip()}
|
|
243
|
+
if not repeated_subcore_ids or len(engine_types) != 1:
|
|
244
|
+
return None
|
|
245
|
+
normalized_soc = normalize_soc_name(soc)
|
|
246
|
+
layout_key = OCCUPANCY_PACKED_LAYOUT_ALIASES.get(normalized_soc, normalized_soc)
|
|
247
|
+
layout = OCCUPANCY_PACKED_LAYOUTS.get(layout_key)
|
|
248
|
+
if layout:
|
|
249
|
+
result = dict(layout)
|
|
250
|
+
result["layout_key"] = layout_key
|
|
251
|
+
return result
|
|
252
|
+
# Conservative generic fallback for vector payloads: only expand when every
|
|
253
|
+
# repeated group can form two-lane physical cores exactly.
|
|
254
|
+
if engine_types == {"vector"} and all(len(rows) % 2 == 0 for rows in duplicate_groups):
|
|
255
|
+
return {"lanes_per_core": 2, "slot_order": {}}
|
|
256
|
+
return None
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def _raw_core_sort_key(value: str) -> Tuple[int, Any]:
|
|
260
|
+
try:
|
|
261
|
+
return (0, int(value))
|
|
262
|
+
except (TypeError, ValueError):
|
|
263
|
+
return (1, value)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _assemble_packed_logical(
|
|
267
|
+
grouped: Mapping[str, List[Dict[str, Any]]],
|
|
268
|
+
slot_orders: Mapping[Any, Any],
|
|
269
|
+
lanes_per_core: int,
|
|
270
|
+
) -> Tuple[List[Dict[str, Any]], int]:
|
|
271
|
+
logical: List[Dict[str, Any]] = []
|
|
272
|
+
logical_core_id = 0
|
|
273
|
+
for raw_id in sorted(grouped, key=_raw_core_sort_key):
|
|
274
|
+
rows = grouped[raw_id]
|
|
275
|
+
try:
|
|
276
|
+
numeric_raw = int(raw_id)
|
|
277
|
+
except (TypeError, ValueError):
|
|
278
|
+
numeric_raw = None
|
|
279
|
+
order = slot_orders.get(numeric_raw)
|
|
280
|
+
if isinstance(order, list) and len(order) == len(rows) and sorted(order) == list(range(len(rows))):
|
|
281
|
+
rows = [rows[i] for i in order]
|
|
282
|
+
for offset in range(0, len(rows), lanes_per_core):
|
|
283
|
+
# Do not invent a missing lane. Keep the residual entry visible.
|
|
284
|
+
chunk = rows[offset:offset + lanes_per_core]
|
|
285
|
+
for lane_id, item in enumerate(chunk):
|
|
286
|
+
item["core_id"] = logical_core_id
|
|
287
|
+
item["subcore_id"] = lane_id
|
|
288
|
+
item["logical_core_id"] = logical_core_id
|
|
289
|
+
item["logical_subcore_id"] = lane_id
|
|
290
|
+
logical.append(item)
|
|
291
|
+
logical_core_id += 1
|
|
292
|
+
return logical, logical_core_id
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def normalize_packed_occupancy(raw_items: Sequence[Mapping[str,
|
|
296
|
+
Any]], soc: str) -> Tuple[List[Dict[str, Any]], Dict[str, Any]]:
|
|
297
|
+
schema = occupancy_packed_schema(raw_items, soc)
|
|
298
|
+
if not schema:
|
|
299
|
+
return [dict(x) for x in raw_items], {
|
|
300
|
+
"adapter": "native",
|
|
301
|
+
"soc": soc,
|
|
302
|
+
"logical_core_count": len({str(x.get('core_id')) for x in raw_items}),
|
|
303
|
+
"raw_core_count": len({str(x.get('raw_core_id')) for x in raw_items}),
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
lanes_per_core = max(1, int(schema.get("lanes_per_core", 2)))
|
|
307
|
+
slot_orders = schema.get("slot_order") or {}
|
|
308
|
+
grouped: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
|
|
309
|
+
for item in raw_items:
|
|
310
|
+
grouped[str(item.get("raw_core_id", ""))].append(dict(item))
|
|
311
|
+
logical, logical_core_id = _assemble_packed_logical(grouped, slot_orders, lanes_per_core)
|
|
312
|
+
|
|
313
|
+
return logical, {
|
|
314
|
+
"adapter": "packed-core-group",
|
|
315
|
+
"soc": soc,
|
|
316
|
+
"lanes_per_core": lanes_per_core,
|
|
317
|
+
"logical_core_count": logical_core_id,
|
|
318
|
+
"raw_core_count": len(grouped),
|
|
319
|
+
"raw_core_ids": sorted(grouped, key=_raw_core_sort_key),
|
|
320
|
+
"layout_key": schema.get("layout_key"),
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def _occupancy_op_entries(records: Sequence[Mapping[str, Any]]) -> Tuple[List[Mapping[str, Any]], str]:
|
|
325
|
+
op_entries: List[Mapping[str, Any]] = []
|
|
326
|
+
soc = ""
|
|
327
|
+
for record in records:
|
|
328
|
+
if isinstance(record.get("op_detail"), list):
|
|
329
|
+
op_entries.extend(x for x in record["op_detail"] if isinstance(x, Mapping))
|
|
330
|
+
if record.get("soc") and not soc:
|
|
331
|
+
soc = str(record.get("soc"))
|
|
332
|
+
return op_entries, soc
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def _occupancy_metrics_of(sub: Mapping[str, Any]) -> Dict[str, Any]:
|
|
336
|
+
metrics: Dict[str, Any] = {}
|
|
337
|
+
for key, value in flatten_numeric(sub).items():
|
|
338
|
+
if key in {"subcore_id", "core_id"}:
|
|
339
|
+
continue
|
|
340
|
+
if key.lower().endswith("_id") or key.lower().endswith(".id"):
|
|
341
|
+
continue
|
|
342
|
+
metrics[key] = value
|
|
343
|
+
return metrics
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def _occupancy_raw_item(
|
|
347
|
+
core: Mapping[str, Any],
|
|
348
|
+
entry_index: int,
|
|
349
|
+
detail_index: int,
|
|
350
|
+
sub: Mapping[str, Any],
|
|
351
|
+
) -> Optional[Dict[str, Any]]:
|
|
352
|
+
metrics = _occupancy_metrics_of(sub)
|
|
353
|
+
if not metrics:
|
|
354
|
+
return None
|
|
355
|
+
core_id = core.get("core_id")
|
|
356
|
+
return {
|
|
357
|
+
"core_id": core_id,
|
|
358
|
+
"subcore_id": sub.get("subcore_id"),
|
|
359
|
+
"subcore_type": sub.get("subcore_type", ""),
|
|
360
|
+
"raw_core_id": core_id,
|
|
361
|
+
"raw_subcore_id": sub.get("subcore_id"),
|
|
362
|
+
"source_entry_index": entry_index,
|
|
363
|
+
"source_detail_index": detail_index,
|
|
364
|
+
"metrics": metrics,
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def _occupancy_raw_items(op_entries: Sequence[Mapping[str, Any]]) -> List[Dict[str, Any]]:
|
|
369
|
+
raw_items: List[Dict[str, Any]] = []
|
|
370
|
+
for entry_index, core in enumerate(op_entries):
|
|
371
|
+
details = core.get("core_detail") or []
|
|
372
|
+
for detail_index, sub in enumerate(details):
|
|
373
|
+
if not isinstance(sub, Mapping):
|
|
374
|
+
continue
|
|
375
|
+
item = _occupancy_raw_item(core, entry_index, detail_index, sub)
|
|
376
|
+
if item is not None:
|
|
377
|
+
raw_items.append(item)
|
|
378
|
+
return raw_items
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def _occupancy_metrics(cores: Sequence[Mapping[str, Any]]) -> List[Dict[str, Any]]:
|
|
382
|
+
metric_values: Dict[str, List[Optional[float]]] = defaultdict(list)
|
|
383
|
+
for item in cores:
|
|
384
|
+
for key, value in (item.get("metrics") or {}).items():
|
|
385
|
+
metric_values[key].append(value)
|
|
386
|
+
|
|
387
|
+
metrics: List[Dict[str, Any]] = []
|
|
388
|
+
preferred_tokens = ["cycles", "throughput", "hit", "instructions", "instruction_per_cycle"]
|
|
389
|
+
for key, values in metric_values.items():
|
|
390
|
+
finite = [v for v in values if v is not None]
|
|
391
|
+
if not finite:
|
|
392
|
+
continue
|
|
393
|
+
priority = min((preferred_tokens.index(t) for t in preferred_tokens if t in key.lower()), default=99)
|
|
394
|
+
signal = max(abs(v) for v in finite) + (max(finite) - min(finite))
|
|
395
|
+
med = statistics.median(finite)
|
|
396
|
+
metrics.append({
|
|
397
|
+
"key": key,
|
|
398
|
+
"label": humanize_key(key),
|
|
399
|
+
"format": "percent" if metric_is_percent(key, values) else "number",
|
|
400
|
+
"min": min(finite),
|
|
401
|
+
"max": max(finite),
|
|
402
|
+
"median": med,
|
|
403
|
+
"p10": percentile(finite, 0.10),
|
|
404
|
+
"p90": percentile(finite, 0.90),
|
|
405
|
+
"spread_pct": ((max(finite) - min(finite)) / med * 100.0) if med not in {0, None} else None,
|
|
406
|
+
"priority": priority,
|
|
407
|
+
"signal": signal,
|
|
408
|
+
})
|
|
409
|
+
# Do not default to an all-zero metric merely because its name is normally preferred.
|
|
410
|
+
metrics.sort(key=lambda x: (0 if x["signal"] > 1e-12 else 1, x["priority"], x["label"]))
|
|
411
|
+
for metric in metrics:
|
|
412
|
+
metric.pop("priority", None)
|
|
413
|
+
metric.pop("signal", None)
|
|
414
|
+
return metrics
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def parse_occupancy(records: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
418
|
+
op_entries, soc = _occupancy_op_entries(records)
|
|
419
|
+
raw_items = _occupancy_raw_items(op_entries)
|
|
420
|
+
cores, layout = normalize_packed_occupancy(raw_items, soc)
|
|
421
|
+
metrics = _occupancy_metrics(cores)
|
|
422
|
+
return {"available": bool(cores and metrics), "cores": cores, "metrics": metrics, "layout": layout}
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
def parse_compute(records: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
426
|
+
raw_items: List[Mapping[str, Any]] = []
|
|
427
|
+
for record in records:
|
|
428
|
+
if isinstance(record.get("subblock_detail"), list):
|
|
429
|
+
raw_items.extend(x for x in record["subblock_detail"] if isinstance(x, Mapping))
|
|
430
|
+
|
|
431
|
+
items: List[Dict[str, Any]] = []
|
|
432
|
+
for item in raw_items:
|
|
433
|
+
value = to_float(item.get("value"))
|
|
434
|
+
if value is None:
|
|
435
|
+
continue
|
|
436
|
+
items.append({
|
|
437
|
+
"block_id": str(item.get("block_id", "")),
|
|
438
|
+
"block_type": str(item.get("block_type", "") or "Compute"),
|
|
439
|
+
"name": str(item.get("name", "Metric") or "Metric"),
|
|
440
|
+
"unit": item.get("unit"),
|
|
441
|
+
"value": value,
|
|
442
|
+
"origin_value": to_float(item.get("origin_value")),
|
|
443
|
+
})
|
|
444
|
+
|
|
445
|
+
items.sort(key=lambda x: (
|
|
446
|
+
int(x["block_id"]) if str(x["block_id"]).isdigit() else 10**9,
|
|
447
|
+
str(x["block_type"]),
|
|
448
|
+
str(x["name"]),
|
|
449
|
+
str(x.get("unit")),
|
|
450
|
+
))
|
|
451
|
+
# Mixed numeric/non-numeric Block IDs cannot be compared directly; order
|
|
452
|
+
# numeric IDs first (by value), then the rest lexicographically.
|
|
453
|
+
block_ids = sorted({x["block_id"] for x in items}, key=lambda x: (0, int(x)) if x.isdigit() else (1, x))
|
|
454
|
+
block_types = sorted({x["block_type"] for x in items})
|
|
455
|
+
|
|
456
|
+
# Keep a compact aggregate view for compatibility with earlier consumers and tests.
|
|
457
|
+
grouped: Dict[Tuple[str, str, str], List[Dict[str, Any]]] = defaultdict(list)
|
|
458
|
+
for item in items:
|
|
459
|
+
grouped[(item["name"], item["block_type"], str(item.get("unit")))].append(item)
|
|
460
|
+
metrics: List[Dict[str, Any]] = []
|
|
461
|
+
for (name, block_type, unit_key), group in grouped.items():
|
|
462
|
+
vals = [x["value"] for x in group]
|
|
463
|
+
is_percent = str(group[0].get("unit")) == "3" or metric_is_percent(name, vals)
|
|
464
|
+
metrics.append({
|
|
465
|
+
"key": f"{block_type}::{name}::unit={unit_key}",
|
|
466
|
+
"name": name,
|
|
467
|
+
"display_name": name + (" (%)" if is_percent else " (raw)"),
|
|
468
|
+
"block_type": block_type,
|
|
469
|
+
"format": "percent" if is_percent else "number",
|
|
470
|
+
"mean": sum(vals) / len(vals),
|
|
471
|
+
"min": min(vals),
|
|
472
|
+
"max": max(vals),
|
|
473
|
+
"blocks": [{"block_id": x["block_id"], "value": x["value"]} for x in group],
|
|
474
|
+
})
|
|
475
|
+
return {"available": bool(items), "items": items, "block_ids": block_ids,
|
|
476
|
+
"block_types": block_types, "metrics": metrics}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
def _tpb_row_item(row: Mapping[str, Any], block_id: str, headers: Sequence[str]) -> Dict[str, Any]:
|
|
480
|
+
values = list(row.get("value") or [])
|
|
481
|
+
metric_headers = headers[1:] if len(headers) == len(values) + 1 else headers[:len(values)]
|
|
482
|
+
item: Dict[str, Any] = {"block_id": block_id, "name": str(row.get("name", ""))}
|
|
483
|
+
for h, v in zip(metric_headers, values):
|
|
484
|
+
item[str(h)] = v
|
|
485
|
+
return item
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def _tpb_table_item(
|
|
489
|
+
table: Mapping[str, Any],
|
|
490
|
+
block_id: str,
|
|
491
|
+
grouped: Dict[str, List[Dict[str, Any]]],
|
|
492
|
+
) -> Dict[str, Any]:
|
|
493
|
+
table_name = str(table.get("table_name", "Unknown"))
|
|
494
|
+
headers = [str(h) for h in (table.get("header_name") or [])]
|
|
495
|
+
rows: List[Dict[str, Any]] = []
|
|
496
|
+
for row in table.get("row") or []:
|
|
497
|
+
if not isinstance(row, Mapping):
|
|
498
|
+
continue
|
|
499
|
+
item = _tpb_row_item(row, block_id, headers)
|
|
500
|
+
rows.append(item)
|
|
501
|
+
grouped[table_name].append(item)
|
|
502
|
+
return {"name": table_name, "headers": headers, "rows": rows}
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def _tpb_block_item(
|
|
506
|
+
block: Mapping[str, Any],
|
|
507
|
+
grouped: Dict[str, List[Dict[str, Any]]],
|
|
508
|
+
) -> Dict[str, Any]:
|
|
509
|
+
block_id = str(block.get("block_id", ""))
|
|
510
|
+
normalized_tables: List[Dict[str, Any]] = []
|
|
511
|
+
for table in block.get("table_detail") or []:
|
|
512
|
+
if not isinstance(table, Mapping):
|
|
513
|
+
continue
|
|
514
|
+
normalized_tables.append(_tpb_table_item(table, block_id, grouped))
|
|
515
|
+
return {"block_id": block_id, "tables": normalized_tables}
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
def normalize_table_per_block(records: Sequence[Mapping[str,
|
|
519
|
+
Any]]) -> Tuple[List[Dict[str, Any]], Dict[str, List[Dict[str, Any]]]]:
|
|
520
|
+
blocks: List[Dict[str, Any]] = []
|
|
521
|
+
grouped: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
|
|
522
|
+
for record in records:
|
|
523
|
+
source = record.get("table_per_block")
|
|
524
|
+
if not isinstance(source, list):
|
|
525
|
+
continue
|
|
526
|
+
for block in source:
|
|
527
|
+
if not isinstance(block, Mapping):
|
|
528
|
+
continue
|
|
529
|
+
blocks.append(_tpb_block_item(block, grouped))
|
|
530
|
+
return blocks, dict(grouped)
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
def _memory_table_item(table: Mapping[str, Any]) -> Optional[Dict[str, Any]]:
|
|
534
|
+
headers = [str(h) for h in (table.get("headers") or [])]
|
|
535
|
+
value_headers = headers[1:] if headers else []
|
|
536
|
+
rows: List[Dict[str, Any]] = []
|
|
537
|
+
for row in table.get("rows") or []:
|
|
538
|
+
values: Dict[str, Any] = {}
|
|
539
|
+
for key, value in row.items():
|
|
540
|
+
if key in {"block_id", "name"}:
|
|
541
|
+
continue
|
|
542
|
+
values[str(key)] = value
|
|
543
|
+
rows.append({"name": str(row.get("name", "")), "values": values})
|
|
544
|
+
if not rows:
|
|
545
|
+
return None
|
|
546
|
+
return {"name": str(table.get("name", "Unknown")),
|
|
547
|
+
"headers": headers or (["Name"] + value_headers), ("r"
|
|
548
|
+
"ows"): rows}
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
def _memory_block_tables(raw_blocks: Sequence[Mapping[str, Any]]) -> List[Dict[str, Any]]:
|
|
552
|
+
blocks: List[Dict[str, Any]] = []
|
|
553
|
+
for block in raw_blocks:
|
|
554
|
+
tables: List[Dict[str, Any]] = []
|
|
555
|
+
for table in block.get("tables") or []:
|
|
556
|
+
item = _memory_table_item(table)
|
|
557
|
+
if item is not None:
|
|
558
|
+
tables.append(item)
|
|
559
|
+
if tables:
|
|
560
|
+
blocks.append({"block_id": str(block.get("block_id", "")), "tables": tables})
|
|
561
|
+
return blocks
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def _memory_core_map_entry(core: Mapping[str, Any]) -> Tuple[str, List[Dict[str, Any]], Dict[str, Any]]:
|
|
565
|
+
core_id = str(core.get("core_no", ""))
|
|
566
|
+
paths: List[Dict[str, Any]] = []
|
|
567
|
+
for unit in core.get("memory_unit") or []:
|
|
568
|
+
if not isinstance(unit, Mapping):
|
|
569
|
+
continue
|
|
570
|
+
paths.append({
|
|
571
|
+
"memory_path": unit.get("memory_path"),
|
|
572
|
+
"request": to_float(unit.get("request")),
|
|
573
|
+
"bandwidth": to_float(unit.get("bandwidth")),
|
|
574
|
+
"peak_ratio": to_float(unit.get("peak_ratio")),
|
|
575
|
+
"display": unit.get("display"),
|
|
576
|
+
})
|
|
577
|
+
summary: Dict[str, Any] = {}
|
|
578
|
+
for key, value in core.items():
|
|
579
|
+
if key in {"core_no", "memory_unit", "advice", "soc", "op_type"}:
|
|
580
|
+
continue
|
|
581
|
+
if not isinstance(value, (Mapping, list)):
|
|
582
|
+
continue
|
|
583
|
+
summary[key] = value
|
|
584
|
+
return core_id, paths, summary
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
def _memory_core_maps(
|
|
588
|
+
records: Sequence[Mapping[str, Any]],
|
|
589
|
+
) -> Tuple[Dict[str, List[Dict[str, Any]]], Dict[str, Dict[str, Any]]]:
|
|
590
|
+
core_paths: Dict[str, List[Dict[str, Any]]] = {}
|
|
591
|
+
core_summaries: Dict[str, Dict[str, Any]] = {}
|
|
592
|
+
for record in records:
|
|
593
|
+
source = record.get("core_memory_map")
|
|
594
|
+
if not isinstance(source, list):
|
|
595
|
+
continue
|
|
596
|
+
for core in source:
|
|
597
|
+
if not isinstance(core, Mapping):
|
|
598
|
+
continue
|
|
599
|
+
core_id, paths, summary = _memory_core_map_entry(core)
|
|
600
|
+
core_paths[core_id] = paths
|
|
601
|
+
core_summaries[core_id] = summary
|
|
602
|
+
return core_paths, core_summaries
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
def _memory_row_keys(row_items: Sequence[Mapping[str, Any]]) -> List[str]:
|
|
606
|
+
keys: List[str] = []
|
|
607
|
+
for row_item in row_items:
|
|
608
|
+
for key in (row_item.get("values") or {}):
|
|
609
|
+
if key in keys:
|
|
610
|
+
continue
|
|
611
|
+
keys.append(key)
|
|
612
|
+
return keys
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
def _memory_group_rows(rows: Sequence[Mapping[str, Any]]) -> List[Dict[str, Any]]:
|
|
616
|
+
by_name: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
|
|
617
|
+
for row in rows:
|
|
618
|
+
by_name[str(row.get("name", ""))].append(row)
|
|
619
|
+
normalized_rows: List[Dict[str, Any]] = []
|
|
620
|
+
for row_name, row_items in by_name.items():
|
|
621
|
+
metrics: Dict[str, Optional[float]] = {}
|
|
622
|
+
for key in _memory_row_keys(row_items):
|
|
623
|
+
metrics[key] = mean((ri.get("values") or {}).get(key) for ri in row_items)
|
|
624
|
+
normalized_rows.append({
|
|
625
|
+
"name": row_name,
|
|
626
|
+
"metrics": metrics,
|
|
627
|
+
})
|
|
628
|
+
return normalized_rows
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
def _memory_groups(blocks: Sequence[Mapping[str, Any]]) -> List[Dict[str, Any]]:
|
|
632
|
+
groups: List[Dict[str, Any]] = []
|
|
633
|
+
by_table: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
|
|
634
|
+
for block in blocks:
|
|
635
|
+
for table in block.get("tables") or []:
|
|
636
|
+
for row in table.get("rows") or []:
|
|
637
|
+
by_table[table["name"]].append(row)
|
|
638
|
+
for table_name, rows in by_table.items():
|
|
639
|
+
field_names = set()
|
|
640
|
+
for row in rows:
|
|
641
|
+
for key in (row.get("values") or {}).keys():
|
|
642
|
+
field_names.add(str(key).lower())
|
|
643
|
+
cache_summary = (
|
|
644
|
+
"cache" in table_name.lower()
|
|
645
|
+
and any("hit" in f or "miss" in f for f in field_names)
|
|
646
|
+
and not any("throughput" in f or "bandwidth" in f or "request" in f for f in field_names)
|
|
647
|
+
)
|
|
648
|
+
if cache_summary:
|
|
649
|
+
continue
|
|
650
|
+
normalized_rows = _memory_group_rows(rows)
|
|
651
|
+
if normalized_rows:
|
|
652
|
+
groups.append({"name": table_name, "rows": normalized_rows})
|
|
653
|
+
return groups
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
def parse_memory(records: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
657
|
+
raw_blocks, _ = normalize_table_per_block(records)
|
|
658
|
+
blocks = _memory_block_tables(raw_blocks)
|
|
659
|
+
core_paths, core_summaries = _memory_core_maps(records)
|
|
660
|
+
groups = _memory_groups(blocks)
|
|
661
|
+
advice = collect_advice(records)
|
|
662
|
+
return {
|
|
663
|
+
"available": bool(blocks or core_paths),
|
|
664
|
+
"blocks": blocks,
|
|
665
|
+
"core_paths": core_paths,
|
|
666
|
+
"core_summaries": core_summaries,
|
|
667
|
+
"groups": groups,
|
|
668
|
+
"advice": advice,
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
def _canonical_cache_field(name: Any) -> Optional[str]:
|
|
673
|
+
low = str(name).strip().lower().replace("_", " ")
|
|
674
|
+
if "hit rate" in low or ("hit" in low and "rate" in low):
|
|
675
|
+
return "hit_rate"
|
|
676
|
+
if low == "hit" or low.endswith(" hit"):
|
|
677
|
+
return "hit"
|
|
678
|
+
if low == "miss" or low.endswith(" miss"):
|
|
679
|
+
return "miss"
|
|
680
|
+
if low == "total" or low.endswith(" total"):
|
|
681
|
+
return "total"
|
|
682
|
+
return None
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
class _CacheAccumulators(NamedTuple):
|
|
686
|
+
entries: Dict[str, float]
|
|
687
|
+
metric_keys: List[str]
|
|
688
|
+
aggregate: Dict[str, List[float]]
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
def _cache_row_fields(
|
|
692
|
+
row: Mapping[str, Any],
|
|
693
|
+
row_name: str,
|
|
694
|
+
family: Dict[str, Optional[float]],
|
|
695
|
+
accumulators: _CacheAccumulators,
|
|
696
|
+
) -> None:
|
|
697
|
+
for field, raw in row.items():
|
|
698
|
+
if field in {"block_id", "name"}:
|
|
699
|
+
continue
|
|
700
|
+
value = to_float(raw)
|
|
701
|
+
if value is None:
|
|
702
|
+
continue
|
|
703
|
+
key = f"{row_name} · {field}"
|
|
704
|
+
accumulators.entries[key] = value
|
|
705
|
+
accumulators.aggregate[key].append(value)
|
|
706
|
+
if key not in accumulators.metric_keys:
|
|
707
|
+
accumulators.metric_keys.append(key)
|
|
708
|
+
canonical = _canonical_cache_field(field)
|
|
709
|
+
if canonical:
|
|
710
|
+
family[canonical] = value
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
def _cache_table_field_names(table: Mapping[str, Any]) -> set:
|
|
714
|
+
fields = set()
|
|
715
|
+
for row in table["rows"]:
|
|
716
|
+
for field_name in row.keys():
|
|
717
|
+
if field_name in {"block_id", "name"}:
|
|
718
|
+
continue
|
|
719
|
+
fields.add(str(field_name).lower())
|
|
720
|
+
return fields
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
def _cache_block_entries(
|
|
724
|
+
block: Mapping[str, Any],
|
|
725
|
+
family_by_block: Dict[str, Dict[str, Dict[str, Optional[float]]]],
|
|
726
|
+
metric_keys: List[str],
|
|
727
|
+
series_keys: List[str],
|
|
728
|
+
aggregate: Dict[str, List[float]],
|
|
729
|
+
) -> Dict[str, float]:
|
|
730
|
+
entries: Dict[str, float] = {}
|
|
731
|
+
accumulators = _CacheAccumulators(entries, metric_keys, aggregate)
|
|
732
|
+
block_id = str(block["block_id"])
|
|
733
|
+
for table in block["tables"]:
|
|
734
|
+
fields = _cache_table_field_names(table)
|
|
735
|
+
is_cache_summary = "cache" in table["name"].lower() and any("hit" in f or "miss" in f for f in fields)
|
|
736
|
+
if not is_cache_summary:
|
|
737
|
+
continue
|
|
738
|
+
for row in table["rows"]:
|
|
739
|
+
row_name = str(row.get("name", "")).strip() or str(table["name"])
|
|
740
|
+
family = family_by_block[block_id].setdefault(row_name, {"hit": None, "miss": None, "total": None, ("h"
|
|
741
|
+
"it_rate"): None})
|
|
742
|
+
_cache_row_fields(row, row_name, family, accumulators)
|
|
743
|
+
if row_name not in series_keys:
|
|
744
|
+
series_keys.append(row_name)
|
|
745
|
+
return entries
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
def _cache_summary(aggregate: Mapping[str, List[float]]) -> List[Dict[str, Any]]:
|
|
749
|
+
summary = []
|
|
750
|
+
for key, vals in aggregate.items():
|
|
751
|
+
summary.append({
|
|
752
|
+
"key": key,
|
|
753
|
+
"label": key,
|
|
754
|
+
"mean": sum(vals) / len(vals),
|
|
755
|
+
"min": min(vals),
|
|
756
|
+
"max": max(vals),
|
|
757
|
+
"format": "percent" if metric_is_percent(key, vals) else "number",
|
|
758
|
+
})
|
|
759
|
+
summary.sort(key=lambda x: (0 if "hit rate" in x["key"].lower() else 1, x["key"]))
|
|
760
|
+
return summary
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
def _cache_family_cells(
|
|
764
|
+
family_name: str,
|
|
765
|
+
cache_blocks: Sequence[Mapping[str, Any]],
|
|
766
|
+
family_by_block: Mapping[str, Any],
|
|
767
|
+
) -> Tuple[List[Dict[str, Any]], float, float]:
|
|
768
|
+
raw_cells: List[Dict[str, Any]] = []
|
|
769
|
+
hit_sum = miss_sum = 0.0
|
|
770
|
+
for block in cache_blocks:
|
|
771
|
+
values = family_by_block.get(str(block["block_id"]), {}).get(family_name)
|
|
772
|
+
if not values:
|
|
773
|
+
continue
|
|
774
|
+
hit = to_float(values.get("hit")) or 0.0
|
|
775
|
+
miss = to_float(values.get("miss")) or 0.0
|
|
776
|
+
total = to_float(values.get("total"))
|
|
777
|
+
if total is None:
|
|
778
|
+
total = hit + miss
|
|
779
|
+
hit_rate = to_float(values.get("hit_rate"))
|
|
780
|
+
if hit_rate is None and total > 0:
|
|
781
|
+
hit_rate = hit / total * 100.0
|
|
782
|
+
hit_sum += hit
|
|
783
|
+
miss_sum += miss
|
|
784
|
+
raw_cells.append({
|
|
785
|
+
"index": str(block["block_id"]),
|
|
786
|
+
"index_kind": "block_id",
|
|
787
|
+
"block_id": str(block["block_id"]),
|
|
788
|
+
"hit": hit,
|
|
789
|
+
"miss": miss,
|
|
790
|
+
"total": total,
|
|
791
|
+
"hit_rate": hit_rate,
|
|
792
|
+
"source_links": [],
|
|
793
|
+
})
|
|
794
|
+
for cell in raw_cells:
|
|
795
|
+
cell["hit_share_percent"] = (cell["hit"] / hit_sum * 100.0) if hit_sum > 0 else 0.0
|
|
796
|
+
cell["miss_share_percent"] = (cell["miss"] / miss_sum * 100.0) if miss_sum > 0 else 0.0
|
|
797
|
+
return raw_cells, hit_sum, miss_sum
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
def _cache_family_models(
|
|
801
|
+
series_keys: Sequence[str],
|
|
802
|
+
cache_blocks: Sequence[Mapping[str, Any]],
|
|
803
|
+
family_by_block: Mapping[str, Any],
|
|
804
|
+
) -> List[Dict[str, Any]]:
|
|
805
|
+
family_models: List[Dict[str, Any]] = []
|
|
806
|
+
for family_name in series_keys:
|
|
807
|
+
raw_cells, hit_sum, miss_sum = _cache_family_cells(family_name, cache_blocks, family_by_block)
|
|
808
|
+
if raw_cells:
|
|
809
|
+
cols = max(1, math.ceil(math.sqrt(len(raw_cells))))
|
|
810
|
+
rows_count = math.ceil(len(raw_cells) / cols)
|
|
811
|
+
family_models.append({
|
|
812
|
+
"name": family_name,
|
|
813
|
+
"index_kind": "block_id",
|
|
814
|
+
"index_label": "Profiler Block ID",
|
|
815
|
+
"granularity_note": ("This capture exposes per-block cache aggregates; native cacheline "
|
|
816
|
+
"indices and instruction linkage are not present in the payload."),
|
|
817
|
+
"columns": cols,
|
|
818
|
+
"rows": rows_count,
|
|
819
|
+
"cells": raw_cells,
|
|
820
|
+
"totals": {"hit": hit_sum, "miss": miss_sum, "events": hit_sum + miss_sum},
|
|
821
|
+
})
|
|
822
|
+
family_models.sort(key=lambda x: (0 if x["name"].lower() == "l2 cache total" else 1,
|
|
823
|
+
0 if "l2 cache" in x["name"].lower() else 1, x["name"].lower()))
|
|
824
|
+
return family_models
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
def parse_cache(records: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
828
|
+
"""Normalize cache summaries into paired Hit/Miss event maps.
|
|
829
|
+
|
|
830
|
+
The profiler payload used by many on-board captures is block aggregated, not
|
|
831
|
+
cacheline resolved. The model therefore records the index semantics instead
|
|
832
|
+
of labelling block IDs as cacheline indices. A future native cacheline
|
|
833
|
+
provider can populate the same family/cell contract with
|
|
834
|
+
``index_kind=cacheline`` without changing the renderer.
|
|
835
|
+
"""
|
|
836
|
+
blocks, _ = normalize_table_per_block(records)
|
|
837
|
+
cache_blocks: List[Dict[str, Any]] = []
|
|
838
|
+
metric_keys: List[str] = []
|
|
839
|
+
series_keys: List[str] = []
|
|
840
|
+
aggregate: Dict[str, List[float]] = defaultdict(list)
|
|
841
|
+
family_by_block: Dict[str, Dict[str, Dict[str, Optional[float]]]] = defaultdict(dict)
|
|
842
|
+
|
|
843
|
+
for block in blocks:
|
|
844
|
+
entries = _cache_block_entries(block, family_by_block, metric_keys, series_keys, aggregate)
|
|
845
|
+
if entries:
|
|
846
|
+
cache_blocks.append({"block_id": str(block["block_id"]), "values": entries})
|
|
847
|
+
|
|
848
|
+
summary = _cache_summary(aggregate)
|
|
849
|
+
metric_keys.sort(key=lambda x: (0 if "hit rate" in x.lower() else 1, x))
|
|
850
|
+
family_models = _cache_family_models(series_keys, cache_blocks, family_by_block)
|
|
851
|
+
supports_source_linkage = False
|
|
852
|
+
for family in family_models:
|
|
853
|
+
for cell in family.get("cells") or []:
|
|
854
|
+
if cell.get("source_links"):
|
|
855
|
+
supports_source_linkage = True
|
|
856
|
+
return {
|
|
857
|
+
"available": bool(cache_blocks),
|
|
858
|
+
"schema": "msopprof-cache-heatmap/v2",
|
|
859
|
+
"granularity": "block",
|
|
860
|
+
"index_kind": "block_id",
|
|
861
|
+
"blocks": cache_blocks,
|
|
862
|
+
"metrics": metric_keys,
|
|
863
|
+
"summary": summary,
|
|
864
|
+
"families": family_models,
|
|
865
|
+
"default_family": family_models[0]["name"] if family_models else None,
|
|
866
|
+
"supports_cacheline_detail": False,
|
|
867
|
+
"supports_source_linkage": supports_source_linkage,
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
def _walk_json_nodes(value: Any) -> Iterator[Mapping[str, Any]]:
|
|
872
|
+
if isinstance(value, Mapping):
|
|
873
|
+
yield value
|
|
874
|
+
for child in value.values():
|
|
875
|
+
yield from _walk_json_nodes(child)
|
|
876
|
+
elif isinstance(value, list):
|
|
877
|
+
for child in value:
|
|
878
|
+
yield from _walk_json_nodes(child)
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
def _first_key(mapping: Mapping[str, Any], names: Sequence[str]) -> Any:
|
|
882
|
+
normalized = {str(k).strip().lower().replace("-", "_"): v for k, v in mapping.items()}
|
|
883
|
+
for name in names:
|
|
884
|
+
key = name.lower().replace("-", "_")
|
|
885
|
+
if key in normalized:
|
|
886
|
+
return normalized[key]
|
|
887
|
+
return None
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
def _numeric_pair(value: Any) -> Tuple[Optional[float], Optional[float]]:
|
|
891
|
+
if isinstance(value, (list, tuple)) and len(value) >= 2:
|
|
892
|
+
return to_float(value[0]), to_float(value[1])
|
|
893
|
+
if isinstance(value, Mapping):
|
|
894
|
+
return to_float(_first_key(value, ["start", "begin", "min"])), to_float(_first_key(value, ["end", "finish", ("m"
|
|
895
|
+
"ax")]))
|
|
896
|
+
return None, None
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
def _onchip_missing_diagnostic() -> Dict[str, Any]:
|
|
900
|
+
return {
|
|
901
|
+
"available": False,
|
|
902
|
+
"diagnostic": {
|
|
903
|
+
"code": "memory_info_missing",
|
|
904
|
+
"title": "On-Chip Memory unavailable",
|
|
905
|
+
"explanation": ("The collection does not contain a manifest-declared memory_info.json file. "
|
|
906
|
+
"MemoryDetail counters cannot be substituted for allocation lifetime/address data."),
|
|
907
|
+
"evidence": ["Required artifact: memory_info.json", ("Required views: memory block map, "
|
|
908
|
+
"selected allocation detail, bank/group distribution")],
|
|
909
|
+
"requirements": ["Generate memory_info.json for the selected kernel/build.", ("Declare or "
|
|
910
|
+
"pass the exact file to the visualization pipeline.")],
|
|
911
|
+
},
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
def _onchip_errors(raw: Any) -> List[str]:
|
|
916
|
+
errors: List[str] = []
|
|
917
|
+
if isinstance(raw, Mapping):
|
|
918
|
+
for key in ["error", "errors", "error_message", "compile_error", "message"]:
|
|
919
|
+
value = _first_key(raw, [key])
|
|
920
|
+
if value and any(token in str(value).lower() for token in ["fail", "error", "失败"]):
|
|
921
|
+
items = value if isinstance(value, list) else [value]
|
|
922
|
+
errors.extend(str(x) for x in items)
|
|
923
|
+
return errors
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
def _onchip_int_list(value: Any) -> List[int]:
|
|
927
|
+
if isinstance(value, (int, float, str)):
|
|
928
|
+
return [int(x) for x in re.findall(r"\d+", str(value))]
|
|
929
|
+
if isinstance(value, list):
|
|
930
|
+
numbers: List[int] = []
|
|
931
|
+
for item in value:
|
|
932
|
+
for token in re.findall(r"\d+", str(item)):
|
|
933
|
+
numbers.append(int(token))
|
|
934
|
+
return numbers
|
|
935
|
+
return []
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
def _onchip_candidate(node: Mapping[str, Any], ordinal: int) -> Optional[Dict[str, Any]]:
|
|
939
|
+
start = to_float(_first_key(node, ["start", "start_time",
|
|
940
|
+
"life_start", "begin", "alloc_order", "start_line", ("a"
|
|
941
|
+
"lloc_line"), "birth"]))
|
|
942
|
+
end = to_float(_first_key(node, ["end", "end_time", "life_end", "finish", "free_order", "end_line", ("free_l"
|
|
943
|
+
"ine"), "death"]))
|
|
944
|
+
life_start, life_end = _numeric_pair(_first_key(node, ["lifetime", "life_time", "life", "interval"]))
|
|
945
|
+
start = start if start is not None else life_start
|
|
946
|
+
end = end if end is not None else life_end
|
|
947
|
+
size = to_float(_first_key(node, ["size", "size_bytes", "buffer_size", "memory_size", "bytes", "tensor_size"]))
|
|
948
|
+
addr_start = to_float(_first_key(node, ["address", "offset", "start_address", "address_start", "addr", ("ub_"
|
|
949
|
+
"offset")]))
|
|
950
|
+
addr_end = to_float(_first_key(node, ["end_address", "address_end", "addr_end"]))
|
|
951
|
+
if addr_end is None and addr_start is not None and size is not None:
|
|
952
|
+
addr_end = addr_start + size
|
|
953
|
+
signals = sum(x is not None for x in [start, end, size, addr_start, addr_end])
|
|
954
|
+
if signals < 3 or start is None or end is None:
|
|
955
|
+
return None
|
|
956
|
+
name = _first_key(node, ["name", "tensor_name", "buffer_name", "id", "block_id", "allocation", "var_name"])
|
|
957
|
+
block_id = str(name if name not in {None, ""} else f"allocation-{ordinal}")
|
|
958
|
+
banks_raw = _first_key(node, ["banks", "bank_ids", "bank_id", "bank", "physical_banks"])
|
|
959
|
+
groups_raw = _first_key(node, ["groups", "group_ids", "group_id", "bank_group"])
|
|
960
|
+
temporary_raw = _first_key(node, ["temporary", "is_temporary", "is_temp", "temp"])
|
|
961
|
+
temporary = None if temporary_raw is None else str(temporary_raw).lower() in {"1", "true", "yes", "y", ("tem"
|
|
962
|
+
"porary"), "temp"}
|
|
963
|
+
return {
|
|
964
|
+
"id": f"mem-{ordinal}",
|
|
965
|
+
"name": block_id,
|
|
966
|
+
"start": start,
|
|
967
|
+
"end": end,
|
|
968
|
+
"lifetime": max(0.0, end - start),
|
|
969
|
+
"size_bytes": size,
|
|
970
|
+
"address_start": addr_start,
|
|
971
|
+
"address_end": addr_end,
|
|
972
|
+
"allocation_location": str(_first_key(node, ["allocation_location", "apply_position", "alloc_position", ("s"
|
|
973
|
+
"ource"), "source_location", "ir_line"]) or ""),
|
|
974
|
+
"scope": str(_first_key(node, ["scope", "scope_type", "memory_scope"]) or ""),
|
|
975
|
+
"temporary": temporary,
|
|
976
|
+
"bank_ids": sorted(set(_onchip_int_list(banks_raw))),
|
|
977
|
+
"group_ids": sorted(set(_onchip_int_list(groups_raw))),
|
|
978
|
+
"_signature": (block_id, start, end, addr_start, size),
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
def _onchip_candidates(raw: Any) -> List[Dict[str, Any]]:
|
|
983
|
+
candidates: List[Dict[str, Any]] = []
|
|
984
|
+
seen = set()
|
|
985
|
+
for node in _walk_json_nodes(raw):
|
|
986
|
+
candidate = _onchip_candidate(node, len(candidates))
|
|
987
|
+
if candidate is None:
|
|
988
|
+
continue
|
|
989
|
+
signature = candidate.pop("_signature")
|
|
990
|
+
if signature in seen:
|
|
991
|
+
continue
|
|
992
|
+
seen.add(signature)
|
|
993
|
+
candidates.append(candidate)
|
|
994
|
+
return candidates
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
def _onchip_bank_layout(raw: Any, candidates: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
998
|
+
bank_count = group_count = banks_per_group = None
|
|
999
|
+
for node in _walk_json_nodes(raw):
|
|
1000
|
+
bank_count = bank_count or to_float(_first_key(node, ["bank_count", "num_banks", "banks_count"]))
|
|
1001
|
+
group_count = group_count or to_float(_first_key(node, ["group_count", "num_groups", "bank_group_count"]))
|
|
1002
|
+
banks_per_group = banks_per_group or to_float(_first_key(node, ["banks_per_group", "bank_num_per_group"]))
|
|
1003
|
+
max_bank = max((max(x["bank_ids"]) for x in candidates if x["bank_ids"]), default=-1)
|
|
1004
|
+
if bank_count is None and max_bank >= 0:
|
|
1005
|
+
bank_count = max_bank + 1
|
|
1006
|
+
if group_count is None and candidates:
|
|
1007
|
+
max_group = max((max(x["group_ids"]) for x in candidates if x["group_ids"]), default=-1)
|
|
1008
|
+
if max_group >= 0:
|
|
1009
|
+
group_count = max_group + 1
|
|
1010
|
+
if banks_per_group is None and bank_count and group_count:
|
|
1011
|
+
banks_per_group = math.ceil(bank_count / group_count)
|
|
1012
|
+
|
|
1013
|
+
bank_cells: List[Dict[str, Any]] = []
|
|
1014
|
+
if bank_count:
|
|
1015
|
+
for bank in range(int(bank_count)):
|
|
1016
|
+
group = int(bank // banks_per_group) if banks_per_group else None
|
|
1017
|
+
owners = [x["id"] for x in candidates if bank in x["bank_ids"]]
|
|
1018
|
+
bank_cells.append({"bank_id": bank, "group_id": group, "owner_ids": owners})
|
|
1019
|
+
return {"bank_count": int(bank_count) if bank_count else 0,
|
|
1020
|
+
"group_count": int(group_count) if group_count else 0, ("b"
|
|
1021
|
+
"anks_per_group"): int(banks_per_group) if banks_per_group else 0, "cells": bank_cells}
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
def parse_onchip_memory(path: Optional[Path]) -> Dict[str, Any]:
|
|
1025
|
+
"""Parse a memory_info.json sidecar into the three-view On-Chip Memory contract."""
|
|
1026
|
+
if path is None or not path.is_file():
|
|
1027
|
+
return _onchip_missing_diagnostic()
|
|
1028
|
+
try:
|
|
1029
|
+
raw = json.loads(path.read_text(encoding="utf-8"))
|
|
1030
|
+
except Exception as exc:
|
|
1031
|
+
return {"available": False, "diagnostic": {"code": "memory_info_invalid_json", "title": ("On-Chip "
|
|
1032
|
+
"Memory payload is invalid"), "explanation": str(exc), "evidence": [path.name]}}
|
|
1033
|
+
|
|
1034
|
+
errors = _onchip_errors(raw)
|
|
1035
|
+
candidates = _onchip_candidates(raw)
|
|
1036
|
+
if not candidates:
|
|
1037
|
+
return {
|
|
1038
|
+
"available": False,
|
|
1039
|
+
"diagnostic": {
|
|
1040
|
+
"code": "memory_info_no_usable_allocations",
|
|
1041
|
+
"title": "On-Chip Memory payload has no usable allocation records",
|
|
1042
|
+
"explanation": ("memory_info.json was found, but no records contained a lifetime plus "
|
|
1043
|
+
"size/address information required by the memory block map."),
|
|
1044
|
+
"evidence": errors or [path.name],
|
|
1045
|
+
},
|
|
1046
|
+
}
|
|
1047
|
+
start_min = min(x["start"] for x in candidates)
|
|
1048
|
+
end_max = max(x["end"] for x in candidates)
|
|
1049
|
+
known_addr: List[float] = []
|
|
1050
|
+
for candidate in candidates:
|
|
1051
|
+
for addr_value in (candidate.get("address_start"), candidate.get("address_end")):
|
|
1052
|
+
if addr_value is not None:
|
|
1053
|
+
known_addr.append(addr_value)
|
|
1054
|
+
return {
|
|
1055
|
+
"available": True,
|
|
1056
|
+
"schema": "msopprof-onchip-memory/v1",
|
|
1057
|
+
"source_name": path.name,
|
|
1058
|
+
"status": "partial" if errors else "ok",
|
|
1059
|
+
"errors": errors,
|
|
1060
|
+
"blocks": candidates,
|
|
1061
|
+
"execution_range": [start_min, end_max],
|
|
1062
|
+
"address_range": [min(known_addr), max(known_addr)] if known_addr else None,
|
|
1063
|
+
"bank_layout": _onchip_bank_layout(raw, candidates),
|
|
1064
|
+
"summary": {"allocation_count": len(candidates),
|
|
1065
|
+
"peak_known_bytes": max((x.get("size_bytes") or 0 for x in candidates), default=0), ("t"
|
|
1066
|
+
"emporary_count"): sum(x.get("temporary") is True for x in candidates)},
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
def recursive_find_key_values(obj: Any, key_name: str) -> List[Any]:
|
|
1071
|
+
out: List[Any] = []
|
|
1072
|
+
if isinstance(obj, Mapping):
|
|
1073
|
+
for key, value in obj.items():
|
|
1074
|
+
if str(key) == key_name:
|
|
1075
|
+
out.append(value)
|
|
1076
|
+
out.extend(recursive_find_key_values(value, key_name))
|
|
1077
|
+
elif isinstance(obj, list):
|
|
1078
|
+
for value in obj:
|
|
1079
|
+
out.extend(recursive_find_key_values(value, key_name))
|
|
1080
|
+
return out
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
X_KEY_PATTERNS = ["arithmetic_intensity", "arithmetic intensity", "intensity", "ai", "x"]
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
Y_KEY_PATTERNS = ["performance", "perf", "throughput", "flops", "gflops", "tflops", "y"]
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
def first_matching_numeric(mapping: Mapping[str, Any],
|
|
1090
|
+
patterns: Sequence[str]) -> Tuple[Optional[str], Optional[float]]:
|
|
1091
|
+
for key, value in mapping.items():
|
|
1092
|
+
low = str(key).lower()
|
|
1093
|
+
if any(low == p or p in low for p in patterns):
|
|
1094
|
+
x = to_float(value)
|
|
1095
|
+
if x is not None:
|
|
1096
|
+
return str(key), x
|
|
1097
|
+
return None, None
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
def _point_label(obj: Mapping[str, Any], path: str) -> str:
|
|
1101
|
+
label = path or ("P"
|
|
1102
|
+
"oint")
|
|
1103
|
+
for key in obj:
|
|
1104
|
+
if str(key).lower() in {"name", "label", "series", "type"}:
|
|
1105
|
+
label = str(obj[key])
|
|
1106
|
+
break
|
|
1107
|
+
return label
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
def collect_point_candidates(obj: Any, path: str = "") -> List[Dict[str, Any]]:
|
|
1111
|
+
points: List[Dict[str, Any]] = []
|
|
1112
|
+
if isinstance(obj, Mapping):
|
|
1113
|
+
xk, x = first_matching_numeric(obj, X_KEY_PATTERNS)
|
|
1114
|
+
yk, y = first_matching_numeric(obj, Y_KEY_PATTERNS)
|
|
1115
|
+
if x is not None and y is not None and xk != yk:
|
|
1116
|
+
points.append({"x": x, "y": y, "label": _point_label(obj, path)})
|
|
1117
|
+
for key, value in obj.items():
|
|
1118
|
+
points.extend(collect_point_candidates(value, f"{path}.{key}" if path else str(key)))
|
|
1119
|
+
elif isinstance(obj, list):
|
|
1120
|
+
for i, value in enumerate(obj):
|
|
1121
|
+
points.extend(collect_point_candidates(value, f"{path}[{i}]"))
|
|
1122
|
+
return points
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
def _advice_item_lines(item: Any) -> List[str]:
|
|
1126
|
+
cleaned_lines: List[str] = []
|
|
1127
|
+
for line in str(item).splitlines():
|
|
1128
|
+
cleaned = re.sub(r"^[\s\t\-\d\)\.]+", "", line).strip()
|
|
1129
|
+
if cleaned:
|
|
1130
|
+
cleaned_lines.append(cleaned)
|
|
1131
|
+
return cleaned_lines
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
def _collect_advice_item(found: List[str], item: Any) -> None:
|
|
1135
|
+
for cleaned in _advice_item_lines(item):
|
|
1136
|
+
if cleaned not in found:
|
|
1137
|
+
found.append(cleaned)
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
def collect_top_level_advice(records: Sequence[Mapping[str, Any]]) -> List[str]:
|
|
1141
|
+
found: List[str] = []
|
|
1142
|
+
for record in records:
|
|
1143
|
+
value = record.get("advice")
|
|
1144
|
+
values = value if isinstance(value, list) else [value]
|
|
1145
|
+
for item in values:
|
|
1146
|
+
if item is None:
|
|
1147
|
+
continue
|
|
1148
|
+
_collect_advice_item(found, item)
|
|
1149
|
+
return found
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
def _normalized_ratio_fraction(value: Any, measured: Optional[float], limit: Optional[float]) -> Optional[float]:
|
|
1153
|
+
"""Return a ratio as a fraction while preserving profiler variability.
|
|
1154
|
+
|
|
1155
|
+
Native profiler versions may emit either a fraction (0.14) or percentage
|
|
1156
|
+
points (14.0). When the native value is absent, derive the ratio only from
|
|
1157
|
+
the canonical measured point and its active roofline limit.
|
|
1158
|
+
"""
|
|
1159
|
+
ratio = to_float(value)
|
|
1160
|
+
if ratio is not None and ratio >= 0:
|
|
1161
|
+
if ratio > 1.5 and ratio <= 100:
|
|
1162
|
+
ratio /= 100.0
|
|
1163
|
+
return ratio
|
|
1164
|
+
if measured is not None and limit is not None and limit > 0:
|
|
1165
|
+
return measured / limit
|
|
1166
|
+
return None
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
def _roofline_bound(arithmetic_intensity: float, knee_intensity: Optional[float]) -> str:
|
|
1170
|
+
if knee_intensity is None or knee_intensity <= 0:
|
|
1171
|
+
return "unknown"
|
|
1172
|
+
tolerance = 0.02
|
|
1173
|
+
if arithmetic_intensity < knee_intensity * (1 - tolerance):
|
|
1174
|
+
return "bandwidth-bound region"
|
|
1175
|
+
if arithmetic_intensity > knee_intensity * (1 + tolerance):
|
|
1176
|
+
return "compute-bound region"
|
|
1177
|
+
return "ridge region"
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
def _roofline_chart_rank(title: str, source_index: int) -> Tuple[int, int]:
|
|
1181
|
+
"""Order architecture-level memory roofs before execution-unit roofs.
|
|
1182
|
+
|
|
1183
|
+
This is a semantic display rule, not an operator-specific title whitelist.
|
|
1184
|
+
Unknown profiler titles retain their source order after known categories.
|
|
1185
|
+
"""
|
|
1186
|
+
text = title.casefold()
|
|
1187
|
+
hierarchy_tokens = ("gm", "l2", "dram", "global memory", "memory hierarchy")
|
|
1188
|
+
unit_tokens = ("memory unit", "vector", "cube", "simt", "simd", "tensor")
|
|
1189
|
+
if any(token in text for token in hierarchy_tokens):
|
|
1190
|
+
return 0, source_index
|
|
1191
|
+
if any(token in text for token in unit_tokens):
|
|
1192
|
+
return 1, source_index
|
|
1193
|
+
return 2, source_index
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
def _roofline_curve_metrics(
|
|
1197
|
+
raw: Mapping[str, Any],
|
|
1198
|
+
x: float,
|
|
1199
|
+
y: float,
|
|
1200
|
+
) -> Tuple[Optional[float], Optional[float], Optional[float], Optional[float], Optional[float]]:
|
|
1201
|
+
bandwidth = to_float(raw.get("bw"))
|
|
1202
|
+
compute_ceiling = to_float(raw.get("computility"))
|
|
1203
|
+
has_curve = bandwidth is not None and bandwidth > 0 and compute_ceiling is not None and compute_ceiling > 0
|
|
1204
|
+
knee_intensity = compute_ceiling / bandwidth if has_curve else None
|
|
1205
|
+
roofline_limit = min(bandwidth * x, compute_ceiling) if has_curve else None
|
|
1206
|
+
ratio_fraction = _normalized_ratio_fraction(raw.get("ratio"), y, roofline_limit)
|
|
1207
|
+
return bandwidth, compute_ceiling, knee_intensity, roofline_limit, ratio_fraction
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
def _roofline_row_item(
|
|
1211
|
+
raw: Mapping[str, Any],
|
|
1212
|
+
group_index: int,
|
|
1213
|
+
row_index: int,
|
|
1214
|
+
title: str,
|
|
1215
|
+
) -> Optional[Tuple[Dict[str, Any], Dict[str, Any]]]:
|
|
1216
|
+
point = raw.get("point")
|
|
1217
|
+
x = y = None
|
|
1218
|
+
if isinstance(point, (list, tuple)) and len(point) >= 2:
|
|
1219
|
+
x = to_float(point[0])
|
|
1220
|
+
y = to_float(point[1])
|
|
1221
|
+
if x is None or y is None:
|
|
1222
|
+
_, x = first_matching_numeric(raw, X_KEY_PATTERNS)
|
|
1223
|
+
_, y = first_matching_numeric(raw, Y_KEY_PATTERNS)
|
|
1224
|
+
if x is None or y is None:
|
|
1225
|
+
return None
|
|
1226
|
+
if x <= 0 or y <= 0:
|
|
1227
|
+
return None
|
|
1228
|
+
|
|
1229
|
+
bandwidth, compute_ceiling, knee_intensity, roofline_limit, ratio_fraction = _roofline_curve_metrics(raw, x, y)
|
|
1230
|
+
bandwidth_name = str(raw.get("bw_name") or "Bandwidth")
|
|
1231
|
+
compute_name = str(raw.get("computility_name") or "Compute")
|
|
1232
|
+
series_id = f"{group_index}:{row_index}"
|
|
1233
|
+
item = {
|
|
1234
|
+
"series_id": series_id,
|
|
1235
|
+
"curve_id": f"{bandwidth_name}|{compute_name}|{bandwidth}|{compute_ceiling}",
|
|
1236
|
+
"bandwidth": bandwidth,
|
|
1237
|
+
"bandwidth_name": bandwidth_name,
|
|
1238
|
+
"compute_ceiling": compute_ceiling,
|
|
1239
|
+
"compute_name": compute_name,
|
|
1240
|
+
"point": {"x": x, "y": y},
|
|
1241
|
+
"arithmetic_intensity": x,
|
|
1242
|
+
"measured_performance": y,
|
|
1243
|
+
"knee_intensity": knee_intensity,
|
|
1244
|
+
"roofline_limit": roofline_limit,
|
|
1245
|
+
"ratio": ratio_fraction,
|
|
1246
|
+
"ratio_percent": ratio_fraction * 100 if ratio_fraction is not None else None,
|
|
1247
|
+
"bound_region": _roofline_bound(x, knee_intensity),
|
|
1248
|
+
}
|
|
1249
|
+
flat_point = {
|
|
1250
|
+
"series_id": series_id,
|
|
1251
|
+
"chart_title": title,
|
|
1252
|
+
"x": x,
|
|
1253
|
+
"y": y,
|
|
1254
|
+
"label": f"{title} · {bandwidth_name} · {compute_name}",
|
|
1255
|
+
}
|
|
1256
|
+
for shared_key in ("bandwidth", "compute_ceiling", "knee_intensity", "roofline_limit",
|
|
1257
|
+
"ratio", "ratio_percent", "bound_region"):
|
|
1258
|
+
flat_point[shared_key] = item.get(shared_key)
|
|
1259
|
+
return item, flat_point
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
def _roofline_group_rows(
|
|
1263
|
+
group: Mapping[str, Any],
|
|
1264
|
+
group_index: int,
|
|
1265
|
+
title: str,
|
|
1266
|
+
) -> Tuple[List[Dict[str, Any]], List[Dict[str, Any]]]:
|
|
1267
|
+
rows: List[Dict[str, Any]] = []
|
|
1268
|
+
flat_points: List[Dict[str, Any]] = []
|
|
1269
|
+
for row_index, raw in enumerate(group.get("rooflines") or []):
|
|
1270
|
+
if not isinstance(raw, Mapping):
|
|
1271
|
+
continue
|
|
1272
|
+
parsed = _roofline_row_item(raw, group_index, row_index, title)
|
|
1273
|
+
if parsed is None:
|
|
1274
|
+
continue
|
|
1275
|
+
item, flat_point = parsed
|
|
1276
|
+
rows.append(item)
|
|
1277
|
+
flat_points.append(flat_point)
|
|
1278
|
+
return rows, flat_points
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
def _roofline_native_charts(
|
|
1282
|
+
records: Sequence[Mapping[str, Any]],
|
|
1283
|
+
) -> Tuple[List[Dict[str, Any]], List[Dict[str, Any]]]:
|
|
1284
|
+
charts: List[Dict[str, Any]] = []
|
|
1285
|
+
flat_points: List[Dict[str, Any]] = []
|
|
1286
|
+
seen_chart_signatures: set[Tuple[Any, ...]] = set()
|
|
1287
|
+
|
|
1288
|
+
for record in records:
|
|
1289
|
+
source = record.get("multiple_rooflines")
|
|
1290
|
+
if not isinstance(source, list):
|
|
1291
|
+
continue
|
|
1292
|
+
for group_index, group in enumerate(source):
|
|
1293
|
+
if not isinstance(group, Mapping):
|
|
1294
|
+
continue
|
|
1295
|
+
title = str(group.get("title") or f"Roofline {group_index + 1}")
|
|
1296
|
+
rows, group_flat_points = _roofline_group_rows(group, group_index, title)
|
|
1297
|
+
flat_points.extend(group_flat_points)
|
|
1298
|
+
if not rows:
|
|
1299
|
+
continue
|
|
1300
|
+
signature = (
|
|
1301
|
+
title,
|
|
1302
|
+
tuple((r["bandwidth_name"], r["compute_name"], r["point"]["x"], r["point"]["y"]) for r in rows),
|
|
1303
|
+
)
|
|
1304
|
+
if signature in seen_chart_signatures:
|
|
1305
|
+
continue
|
|
1306
|
+
seen_chart_signatures.add(signature)
|
|
1307
|
+
charts.append({
|
|
1308
|
+
"title": title,
|
|
1309
|
+
"source_index": group_index,
|
|
1310
|
+
"series": rows,
|
|
1311
|
+
"bandwidth_names": list(dict.fromkeys(r["bandwidth_name"] for r in rows)),
|
|
1312
|
+
"compute_names": list(dict.fromkeys(r["compute_name"] for r in rows)),
|
|
1313
|
+
"axis": {
|
|
1314
|
+
"x_label": "Arithmetic Intensity",
|
|
1315
|
+
"x_unit": "Ops/Byte",
|
|
1316
|
+
"y_label": "Performance",
|
|
1317
|
+
"y_unit": "TOPS/s",
|
|
1318
|
+
"scale": "logarithmic",
|
|
1319
|
+
},
|
|
1320
|
+
})
|
|
1321
|
+
return charts, flat_points
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
def _roofline_fallback_charts(
|
|
1325
|
+
records: Sequence[Mapping[str, Any]],
|
|
1326
|
+
) -> Tuple[List[Dict[str, Any]], List[Dict[str, Any]]]:
|
|
1327
|
+
items: List[Any] = []
|
|
1328
|
+
for record in records:
|
|
1329
|
+
if isinstance(record.get("multiple_rooflines"), list):
|
|
1330
|
+
items.extend(record["multiple_rooflines"])
|
|
1331
|
+
points = collect_point_candidates(items)
|
|
1332
|
+
seen = set()
|
|
1333
|
+
unique_points = []
|
|
1334
|
+
for point in points:
|
|
1335
|
+
key = (round(point["x"], 12), round(point["y"], 12), point["label"])
|
|
1336
|
+
if key not in seen and point["x"] > 0 and point["y"] > 0:
|
|
1337
|
+
seen.add(key)
|
|
1338
|
+
unique_points.append(point)
|
|
1339
|
+
if not unique_points:
|
|
1340
|
+
return [], unique_points
|
|
1341
|
+
series: List[Dict[str, Any]] = []
|
|
1342
|
+
for index, point in enumerate(unique_points):
|
|
1343
|
+
series.append({
|
|
1344
|
+
"series_id": f"fallback:{index}",
|
|
1345
|
+
"curve_id": f"fallback:{index}",
|
|
1346
|
+
"bandwidth": None,
|
|
1347
|
+
"bandwidth_name": "Measured point",
|
|
1348
|
+
"compute_ceiling": None,
|
|
1349
|
+
"compute_name": str(point.get("label") or "Point"),
|
|
1350
|
+
"point": {"x": point["x"], "y": point["y"]},
|
|
1351
|
+
"arithmetic_intensity": point["x"],
|
|
1352
|
+
"measured_performance": point["y"],
|
|
1353
|
+
"knee_intensity": None,
|
|
1354
|
+
"roofline_limit": None,
|
|
1355
|
+
"ratio": None,
|
|
1356
|
+
"ratio_percent": None,
|
|
1357
|
+
"bound_region": "unknown",
|
|
1358
|
+
})
|
|
1359
|
+
charts = [{
|
|
1360
|
+
"title": "Roofline",
|
|
1361
|
+
"source_index": 0,
|
|
1362
|
+
"series": series,
|
|
1363
|
+
"bandwidth_names": ["Measured point"],
|
|
1364
|
+
"compute_names": list(dict.fromkeys(str(point.get("label") or "Point") for point in unique_points)),
|
|
1365
|
+
"axis": {
|
|
1366
|
+
"x_label": "Arithmetic Intensity",
|
|
1367
|
+
"x_unit": "Ops/Byte",
|
|
1368
|
+
"y_label": "Performance",
|
|
1369
|
+
"y_unit": "TOPS/s",
|
|
1370
|
+
"scale": "logarithmic",
|
|
1371
|
+
},
|
|
1372
|
+
}]
|
|
1373
|
+
return charts, unique_points
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
def parse_roofline(records: Sequence[Mapping[str, Any]]) -> Dict[str, Any]:
|
|
1377
|
+
"""Normalize native and fallback Roofline payloads into an interactive model.
|
|
1378
|
+
|
|
1379
|
+
The model deliberately describes semantics rather than any specific
|
|
1380
|
+
operator: every native chart, bandwidth source, compute ceiling and point
|
|
1381
|
+
becomes a self-contained series that can be rendered alone or composed
|
|
1382
|
+
with other report modules.
|
|
1383
|
+
"""
|
|
1384
|
+
charts, flat_points = _roofline_native_charts(records)
|
|
1385
|
+
|
|
1386
|
+
# Backward-compatible fallback for earlier x/y-shaped payloads. It keeps
|
|
1387
|
+
# measured coordinates visible without inventing bandwidths or ceilings.
|
|
1388
|
+
if not charts:
|
|
1389
|
+
charts, flat_points = _roofline_fallback_charts(records)
|
|
1390
|
+
|
|
1391
|
+
charts.sort(key=lambda chart: _roofline_chart_rank(str(chart.get("title", "")), int(chart.get("source_index", 0))))
|
|
1392
|
+
chart_order = {str(chart.get("title")): i for i, chart in enumerate(charts)}
|
|
1393
|
+
flat_points.sort(key=lambda point: (chart_order.get(str(point.get("chart_title",
|
|
1394
|
+
str(point.get("label", "")).split((" "
|
|
1395
|
+
"· "), 1)[0])), 999), str(point.get("label", ""))))
|
|
1396
|
+
|
|
1397
|
+
advice = collect_top_level_advice(records)
|
|
1398
|
+
return {
|
|
1399
|
+
"available": bool(charts or advice),
|
|
1400
|
+
"plot_available": bool(charts),
|
|
1401
|
+
"charts": charts,
|
|
1402
|
+
"points": flat_points[:400],
|
|
1403
|
+
"advice": advice,
|
|
1404
|
+
"coordinate_contract": "point=[arithmetic_intensity_ops_per_byte, measured_performance_tops_per_s]",
|
|
1405
|
+
"interaction_contract": {
|
|
1406
|
+
"continuous_crosshair": True,
|
|
1407
|
+
"axis_coordinate_readout": True,
|
|
1408
|
+
"point_tooltip": True,
|
|
1409
|
+
"curve_tooltip": True,
|
|
1410
|
+
"curve_hover_emphasis": True,
|
|
1411
|
+
},
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
class _TraceSink(NamedTuple):
|
|
1416
|
+
lanes: Dict[Tuple[str, str], List[Dict[str, Any]]]
|
|
1417
|
+
stacks: Dict[Tuple[str, str], List[Dict[str, Any]]]
|
|
1418
|
+
starts: List[float]
|
|
1419
|
+
ends: List[float]
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
class _TraceEvent(NamedTuple):
|
|
1423
|
+
name: str
|
|
1424
|
+
category: str
|
|
1425
|
+
start: float
|
|
1426
|
+
duration: float
|
|
1427
|
+
args: Any
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
def _trace_add_event(sink: _TraceSink, lane: Tuple[str, str], event: _TraceEvent) -> None:
|
|
1431
|
+
if event.duration < 0:
|
|
1432
|
+
return
|
|
1433
|
+
item = {
|
|
1434
|
+
"name": event.name,
|
|
1435
|
+
"category": event.category,
|
|
1436
|
+
"start": event.start,
|
|
1437
|
+
"duration": event.duration,
|
|
1438
|
+
"args": event.args if isinstance(event.args, Mapping) else {},
|
|
1439
|
+
}
|
|
1440
|
+
sink.lanes[lane].append(item)
|
|
1441
|
+
sink.starts.append(event.start)
|
|
1442
|
+
sink.ends.append(event.start + event.duration)
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
def _trace_consume(events: Sequence[Any], sink: _TraceSink) -> None:
|
|
1446
|
+
for raw in events:
|
|
1447
|
+
if not isinstance(raw, Mapping):
|
|
1448
|
+
continue
|
|
1449
|
+
ph = str(raw.get("ph", ""))
|
|
1450
|
+
pid = str(raw.get("pid", "process"))
|
|
1451
|
+
tid = str(raw.get("tid", "lane"))
|
|
1452
|
+
ts = to_float(raw.get("ts"))
|
|
1453
|
+
if ph == "X":
|
|
1454
|
+
dur = to_float(raw.get("dur"))
|
|
1455
|
+
if ts is None or dur is None:
|
|
1456
|
+
continue
|
|
1457
|
+
_trace_add_event(sink, (pid, tid), _TraceEvent(str(raw.get("name", "event")),
|
|
1458
|
+
str(raw.get("cat", raw.get("cname", ""))), ts, dur, raw.get(("a"
|
|
1459
|
+
"rgs"), {})))
|
|
1460
|
+
elif ph == "B" and ts is not None:
|
|
1461
|
+
sink.stacks[(pid, tid)].append({
|
|
1462
|
+
"name": str(raw.get("name", "event")),
|
|
1463
|
+
"category": str(raw.get("cat", raw.get("cname", ""))),
|
|
1464
|
+
"start": ts,
|
|
1465
|
+
"args": raw.get("args", {}),
|
|
1466
|
+
})
|
|
1467
|
+
elif ph == "E" and ts is not None and sink.stacks[(pid, tid)]:
|
|
1468
|
+
begin = sink.stacks[(pid, tid)].pop()
|
|
1469
|
+
_trace_add_event(sink, (pid, tid), _TraceEvent(begin["name"], begin["category"],
|
|
1470
|
+
begin["start"], ts - begin["start"], begin["args"]))
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
def _trace_out_lanes(
|
|
1474
|
+
lanes: Dict[Tuple[str, str], List[Dict[str, Any]]],
|
|
1475
|
+
max_events: int,
|
|
1476
|
+
) -> Tuple[List[Dict[str, Any]], int]:
|
|
1477
|
+
out_lanes: List[Dict[str, Any]] = []
|
|
1478
|
+
embedded_count = 0
|
|
1479
|
+
for (pid, tid), items in sorted(lanes.items(), key=lambda kv: (kv[0][0], kv[0][1])):
|
|
1480
|
+
items.sort(key=lambda x: (x["start"], x["duration"]))
|
|
1481
|
+
remaining = max_events - embedded_count
|
|
1482
|
+
if remaining <= 0:
|
|
1483
|
+
break
|
|
1484
|
+
kept = items[:remaining]
|
|
1485
|
+
embedded_count += len(kept)
|
|
1486
|
+
out_lanes.append({"pid": pid, "tid": tid, "label": f"{pid} / {tid}", "events": kept})
|
|
1487
|
+
return out_lanes, embedded_count
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
def _trace_timeline_kind(lanes: Mapping[Tuple[str, str], List[Dict[str, Any]]]) -> Tuple[str, str]:
|
|
1491
|
+
lane_tokens = " ".join(f"{pid} {tid}" for pid, tid in lanes).upper()
|
|
1492
|
+
event_tokens = " ".join(
|
|
1493
|
+
str(item.get("name", ""))
|
|
1494
|
+
for items in lanes.values()
|
|
1495
|
+
for item in items[:20]
|
|
1496
|
+
).upper()
|
|
1497
|
+
combined_tokens = f"{lane_tokens} {event_tokens}"
|
|
1498
|
+
communication_markers = ("HCCL", "AI CPU", "AIC BLOCK", "AIV BLOCK", "ASCENDC API", "TURN")
|
|
1499
|
+
pipe_markers = ("SCALAR", "VECTOR", "MTE1", "MTE2", "MTE3", "CUBE", "FIXPIPE")
|
|
1500
|
+
if any(token in combined_tokens for token in communication_markers):
|
|
1501
|
+
return "communication", "Communication-Compute Timeline"
|
|
1502
|
+
if any(token in combined_tokens for token in pipe_markers):
|
|
1503
|
+
return "pipe", "Pipe Timeline"
|
|
1504
|
+
return "generic", "Timeline"
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
def parse_trace_events(events: Sequence[Any], max_events: int = 10000) -> Dict[str, Any]:
|
|
1508
|
+
sink = _TraceSink(defaultdict(list), defaultdict(list), [], [])
|
|
1509
|
+
_trace_consume(events, sink)
|
|
1510
|
+
lanes, starts, ends = sink.lanes, sink.starts, sink.ends
|
|
1511
|
+
|
|
1512
|
+
if not starts:
|
|
1513
|
+
return {"available": False, "lanes": []}
|
|
1514
|
+
t0, t1 = min(starts), max(ends)
|
|
1515
|
+
out_lanes, embedded_count = _trace_out_lanes(lanes, max_events)
|
|
1516
|
+
timeline_type, timeline_title = _trace_timeline_kind(lanes)
|
|
1517
|
+
return {
|
|
1518
|
+
"available": True,
|
|
1519
|
+
"timeline_type": timeline_type,
|
|
1520
|
+
"title": timeline_title,
|
|
1521
|
+
"start": t0,
|
|
1522
|
+
"end": t1,
|
|
1523
|
+
"duration": t1 - t0,
|
|
1524
|
+
"event_count": sum(len(v) for v in lanes.values()),
|
|
1525
|
+
"embedded_event_count": embedded_count,
|
|
1526
|
+
"lanes": out_lanes,
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
def load_trace_from_path(path: Optional[Path], max_events: int) -> Optional[Dict[str, Any]]:
|
|
1531
|
+
if not path or not path.is_file() or path.stat().st_size == 0:
|
|
1532
|
+
return None
|
|
1533
|
+
try:
|
|
1534
|
+
# The trace can be tens of MB while only ~max_events are embedded, but
|
|
1535
|
+
# event_count, B/E stack pairing and the global t0/t1 range all require
|
|
1536
|
+
# the full event list, so a partial/streaming parse would not be exact.
|
|
1537
|
+
raw = json.loads(path.read_text(encoding="utf-8"))
|
|
1538
|
+
except Exception as exc:
|
|
1539
|
+
logger.debug("Failed to load trace from %s: %s", path, exc)
|
|
1540
|
+
return None
|
|
1541
|
+
events = raw.get("traceEvents", raw if isinstance(raw, list) else []) if isinstance(raw, (dict, list)) else []
|
|
1542
|
+
if not isinstance(events, list):
|
|
1543
|
+
return None
|
|
1544
|
+
return parse_trace_events(events, max_events=max_events)
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
def parse_timeline(artifacts: ArtifactSet, max_events: int) -> Dict[str, Any]:
|
|
1548
|
+
parsed = load_trace_from_path(artifacts.trace, max_events)
|
|
1549
|
+
if parsed and parsed.get("available"):
|
|
1550
|
+
return parsed
|
|
1551
|
+
records = load_visualize_records(artifacts.visualize_data)
|
|
1552
|
+
for record in records:
|
|
1553
|
+
if isinstance(record.get("traceEvents"), list):
|
|
1554
|
+
return parse_trace_events(record["traceEvents"], max_events=max_events)
|
|
1555
|
+
return {"available": False, "lanes": []}
|