ascend-moe-optimizer-auto-trace

Generate and validate TRACE_POINT instrumentation and Chrome trace workflows for Ascend MoE operators.

2.5k|422|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/openJiuwen-ai/jiuwenswarm --skill ascend-moe-optimizer-auto-trace
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ascend-moe-optimizer-auto-trace
Source: https://github.com/openJiuwen-ai/jiuwenswarm/tree/main/jiuwenswarm/resources/agent/workspace/skills/ascend-moe-optimizer-auto-trace
Command: npx skills add https://github.com/openJiuwen-ai/jiuwenswarm --skill ascend-moe-optimizer-auto-trace

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you add end-to-end TRACE_POINT instrumentation and MoE profiling capture for Ascend operators, so you can generate Chrome trace JSON that pinpoints performance bottlenecks across AIC/AIV execution paths.

Core Features & Use Cases

  • Full-chain instrumentation & profiling: inserts TRACE_POINT around real operator phase boundaries (not just shell entries), captures per-core profiling tensors, and decodes them into Chrome trace events.
  • Strict correctness guardrails (G1–G5): enforces trace preprocessor hook/point_map generation consistency, output arity and “profiling is last” ordering, compilation and example/UT synchronization + save steps, and absolute-path safety for spawned multiprocessing.
  • Toolchain deployment + compile hook integration: can deploy trace toolchain scripts and patch existing compile scripts with a preprocessor hook for the active build tree.
  • Validation workflow: runs validate_trace_points.py and check_compile_safety.py, then guides the required full compilation and profile/trace generation steps.

Quick Start

Ask for instrumentation and trace generation for an Ascend MoE operator (e.g., “Add TRACE_POINT + profiling and produce chrome_trace.json for this op”), and then follow the skill’s G1–G5 checklist, ending with running save_profiling_data after NPU synchronization and generating chrome_trace.json via trace_collector using the same build’s point_map.json.

Frequently Asked Questions about ascend-moe-optimizer-auto-trace

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add TRACE_POINT instrumentation to Ascend MoE operators for profiling?

To add TRACE_POINT instrumentation to Ascend MoE operators, insert trace points around real operator phase boundaries for AIC/AIV paths, ensuring profiling tensors are captured per-core and decoded into Chrome trace events. This requires strict B/E pairing and point_map.json generation during compilation.

How does Chrome trace generation work for Ascend MoE operator profiling?

Chrome trace generation for Ascend MoE profiling works by capturing per-core profiling tensors from instrumented TRACE_POINT boundaries and decoding them into Chrome trace JSON events. It requires running trace_collector using the same build's point_map.json after device synchronization saves the profiling data.

Does Ascend MoE profiling require compilation hooks for point_map generation?

Yes, Ascend MoE profiling requires a trace preprocessor hook patched into existing compile scripts to generate point_map.json consistently. This ensures the trace_collector can accurately decode profiling tensors into Chrome trace events using the active build tree's mapping.

What is the best way to validate TRACE_POINT B/E pairing and compilation safety for Ascend operators?

The best way to validate TRACE_POINT pairing and compilation safety is by running validate_trace_points.py and check_compile_safety.py. These scripts enforce G1-G5 guardrails, verifying output arity, profiling-last ordering, and absolute-path safety before guiding the full compilation and trace generation steps.

Why does my Ascend MoE chrome_trace.json fail to generate after profiling?

Ascend MoE chrome_trace.json generation fails if profiling data is not saved after NPU synchronization or if point_map.json is missing. You must execute save_profiling_data after synchronization and run trace_collector using the exact point_map.json generated during the operator's compilation flow.

Can I use PyTorch to instrument Ascend MoE ops for Chrome trace profiling?

Yes, you can use PyTorch to instrument Ascend MoE ops for Chrome trace profiling, as the workflow relies on PyTorch dependencies. It inserts TRACE_POINT instrumentation across AIC/AIV execution paths and decodes captured profiling tensors into Chrome trace JSON format reliably.