Skip to content

Add: insight-trace skill for in-core swim lane diagrams#728

Open
chenshengxin2026 wants to merge 1 commit intohw-native-sys:mainfrom
chenshengxin2026:skill-insight-trace
Open

Add: insight-trace skill for in-core swim lane diagrams#728
chenshengxin2026 wants to merge 1 commit intohw-native-sys:mainfrom
chenshengxin2026:skill-insight-trace

Conversation

@chenshengxin2026
Copy link
Copy Markdown
Contributor

Summary

Add a new skill at .claude/skills/insight-trace/ that walks through generating MindStudio Insight traces (per-core swim lane diagrams) for kernel_entry(args) style kernels in this repo.

The skill is self-contained and covers all three supported kernel shapes:

  • SPMD mix — both __DAV_CUBE__ and __DAV_VEC__ include the kernel; args use slot 48/49 for LocalContext*/GlobalContext* (e.g. paged_attention_parallel.cpp).
  • AIC-only single task — only __DAV_CUBE__ includes the kernel (e.g. aic_pv_matmul.cpp).
  • AIV-only single task — only __DAV_VEC__ includes the kernel (e.g. aiv_softmax_prepare.cpp).

The recipe builds a single mix-arch .so wrapper around the target kernel, launches it under msprof op simulator, and exports the per-core trace.json + instr_exe CSVs that MindStudio Insight consumes.

Scope

  • AICore-only replay path — bypasses AICPU orchestration. AICPU scheduler / tensormap / ringbuffer state machine traces still require real-hardware msprof --application (the simulator returns 207000 on the AICPU KFC launch).
  • For PTOAS-style kernels, the existing PTOAS msprof skill is referenced instead.

Testing

  • python3 tests/lint/check_english_only.py passes on the new file
  • markdownlint-cli2 passes with the repo config
  • Reviewer dry-run of the skill on an SPMD / AIC-only / AIV-only kernel

Adds a self-contained skill that walks through generating MindStudio
Insight traces (per-core swim lane diagrams) for kernel_entry(args)
style kernels under msprof op simulator. Covers SPMD mix, AIC-only,
and AIV-only kernel shapes via a single mix-arch .so wrapper, then
exports the trace.json + instr_exe CSVs that Insight consumes.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive skill guide for generating MindStudio Insight traces for kernel_entry(args) style kernels. The documentation outlines a complete workflow, from kernel classification and input gathering to workspace creation and artifact verification. Review feedback correctly identifies the need to use proper CCEC hardware intrinsic names (e.g., GetBlockIdx) in the code templates to avoid compilation conflicts and suggests increasing the msprof timeout to ensure successful profiling of complex kernels.

Comment thread .claude/skills/insight-trace/SKILL.md
Comment thread .claude/skills/insight-trace/SKILL.md
Comment thread .claude/skills/insight-trace/SKILL.md
Comment thread .claude/skills/insight-trace/SKILL.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant