Parsing

  • During data profiling, the flushed files are locked. Parsing can be started only after the profiling is complete; otherwise, the error message "db is lock" will be displayed.
  • Do not enable dynamic profiling again before data parsing is complete, as this may deteriorate profiling performance.

Basic Parsing

Example of the parsing command:

python3 -m ms_service_profiler.parse --input-path ${PATH}/prof_dir/
Table 1 Options

Option

Description

Required (Yes/No)

--input-path

Path to profile data. All databases named msproftx.db, ascend_service_profiler_*.db, and ms_service_*.db in the path will be read.

Yes

--output-path

Output path for parsed files. It defaults to the output directory in the current path.

No

--log-level

Log level. The options are as follows:

  • debug: debug level. Logs of this level record debugging information, which helps R&D or maintenance personnel locate faults.
  • info: normal level (default). Logs of this level record information about proper tool running.
  • warning: warning level. Logs of this level record information when the tool does not run in an expected state, but the running of the process is not affected.
  • error: minor error level.
  • fatal: fatal error level.
  • critical: critical error level.

No

--format

Format of the exported profile data file. The options are as follows:

  • csv: Export only result files in .csv format. This format is used when the amount of flushed raw data is too large (> 10 GB). Exporting result files in this format can reduce the data parsing time. The files contain the request scheduling time, model execution duration, and KV cache memory usage of each round.
  • json: Export only result files in .json format. This format is used when only trace data is used for analysis. Exporting result files in this format can reduce the data parsing time. The files contain the timeline of the entire inference process of the serving framework.
  • db: Export only result files in .db format. This format is used when only MindStudio Insight is used to analyze result data. The files contain the full data parsing result and can be directly displayed in MindStudio Insight.

If this parameter is not specified, all result files are exported by default. You can specify one or more formats. For example, --format db or --format db csv.

NOTE:

If acl_task_time is set to 2 during data profiling, the parsing result files can be exported only in .json or .db format.

No

In addition to basic parsing, you can perform multi-dimensional parsing on profile data from different dimensions (request-level, batch-level, or service-level). You can also perform fine-grained performance breakdown on data of different batches.