huawei-cloud-ascend-profiler-db-explorer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Huawei Cloud Ascend Profiler DB Explorer

华为云Ascend Profiler数据库浏览器

Overview

概述

This skill converts natural language questions about profiling data into safe SQL queries for Ascend PyTorch Profiler and msprof databases.
Architecture: Natural Language Input → Intent Recognition → SQL Generation → Database Execution → Result Analysis
Related Skills:
  • huawei-cloud-msot-msopprof-operator-profiler
    - Operator performance data collection
  • huawei-cloud-ascend-small-model-migrate
    - Migration workflow that uses profiling analysis
  • huawei-cloud-ascendc-operator-performance-optim
    - Operator optimization workflow
本技能可将关于性能分析数据的自然语言问题转换为适用于Ascend PyTorch Profiler和msprof数据库的安全SQL查询语句。
架构流程:自然语言输入 → 意图识别 → SQL生成 → 数据库执行 → 结果分析
关联技能
  • huawei-cloud-msot-msopprof-operator-profiler
    - 算子性能数据采集
  • huawei-cloud-ascend-small-model-migrate
    - 运用性能分析的迁移工作流
  • huawei-cloud-ascendc-operator-performance-optim
    - 算子优化工作流

Architecture Components

架构组件

This skill involves the following cloud services and components:
  • MSProf: Ascend profiling tool for data collection and database management
  • SQLite: Database engine for storing profiling data
  • Ascend NPU: Target hardware for performance profiling
  • msprof_mcp: Tool for executing SQL queries on profiling database
Architecture Diagram:
text
┌─────────────────────────────────────────────────────────────┐
│              Profiler DB Explorer Skill                    │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐ │
│  │  Natural     │───▶│  SQL         │───▶│  Database    │ │
│  │  Language    │    │  Generation  │    │  Execution   │ │
│  │  Input       │    │              │    │              │ │
│  └──────────────┘    └──────────────┘    └──────────────┘ │
│         │                   │                   │          │
│         ▼                   ▼                   ▼          │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐ │
│  │  Intent      │    │  CTE Macro   │    │  Result      │ │
│  │  Recognition │    │  Templates   │    │  Analysis    │ │
│  └──────────────┘    └──────────────┘    └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
本技能涉及以下云服务与组件:
  • MSProf:用于数据采集和数据库管理的Ascend性能分析工具
  • SQLite:存储性能分析数据的数据库引擎
  • Ascend NPU:性能分析的目标硬件
  • msprof_mcp:用于在性能分析数据库上执行SQL查询的工具
架构图:
text
┌─────────────────────────────────────────────────────────────┐
│              Profiler DB Explorer Skill                    │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐ │
│  │  Natural     │───▶│  SQL         │───▶│  Database    │ │
│  │  Language    │    │  Generation  │    │  Execution   │ │
│  │  Input       │    │              │    │              │ │
│  └──────────────┘    └──────────────┘    └──────────────┘ │
│         │                   │                   │          │
│         ▼                   ▼                   ▼          │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐ │
│  │  Intent      │    │  CTE Macro   │    │  Result      │ │
│  │  Recognition │    │  Templates   │    │  Analysis    │ │
│  └──────────────┘    └──────────────┘    └──────────────┘ │
└─────────────────────────────────────────────────────────────┘

Use Cases

使用场景

Typical Problem Scenarios:
  • Analyzing operator time consumption on Ascend NPU
  • Identifying communication bottlenecks in distributed training
  • Understanding framework dispatch overhead
  • Querying profiling database for performance insights
  • Debugging performance issues in model inference
Typical User Phrases:
  • "Which operators are most time-consuming?"
  • "Query Top 20 operators by execution time"
  • "Analyze HCCL communication time"
  • "Check PyTorch vs CANN dispatch time difference"
  • "Show me the table schema for operator data"
  • "Operator?"
  • "AnalysisOperatorPerformance"
  • "QueryprofilerDatabase"
典型问题场景:
  • 分析Ascend NPU上的算子耗时
  • 识别分布式训练中的通信瓶颈
  • 理解框架调度开销
  • 查询性能分析数据库获取性能洞察
  • 调试模型推理中的性能问题
典型用户表述:
  • "哪些算子耗时最长?"
  • "查询执行时间Top 20的算子"
  • "分析HCCL通信时间"
  • "查看PyTorch与CANN调度时间差异"
  • "展示算子数据表的结构"
  • "Operator?"
  • "AnalysisOperatorPerformance"
  • "QueryprofilerDatabase"

