已开启
feat(profiler): implement ACLprof backend for Kineto NPU activities #45722
denis_g创建于 9月2日
feat(profiler): implement ACLprof backend for Kineto NPU activities #45722
已开启
合并受阻
9月2日 添加了label:stat/needs-squash
9月2日 添加了label:ascend-cla/yes
9月2日 添加了label:needs-issue
ascend-robot
9月2日 评论:
9月2日 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/pytorch | ❌ (0/2)(You can also ask: zyw-hw, wangqiang160, ffmh, chenrayray, medivh-x) | ❌ (0/1)(You can also ask: zichun_ye, chujinjin, zhenyu10, 褚博宁, wanglijun55) |
| test | ❌ (0/2)(You can also ask: senzhen-town, rain-666, liujunzhu, 王朝, rmch) | ❌ (0/1)(You can also ask: kisnwang, suhaibo, liangsongwei, zichun_ye, crazyDannyBoy) |
| torch_npu/csrc/profiler | ❌ (0/2)(You can also ask: chengpeng25, 陈豪, daifu1234567, rmch, kisnwang) | ❌ (0/1)(You can also ask: li_jing_hw, 楚浩田, wangqiang160, fft1374, wasd1111222) |
| torch_npu/profiler | ❌ (0/2)(You can also ask: chengpeng25, huangjingwei, chenrayray, fft1374, wasd1111222) | ❌ (0/1)(You can also ask: liangsongwei, 陈豪, 楚浩田, zhenyu10, medivh-x) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
denis_g, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了123条消息 查看更多
10 天前 删除了label:docs-ci-pipeline-success
10 天前 添加了label:docs-ci-pipeline-running
ascend-robot
10 天前 评论:
10 天前 评论:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


10 天前 删除了label:docs-ci-pipeline-running
10 天前 添加了label:docs-ci-pipeline-success
This PR is blocked by Introduce PrivateUse1 Profiler Manager Architecture
【合入来源】
【修改方案】
This PR implements the ACLprof-based NPU activity profiler backend for Kineto. The backend selection infrastructure and ACLprof profiler stub already exist in the base branch; this PR completes the ACLprof backend implementation without changing the default MSPTI behavior.
The implementation covers the following areas:
ACLprof collection lifecycle
AclprofActivityProfiler::start()andstop()using the CANN ACL profiling APIs.ACL_PROF_TASK_TIMEandACL_PROF_ACL_API.Runtime physical-device resolution
aclrtGetPhyDevIdByUserDevId.aclrtGetPhyDevIdByUserDevId.DeviceInfo, kernel activities, and streamResourceInfo.ACLprof data export
PROF_*directory produced by ACLprof.msprof --export=onafter collection finishes.msprof*.jsontimeline files.msprofexecutable, failed export, missing profiling directory, or missing timeline output through the profiler error interface.ACLprof timeline parsing
Kernelcategory and legacy timeline shapes where device-sideTask Typeis the available discriminator.Task Typefallback when classifying device kernel records.msproftimeline formats.Kineto activity generation
CONCURRENT_KERNELGenericTraceActivityrecords.Task TypeandstreamId.CONCURRENT_KERNELcollection is requested.Unit-test coverage
Kernelclassification, hardware process metadata classification, and legacyTask Typefallback behavior.CONCURRENT_KERNELactivity gate.Component interaction
The data flow introduced by this PR is:
The default MSPTI backend is not modified by this implementation. ACLprof is activated only through the existing backend-selection mechanism, and sequential ACLprof → MSPTI → ACLprof profiling sessions remain isolated.
DFX / error handling
TraceStatus::WARNINGwhere appropriate.msprofexecution and timeline-discovery failures are explicitly reported.Scope
This PR implements ACLprof collection → msprof export → timeline parsing → Kineto NPU kernel activities.
CPU↔NPU correlation and population of
linked_correlation_idare intentionally out of scope for this PR and will be handled separately.【资料变更】
Not involved.
This PR does not change user-facing documentation or profiler APIs.
【接口变更】
Not involved.
There is no customer-visible or cross-repository API change.
An internal ACL runtime wrapper for
aclrtGetPhyDevIdByUserDevIdis added to resolve the physical NPU device ID required by the profiler backend. It is used internally by the ACLprof implementation and does not introduce a new customer-facing interface.【功能验证】
1. C++ unit tests
Unit-test coverage was added to
test/cpp/api/profiler.cppfor:Task Type;These tests use an injected ACLprof API implementation where hardware access is not required, allowing lifecycle and failure paths to be validated deterministically.
All relevant hardware-free profiler GTests passed after the final cleanup and kernel-classification correction.
2. Ascend hardware integration validation
The backend was validated on an Ascend NPU with CANN 9.1.0 using an external robust integration test.
ACLprof → MSPTI → ACLprofsequence completed successfully in a single process.Task Typemetadata present on all ACLprof kernel activities.Task Typemetadata leakage.linked_correlation_idbehavior were intentionally not covered by this validation.【CheckList】