Repository navigation
Add Ascend CANN msprof + aclGraph import support (ledger ascend-import) - #1
Merged
Merged
Conversation
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.
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ledger/ascend.pyand CLI subcommandledger ascend-importto convert Huawei Ascend CANNmsprof --export=onoutputs (op_summary_*.csvandtask_time_*.csv),aclmdlRIDebugPrintJSON 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).msprofHCCL reporting cleanly: deduplicate pairedStream ID = N/Asummary rows by enriching the matching deviceAivKernelrow with the collective name, while retaining unmatched SDMA/RDMAN/Acollective rows on a dedicated virtual stream (-1) so they are neither double-counted nor dropped as fake idle gaps.ledger/analyze.pyandledger/ceilings.pywithint8/int4weight precision support anddraft.draft-weight prefix matching.ledger ascend-importinREADME.mdanddocs/quickstart.md, and add unit + end-to-end tests intests/test_ascend.py.Verification
pytestsuite on Linux (37 passed, includingtests/test_ascend.py).CANN 9.2.1) speculative decode (capture-64+draft-64,2879/2971launches resolved withaclGraphpointer args) andprefill-8192(2985launches including SDMAhcom_reduceScatter) captures withledger analyze,ledger transfers, andledger perfetto.