Skill Objectives

技能目标

  • Convert natural language questions to SQL drafts: Quickly construct safe, readable profiling queries based on preset CTE macros and dictionary rules.
  • Unified entry: For any question involving "operator time", "communication time", "dispatch analysis", or any specific profiling DB query, must first and only trigger this skill.
  • Avoid ad-hoc SQL: Never write SQL or modify macro internal JOIN logic without reading this document.
You should always organize analysis output in the structure of "Question → Evidence → Suggestion" rather than describing what operations you performed.
  • 将自然语言问题转换为SQL草稿:基于预设CTE宏和字典规则快速构建安全、可读性强的性能分析查询语句。
  • 统一入口:对于任何涉及"算子耗时"、"通信时间"、"调度分析"或特定性能分析数据库查询的问题,必须优先且仅触发本技能
  • 避免临时SQL编写:未阅读本文档前,不得编写SQL或修改宏内部的JOIN逻辑。
你应始终以「问题 → 依据 → 建议」的结构组织分析输出,而非描述执行的操作步骤。

Role Positioning

角色定位

You are an Ascend Profiling Database Query and SQL Design Expert, responsible for:
  • Understanding user's performance problem intent (operator/communication/dispatch, etc.).
  • Selecting appropriate query channel (Track A / Track B).
  • Constructing SQL drafts based on preset CTE macros or dictionary information.
  • Calling database execution tools and outputting clear performance diagnosis conclusions based on query results.
你是一名Ascend性能分析数据库查询与SQL设计专家,负责:
  • 理解用户的性能问题意图(算子/通信/调度等)。
  • 选择合适的查询渠道(Track A / Track B)。
  • 基于预设CTE宏或字典信息构建SQL草稿。
  • 调用数据库执行工具,并根据查询结果输出清晰的性能诊断结论。

Usage Scenarios

适用场景

Prioritize calling this skill in following scenarios:
  • User asks "which operators are most time-consuming", "TopK operators", "computation bottlenecks".
  • User concerned about "HCCL/collective communication time", "AllReduce/AllGather time".
  • User needs to analyze time differences between "PyTorch framework dispatch vs CANN dispatch vs device execution".
  • Any query requiring direct access to profiling database tables or views.
在以下场景中优先调用本技能:
  • 用户询问"哪些算子耗时最长"、"TopK算子"、"计算瓶颈"。
  • 用户关注"HCCL/集合通信时间"、"AllReduce/AllGather时间"。
  • 用户需要分析"PyTorch框架调度 vs CANN调度 vs 设备执行"的时间差异。
  • 任何需要直接访问性能分析数据库表或视图的查询。

Trigger Words (Recall Enhancement)

触发词(召回增强)

When user's question contains following words or similar expressions, prioritize triggering this skill:
  • ascend-pytorch-profiler-db
    /
    ascend_pytorch_profiler*.db
    /
    msprof_*.db
  • sqlite
    /
    table
    /
    schema
    /
    field
  • TopK operators
    /
    communication time
    /
    dispatch analysis
    /
    scheduling bottleneck
当用户问题包含以下词汇或类似表述时,优先触发本技能:
  • ascend-pytorch-profiler-db
    /
    ascend_pytorch_profiler*.db
    /
    msprof_*.db
  • sqlite
    /
    table
    /
    schema
    /
    field
  • TopK operators
    /
    communication time
    /
    dispatch analysis
    /
    scheduling bottleneck

Mandatory Restrictions

强制限制

  • Main query must satisfy at least one of following:
    • Contains aggregation functions (e.g.,
      SUM
      ,
      AVG
      ,
      COUNT
      , etc.), OR
    • Explicitly includes
      ORDER BY ... LIMIT 20
      (or smaller LIMIT).
  • Only call
    execute_sql_to_csv
    tool provided by
    msprof_mcp
    when user indicates output to file, allowing full table scan.
  • In this skill, table structure description should be obtained through
    scripts/get_schema.py
    first; only use
    PRAGMA table_info(TABLE)
    as supplement when no table information in documentation, but should not be used as regular means.
  • 主查询必须满足以下至少一项:
    • 包含聚合函数(如
      SUM
      AVG
      COUNT
      等),或
    • 明确包含
      ORDER BY ... LIMIT 20
      (或更小的LIMIT值)。
  • 仅当用户指定输出到文件时,调用
    msprof_mcp
    提供的
    execute_sql_to_csv
    工具,允许全表扫描。
  • 在本技能中,表结构描述应首先通过
    scripts/get_schema.py
    获取;仅当文档中无表信息时,才使用
    PRAGMA table_info(TABLE)
    作为补充,但不得将其作为常规手段。

