当前位置: 首页 > web >正文

大模型-高通平台性能测试示例-2

一、qnn-profile-viewer 获取性能数据

在QNN中,可以使用qnn-net-run (genis-t2t-run)和qnn-profile-viewer这两个工具来进行推理的性能分析。支持在QNX操作系统或Android操作系统上进行性能分析。QNN目前支持四种性能分析类型,分别是:

  • Basic Profiling(基本性能分析):提供基本的性能数据,如运行时间、资源消耗等。

  • Detailed Profiling(详细性能分析):提供更详细的性能数据,可能包括各个操作的执行时间、资源使用情况等。

  • Lint Profiling(代码检查性能分析):是指在性能分析的同时进行代码质量检查,以发现潜在的问题。

  • opTrace Profiling(操作跟踪性能分析):是指跟踪和分析神经网络中各个操作的性能,以优化网络结构或参数。

1. 获取调试的profiling 的基础数据。

qnn-net-run \
--backend libQnnHttp.so \
--retrieve_context xx.serialized.bin \
--input_list ./***
--output_dir ./profiling \
--profiling_level basic --perf_profile burst

2. 使用qnn-profile-viewer 解析基础数据

qnn-profile-viewer \
--reader libQnnHttpProfilingReader.so \
--input_log ./profiling/**** \
--output ./profiling/diaglog.csv > ./profiling/diaglog_out.txt

  二、op算子级别的性能数据分析

1. 在离线模型生成时添加optrace选项

# generate <graph_name>_schematic.bin
qnn-context-binary-generator --model ./xx.so --backend libQnnHttp.so \
--binary_file xxx --profiling_option=optrace --profiling_level=detailed

2. qnn-net-run 工具运行QNN推理,并进行性能分析,获取数据。

qnn-net-run \
--backend libQnnHttp.so \
--retrieve_context xx.serialized.bin \
--input_list ./****
--output_dir ./optrace_profiling --perf_profile burst \
--profiling_option=optrace --profiling_level=detailed

3. 进行数据的分析解析

qnn-profile-viewer \
--reader libQnnHttpOptraceProfilingReader.so \
--schematic <graph_name>_schematic.bin \
--input_log ./*****
--output ./optrace_profiling/optrace.json

三、 Genis 性能测试

./genie-t2t-run -c ./internvlm.json -e input_concat_embs_dongzuoshibie.bin -t embedding_weights_92553x2048.raw --profile intervl_profile_data.json

四、高通sysprofiler app使用

高通在SA8295P HQX基线上提供的sysprofiler_app工具,该工具用于分析和查询系统的关键性能信息,包括CPU、GPU、DDR、ADSP、CDSP、NET、MEM、Thermal等类型的性能数据。sysprofiler_app是一个命令行工具,用于收集和分析系统的性能数据,通过这个工具,可以对系统的性能和负载有一个准确的度量,了解各个工况下各元器件的负载情况,以针对各个场景进行针对性的优化和处理。除了sysprofiler_app这个命令行程序,高通还提供了sysprofiler.h头文件和libsysprofiler.so共享库。这些支持库可以帮助开发者编写代码开发系统性能监控软件,实现实时监控系统性能指标。高通提供了Overview文档,详细介绍了SYSProfiler的使用方法和原理。可以通过阅读这些文档来了解如何使用这些工具和库进行性能分析和监控。

4.1 安装步骤

Qnx 系统的使用说明文档路径:D:\Android_platform\qcom_app\sysprofiler_app_v2.4.0\sysprofiler_app_v2.4.0\howto\QNX-LoadBinaries.txt

测试步骤:
1: 连接台架的qnx系统2: mount -uw /mnt3:  push so库和测试bin
push sysprofiler_app_v2.4.0/bin/QNXSDP710GEN4/libsysprofiler.so  /mnt/lib64
push sysprofiler_app_v2.4.0/bin/QNXSDP710GEN4/libsysprofiler.so.1 
push sysprofiler_app_v2.4.0/bin/QNXSDP710GEN4/libQProfilerInterface.so /mnt/lib64
push sysprofiler_app_v2.4.0/bin/QNXSDP710GEN4/sysprofiler_app /mnt/data4. 添加执行权限
cd /data/sysprofiler_app 5. 想要测试 ADSP profiling on Makena Gen4. 
mount -uw /mnt
cp /ifs/etc/images/dsp/libsysmon* /mnt/etc/images/dsp/5. ./sysprofiler_app --cpu --gpu -> this starts cpu and gpu profiling.
6. ./sysprofiler_app --help -> this provides the available options.

4.2 查看指令

增加--json 可以生成json 文件,在perfetto 解析使用

# ./sysprofiler_app --help
Options provided in sysprofiler :
--cpu -> for CPU Load Profiling.
--cpu-ddr-bw -> for enabling CPU <-> DDR BW profiling //不支持
--gpu -> for GPU Utilization and GPU frequency
--adsp -> for ADSP load and frequency.
--cdsp -> for CDSP load and frequency.
--cdsp1 -> for CDSP1 load and frequency.
--gpdsp0 -> for GPDSP0 load and frequency.
--gpdsp1 -> for GPDSP1 load and frequency.
--io -> for IO subsystem profiling.
--ddr -> for DDR subsystem profiling.
--noc-bw -> for NOC level bandwidth profiling.
--mem -> for MEM profiling
--proc -> for PROC profiling
--thermal -> for THERMAL profiling
--procmem -> for PerProcess Memory Profiling  //不支持
--gpu-proc -> for PerProcess GPU Profiling
--net -> For NET Profiling
--trace -> For enabling tracelogger
--thread -> For THREAD Profiling
--cpu-pmu -> For CPU PMU Profiling
--pmu-events -> Comma separated list of events for CPU PMU Profiling.
--gpu-freq -> in Mhz. This option adjusts the GPU Utilization accordingly.
--live -> for printing the live outputs
--json -> for converting the output to JSON
--csv -> for converting the output to CSV
--file <filename> -> for generating the logs with the particular name
--dir <dirname> -> Absolute path to the custom directory where results to be stored
--qtimer -> for enabling qtimer if supported on the device
--sample-time <time in ms> -> in milliseconds to set the sampling interval.
--total-time <time in s> -> in seconds to set the total profiling time
--pid-list -> list of comma separated pids for per process metrics
--cpu-sample-time <time in ms> -> adjusts the CPU sampling time
--gpu-sample-time <time in ms> -> adjusts the GPU sampling time
--adsp-sample-time <time in ms> -> adjusts the ADSP sampling time
--cdsp-sample-time <time in ms> -> adjusts the CDSP sampling time
--cdsp1-sample-time <time in ms> -> adjusts the CDSP1 sampling time
--ddr-sample-time <time in ms> -> adjusts the DDR sampling time
--mem-sample-time <time in ms> -> adjusts the MEM sampling time
--thermal-sample-time <time in ms> -> adjusts the THERMAL sampling time
--proc-sample-time <time in ms> -> adjusts the PROC sampling time
--io-sample-time <time in ms> -> adjusts the DISKIO sampling time
--procmem-sample-time <time in ms> -> adjust the PROCMEM sampling time
--net-sample-time -> adjusts the NET sampling time
--trace-sample-time -> adjusts the TRACE sampling time in ms
--thread-sample-time -> adjusts the THREAD sampling time
--cpu-pmu-sample-time -> adjusts the CPU PMU sampling time in ms
--cpu-ddr-bw-sample-time -> adjusts the CPU<->DDR BW sampling time in ms
--log <level> -> Prints logs (0:No logs, 1:Err, 2:Warn, 3:Info)
--version -> prints the version of the sysprofiler
--help -> Prints this help menu

http://www.xdnf.cn/news/9570.html

相关文章:

  • Error Swap_arc198c分析与解答
  • docker容器间服务访问的问题
  • 最终章:终焉之塔 · 前端之道
  • WinServer2016安装Docker
  • ResizeObserver 解决 echarts渲染不出来,内容宽度为 0的问题
  • 无法发布到PowerBI?试试拆分它
  • 回头看,FPGA+RK3576方案的功耗性能优势
  • 设计模式-单例模式
  • 理解 C++ 多态:概念、实现方式与实战示例
  • 密钥管理系统在存储加密场景中的深度实践:以TDE透明加密守护文件服务器安全
  • VC++和python从哪一年开始支持split(字符串)非单个字符
  • 【深度学习-pytorch篇】1. Pytorch矩阵操作与DataSet创建
  • LiveGBS国标视频平台收流模式:UDP、TCP被动与TCP主动传输模式之差异剖析
  • 【系统架构设计师】2025年上半年真题论文回忆版: 论多模型数据库及应用(包括解题思路和参考素材)
  • python--=的用法
  • 小白的进阶之路系列之四----人工智能从初步到精通pytorch自定义数据集下
  • 【每天一个知识点】LangChain
  • 针对Python开发的工具推荐及分析,涵盖集成开发环境(IDE)、轻量级工具、在线开发平台、代码管理工具等)
  • 智能手表怎么申请欧盟EN 18031认证
  • 主流 AI IDE 之一的 Windsurf 介绍
  • MySQL 数据迁移Postgresql(openGuass) 之 pg_chameleon
  • BGP实验报告
  • SQLiteStudio - 免费开源、轻量高效,跨平台的 SQLite 数据库管理工具,代替 Navicat for SQLite
  • 【已解决】windows gitbash 出现CondaError: Run ‘conda init‘ before ‘conda activate‘
  • 深入探讨集合与数组转换方法
  • 如何实现电竞比赛的实时直播?
  • 如何收集Oracle DB SQL Monitor报告
  • JavaScript性能优化实战大纲
  • win10 pip安装插件包报错:No matching distribution found for pytest-xlsx
  • nohup命令基本用法