Skip to content

Add Ascend CANN msprof + aclGraph import support (ledger ascend-import) - #1

Merged
ZacharyZcR merged 2 commits into
VirtualGPU:mainfrom
0Chencc:feat/ascend-msprof-import
Nov 27, 2026
Merged

ZacharyZcR merged 2 commits into
VirtualGPU:mainfrom
0Chencc:feat/ascend-msprof-import

Conversation

@0Chencc

@0Chencc 0Chencc commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add ledger/ascend.py and CLI subcommand ledger ascend-import to convert Huawei Ascend CANN msprof --export=on outputs (op_summary_*.csv and task_time_*.csv), aclmdlRIDebugPrint JSON graph dumps (--graph, optional --stream-map), and named weight/KV maps (--weights, --draft-weights, --owners, or --regions) into standard Ledger capture directories (kernels-0.jsonl, nodes-0.jsonl, memcpys-0.jsonl, regions-ascend.json, run.json).
  • Handle CANN msprof HCCL reporting cleanly: deduplicate paired Stream ID = N/A summary rows by enriching the matching device AivKernel row with the collective name, while retaining unmatched SDMA/RDMA N/A collective rows on a dedicated virtual stream (-1) so they are neither double-counted nor dropped as fake idle gaps.
  • Extend ledger/analyze.py and ledger/ceilings.py with int8 / int4 weight precision support and draft. draft-weight prefix matching.
  • Document ledger ascend-import in README.md and docs/quickstart.md, and add unit + end-to-end tests in tests/test_ascend.py.

Verification

  • Verified full pytest suite on Linux (37 passed, including tests/test_ascend.py).
  • Validated end-to-end on real Ascend 910B1 (CANN 9.2.1) speculative decode (capture-64 + draft-64, 2879/2971 launches resolved with aclGraph pointer args) and prefill-8192 (2985 launches including SDMA hcom_reduceScatter) captures with ledger analyze, ledger transfers, and ledger perfetto.

0Chencc and others added 2 commits November 27, 2026 22:55
Add ledger ascend-import (ledger/ascend.py) to convert CANN msprof exports
(op_summary_*.csv and task_time_*.csv), aclmdlRIDebugPrint graph dumps, and
weight/KV descriptor maps into standard Ledger capture directories so
analyze, transfers, diff, and perfetto work on Ascend NPU traces.

Also extend analyze.py and ceilings.py to recognize int8/int4 quantized
weights and draft.* prefixes, and add unit and end-to-end tests in
tests/test_ascend.py.
Rename the module to ascend_import so the CLI dispatches it like every other
command. Graph dumps that give one (stream, task) pair different kernel args
now warn instead of overwriting silently. Timestamps are parsed as decimals:
epoch microseconds lose nanoseconds in a float. A malformed --stream-map exits
with a message. Document that msprof memcpys carry no size or direction. int4
is not a dtype any capture has produced; remove it until one does.
@ZacharyZcR

Copy link
Copy Markdown
Contributor

Thanks for this — the importer is clean and the HCCL deduplication is a nice touch. I pushed one follow-up commit to the branch before merging:

  • Renamed the module to ledger/ascend_import.py so the CLI dispatches it like the other commands (no special case in cli.py).
  • Graph dumps that give the same (Stream Id, Task Id) different Kernel Args now print a warning instead of the later dump silently replacing the earlier one.
  • Timestamps are parsed with Decimal; epoch microseconds with three decimals do not fit a float to the nanosecond.
  • A malformed --stream-map exits with a readable message.
  • Documented that msprof MEMCPY_ASYNC rows carry no size or direction, so ledger transfers shows their times but 0 bytes.
  • Removed int4 for now: no capture has produced that dtype and it was untested. Happy to add it back with a real example.

@ZacharyZcR
ZacharyZcR merged commit 855a867 into VirtualGPU:main Nov 27, 2026
1 check passed
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.

2 participants