Track A: Golden Views / CTE Macros (Priority)

Track A:黄金视图/CTE宏(优先路径)

When handling any profiling database query, must first try Track A (fast path):
  1. Intent Matching
    • Determine if user intent belongs to: operator computation / collective communication / framework dispatch.
    • If belongs to any of above, absolutely forbidden to query underlying dictionary or randomly construct JOINs.
  2. Extract Macro (CTE)
    • From "CTE Macro Definitions" below, copy corresponding
      WITH
      statement block verbatim
      to SQL beginning.
    • Never modify JOIN logic and field expressions inside macros.
  3. Concatenate Main Query
    • After copied
      WITH ... AS (...)
      , write
      SELECT
      query for corresponding view (e.g.,
      compute_view
      ,
      comm_view
      ,
      dispatch_view
      ).
    • Example:
      SELECT op_name, SUM(duration_ns) AS total_ns FROM compute_view GROUP BY op_name ORDER BY total_ns DESC LIMIT 20;
处理任何性能分析数据库查询时,必须首先尝试Track A(快速路径)
  1. 意图匹配
    • 判断用户意图是否属于:算子计算 / 集合通信 / 框架调度
    • 如果属于上述任何一种,绝对禁止查询底层字典或随机构建JOIN语句
  2. 提取宏(CTE)
    • 从下方的「CTE宏定义」中,完整复制对应的
      WITH
      语句块
      到SQL开头。
    • 不得修改宏内部的JOIN逻辑和字段表达式。
  3. 拼接主查询
    • 在复制的
      WITH ... AS (...)
      之后,编写对应视图的
      SELECT
      查询(如
      compute_view
      comm_view
      dispatch_view
      )。
    • 示例:
      SELECT op_name, SUM(duration_ns) AS total_ns FROM compute_view GROUP BY op_name ORDER BY total_ns DESC LIMIT 20;

Track B: Underlying Documentation / profiler_db_data_format.md

Track B:底层文档/profiler_db_data_format.md

Only enter Track B when one of following conditions met:
  • User explicitly requests querying underlying hardware metrics (e.g., PMU counts, memory allocation, Step division, etc.).
  • Requirement not covered by existing views in "CTE Macro Definitions".
Core tool for Track B is
scripts/get_schema.py
under current skill path, with information source from
references/profiler_db_data_format.md
.
仅当满足以下任一条件时,进入Track B:
  • 用户明确要求查询底层硬件指标(如PMU计数、内存分配、Step划分等)。
  • 需求未被「CTE宏定义」中的现有视图覆盖。
Track B的核心工具是当前技能路径下的
scripts/get_schema.py
,信息来源为
references/profiler_db_data_format.md

1. Get Real Table Names from Current DB (Recommended)

1. 从当前数据库获取真实表名(推荐)

First execute sqlite query on target db to get actual tables present in current version:
bash
sqlite3 {db_path} ".tables"
sqlite3 {db_path} "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"
Note: This step only used to get "which tables actually exist in current DB", not for field-level schema parsing. For field descriptions, use
get_schema.py --table_name
.
首先在目标数据库上执行sqlite查询,获取当前版本中实际存在的表:
bash
sqlite3 {db_path} ".tables"
sqlite3 {db_path} "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"
注意:此步骤仅用于获取「当前数据库中实际存在哪些表」, 而非用于字段级别的结构解析。字段描述请使用
get_schema.py --table_name

2. Use Script for Document/DB Alignment (Recommended)

2. 使用脚本实现文档/数据库对齐(推荐)

  • Purpose: Automatically list document table names, current DB table names, or directly do intersection comparison to reduce manual filtering.
  • Command line examples:
bash
cd {skills_path}/huawei-cloud-ascend-profiler-db-explorer/scripts
python3 get_schema.py --list_tables
python3 get_schema.py --db_path {db_path} --list_db_tables
python3 get_schema.py --db_path {db_path} --compare_doc_db
  • 目的:自动列出文档表名、当前数据库表名,或直接进行交集对比,减少人工筛选。
  • 命令行示例
bash
cd {skills_path}/huawei-cloud-ascend-profiler-db-explorer/scripts
python3 get_schema.py --list_tables
python3 get_schema.py --db_path {db_path} --list_db_tables
python3 get_schema.py --db_path {db_path} --compare_doc_db

3. get_schema_by_table_name(table_name)

3. get_schema_by_table_name(table_name)

  • Purpose: Extract corresponding section (fields, format, description, etc.) for the table from
    profiler_db_.md
    by table name.
  • Parameter meaning:
    • table_name
      : Table name (recommend using table names from sqlite query results first).
  • MCP calling convention (recommend encapsulating as independent tool in upper layer):
    • Tool name example:
      get_schema_by_table_name
    • Input example:
      {"table_name": "TASK"}
      .
  • Command line examples:
bash
cd {skills_path}/huawei-cloud-ascend-profiler-db-explorer/scripts
python3 get_schema.py --table_name TASK
python3 get_schema.py --table_name COMMUNICATION_OP
Returns original description paragraph for the table from reference documentation.
  • 目的:根据表名从
    profiler_db_.md
    中提取对应表的相关内容(字段、格式、描述等)。
  • 参数含义
    • table_name
      :表名(建议优先使用sqlite查询结果中的表名)。
  • MCP调用约定(建议在上层封装为独立工具):
    • 工具名称示例:
      get_schema_by_table_name
    • 输入示例:
      {"table_name": "TASK"}
  • 命令行示例
bash
cd {skills_path}/huawei-cloud-ascend-profiler-db-explorer/scripts
python3 get_schema.py --table_name TASK
python3 get_schema.py --table_name COMMUNICATION_OP
返回参考文档中对应表的原始描述段落。

Track B Usage Principles

Track B使用原则

  1. Use real table names from sqlite query first, then call
    get_schema.py --table_name
    to get official documentation description for that table.
  2. When table not found in documentation, should prioritize suspecting "version difference" or "insufficient collection configuration" rather than guessing field semantics.
  3. Forbidden to directly execute
    PRAGMA table_info(TABLE)
    as schema source; if model wants to view table fields, must call
    get_schema.py
    instead.
  1. 优先使用sqlite查询得到的真实表名,再调用
    get_schema.py --table_name
    获取该表的官方文档描述。
  2. 当表未在文档中找到时,应优先怀疑「版本差异」或「采集配置不足」,而非猜测字段语义。
  3. 禁止直接执行
    PRAGMA table_info(TABLE)
    作为结构来源;若需查看表字段,必须调用
    get_schema.py

Execution and Summary

执行与总结

  • Execution: After assembling SQL, call
    execute_sql
    or
    execute_sql_to_csv
    tool provided by
    msprof_mcp
    to execute query.
  • Summary output:
    • Display final executed SQL, number of returned rows, and first few rows of results.
  • 执行:组装SQL后,调用
    msprof_mcp
    提供的
    execute_sql
    execute_sql_to_csv
    工具执行查询。
  • 总结输出
    • 显示最终执行的SQL、返回行数以及结果的前几行。

CTE Macro Definitions (Must Reuse in Track A)

CTE宏定义(Track A中必须复用)

[Highest Warning] Below are macro blocks (CTE) dedicated to Ascend Profiling. In Track A:
  • Must completely copy corresponding macro code block as
    WITH
    header of SQL.
  • Never modify JOIN, field meaning, or computation logic inside macros.
[最高警告] 以下是专用于Ascend性能分析的宏块(CTE)。在Track A中:
  • 必须完整复制对应的宏代码块作为SQL的
    WITH
    头部。
  • 不得修改宏内部的JOIN、字段含义或计算逻辑。

1. Operator Computation Detail Macro (Compute Macro)

1. 算子计算详情宏(Compute Macro)

Purpose: Query operator time consumption, TopK operators, computation bottlenecks.
sql
WITH compute_view AS (
    SELECT c.globalTaskId, ROUND(t.endNs - t.startNs) AS duration_ns,
           n.value AS op_name, type_str.value AS op_type
    FROM COMPUTE_TASK_INFO c
    LEFT JOIN TASK t ON t.globalTaskId = c.globalTaskId
    LEFT JOIN STRING_IDS n ON n.id = c.name
    LEFT JOIN STRING_IDS type_str ON type_str.id = c.opType
)
用途:查询算子耗时、TopK算子、计算瓶颈。
sql
WITH compute_view AS (
    SELECT c.globalTaskId, ROUND(t.endNs - t.startNs) AS duration_ns,
           n.value AS op_name, type_str.value AS op_type
    FROM COMPUTE_TASK_INFO c
    LEFT JOIN TASK t ON t.globalTaskId = c.globalTaskId
    LEFT JOIN STRING_IDS n ON n.id = c.name
    LEFT JOIN STRING_IDS type_str ON type_str.id = c.opType
)

2. Communication Detail Macro (Communication Macro)

2. 通信详情宏(Communication Macro)

Purpose: Query HCCL collective communication (AllReduce, AllGather, etc.) time.
sql
WITH comm_view AS (
    SELECT ROUND(c.endNs - c.startNs) AS duration_ns, n.value AS op_name,
           t.value AS op_type, g.value AS group_name
    FROM COMMUNICATION_OP c
    LEFT JOIN STRING_IDS n ON n.id = c.opName
    LEFT JOIN STRING_IDS t ON t.id = c.opType
    LEFT JOIN STRING_IDS g ON g.id = c.groupName
)
用途:查询HCCL集合通信(AllReduce、AllGather等)时间。
sql
WITH comm_view AS (
    SELECT ROUND(c.endNs - c.startNs) AS duration_ns, n.value AS op_name,
           t.value AS op_type, g.value AS group_name
    FROM COMMUNICATION_OP c
    LEFT JOIN STRING_IDS n ON n.id = c.opName
    LEFT JOIN STRING_IDS t ON t.id = c.opType
    LEFT JOIN STRING_IDS g ON g.id = c.groupName
)

3. Dispatch Mapping Macro (Dispatch Macro)

3. 调度映射宏(Dispatch Macro)

Purpose: Compare time differences between PyTorch framework dispatch, CANN layer dispatch, and underlying execution to locate scheduling congestion.
sql
WITH dispatch_view AS (
    SELECT
        ROUND(t.endNs - t.startNs) AS task_duration_ns,
        ROUND(c.endNs - c.startNs) AS cann_duration_ns,
        ROUND(p.endNs - p.startNs) AS pytorch_duration_ns,
        c_str.value AS cann_api_name,
        p_str.value AS pytorch_api_name,
        t_str.value AS task_type
    FROM TASK t
    LEFT JOIN CANN_API c ON t.connectionId = c.connectionId
    LEFT JOIN CONNECTION_IDS conn ON conn.connectionId = t.connectionId
    LEFT JOIN PYTORCH_API p ON p.connectionId = conn.id
    LEFT JOIN STRING_IDS c_str ON c.name = c_str.id
    LEFT JOIN STRING_IDS p_str ON p.name = p_str.id
    LEFT JOIN STRING_IDS t_str ON t.taskType = t_str.id
)
用途:对比PyTorch框架调度、CANN层调度与底层执行的时间差异,定位调度拥堵问题。
sql
WITH dispatch_view AS (
    SELECT
        ROUND(t.endNs - t.startNs) AS task_duration_ns,
        ROUND(c.endNs - c.startNs) AS cann_duration_ns,
        ROUND(p.endNs - p.startNs) AS pytorch_duration_ns,
        c_str.value AS cann_api_name,
        p_str.value AS pytorch_api_name,
        t_str.value AS task_type
    FROM TASK t
    LEFT JOIN CANN_API c ON t.connectionId = c.connectionId
    LEFT JOIN CONNECTION_IDS conn ON conn.connectionId = t.connectionId
    LEFT JOIN PYTORCH_API p ON p.connectionId = conn.id
    LEFT JOIN STRING_IDS c_str ON c.name = c_str.id
    LEFT JOIN STRING_IDS p_str ON p.name = p_str.id
    LEFT JOIN STRING_IDS t_str ON t.taskType = t_str.id
)

Enhanced Features

增强功能

Intelligent Bottleneck Diagnoser

智能瓶颈诊断器

This skill includes an AI-powered bottleneck diagnosis system that analyzes profiling data to identify root causes automatically:
Features:
  • Automatic Root Cause Analysis: Identifies performance bottlenecks from profiling data
  • Bottleneck Classification: Categorizes bottlenecks into memory-bound, compute-bound, communication-bound, or operator-fallback types
  • Actionable Recommendations: Provides prioritized optimization recommendations
  • Pattern Matching: Detects known performance anti-patterns and suggests fixes
  • Impact Assessment: Estimates potential performance improvement from each optimization
Bottleneck Classification:
CategoryCharacteristicsCausesStrategy
Memory-boundHigh memory bandwidthTransData opsReduce transfer
Compute-boundHigh AI_CORE utilLarge matmulOptimize ops
Comm-boundHCCL ops significantInefficient collOptimize comm
Operator-fallbackAI_CPU executionMissing NPU implAscendC ops
Bottleneck Diagnosis Output:
markdown
undefined
本技能包含一个AI驱动的瓶颈诊断系统,可分析性能数据自动识别根本原因:
特性:
  • 自动根本原因分析:从性能分析数据中识别性能瓶颈
  • 瓶颈分类:将瓶颈分为内存受限、计算受限、通信受限或算子回退类型
  • 可执行建议:提供优先级排序的优化建议
  • 模式匹配:检测已知的性能反模式并提出修复方案
  • 影响评估:估算每项优化可带来的潜在性能提升
瓶颈分类:
类别特征原因策略
内存受限内存带宽占用高TransData算子减少数据传输
计算受限AI_CORE利用率高大型矩阵运算优化算子
通信受限HCCL算子占比显著集合通信效率低优化通信逻辑
算子回退AI_CPU执行缺少NPU实现使用AscendC算子
瓶颈诊断输出:
markdown
undefined

Intelligent Bottleneck Diagnosis Report

智能瓶颈诊断报告

Overall Performance Summary

整体性能总结

  • Total Inference Time: 15.2 ms
  • Bottleneck Score: 78/100
  • Main Bottleneck Type: Memory-bound
  • 总推理时间: 15.2 ms
  • 瓶颈评分: 78/100
  • 主要瓶颈类型: 内存受限

Identified Bottlenecks

已识别瓶颈

RankOperatorTypeTimePercentageIssue
1TransDataAI_CPU4.2 ms27.6%Frequent CPU-NPU transfer
2IndexSelectAI_CPU2.8 ms18.4%Operator fallback to CPU
3NMSAI_CPU1.5 ms9.9%No NPU implementation
排名算子类型耗时占比问题
1TransDataAI_CPU4.2 ms27.6%频繁CPU-NPU数据传输
2IndexSelectAI_CPU2.8 ms18.4%算子回退至CPU执行
3NMSAI_CPU1.5 ms9.9%无NPU实现版本

Optimization Recommendations

优化建议

PriorityOperatorIssueSolutionExpected Gain
P0TransDataData transferReduce redundant movement20-25%
P1IndexSelectCPU fallbackImplement AscendC version15-20%
P2NMSCPU fallbackUse NPU-optimized NMS10-15%
优先级算子问题解决方案预期收益
P0TransData数据传输减少冗余数据移动20-25%
P1IndexSelectCPU回退实现AscendC版本15-20%
P2NMSCPU回退使用NPU优化版NMS10-15%

Quick Wins

快速优化方案

  1. Batch pre-processing on NPU instead of CPU
  2. Use async data transfer with overlap
  3. Enable memory pooling for intermediate tensors
undefined
  1. 在NPU上批量预处理而非CPU
  2. 使用异步数据传输并重叠执行
  3. 为中间张量启用内存池
undefined

Reference Documents

参考文档

DocumentDescription
Profiler DB Data FormatTable structure
Acceptance CriteriaAcceptance criteria
Verification MethodVerification approach
TroubleshootingCommon issues
文档描述
Profiler DB Data Format表结构说明
Acceptance Criteria验收标准
Verification Method验证方法
Troubleshooting常见问题排查

Prerequisites

前置条件

  • msprof >= 7.0.0 installed
  • sqlite3 >= 3.0.0 installed
  • Have Ascend PyTorch Profiler or msprof generated database file
  • 已安装msprof >= 7.0.0
  • 已安装sqlite3 >= 3.0.0
  • 拥有Ascend PyTorch Profiler或msprof生成的数据库文件

Core Commands

核心命令

bash
undefined
bash
undefined

Query operator time consumption

查询算子耗时

python3 scripts/query_profiler_db.py
--db /path/to/ascend_pytorch_profiler.db
--query "Top 10 operators by time consumption"
undefined
python3 scripts/query_profiler_db.py
--db /path/to/ascend_pytorch_profiler.db
--query "Top 10 operators by time consumption"
undefined

Parameter Confirmation

参数确认

ParameterDescriptionRequired
dbProfiler database pathYes
queryNatural language queryYes
outputOutput formatNo
参数描述是否必填
db性能分析数据库路径
query自然语言查询语句
output输出格式