Repository navigation
Runner script for Detailed Profile data using control instrumentation on VE2 - #72
Merged
Merged
Conversation
…rumentation on VE2 Co-authored-by: Cursor <cursoragent@cursor.com>
jvillarre
self-requested a review
November 18, 2026 19:16
jvillarre
approved these changes
Nov 18, 2026
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.
Runner script for collecting Detailed Profile data using control instrumentation on VE2
VE2 Detailed Profile Report board runner
vaiprofile_detailed_report_ve2_board_runner.pyruns VAIML tests on a VE2 PetaLinux board and capturescontrol_instrumentation based detailed profiling data for each test, stored in the
vaiprofile_reportssub-directory of each test. To generate the Detailed Profile Report with Boundness Classification, copy the
vaiprofile_reportssub-directory of each test to a Linux x86 machine and analyze it withvaiprofile --generate-profile-report(see below).Usage
--test-path PATH--runner PATHve2.pyto use (default: the nearestve2.pyper test: the test folder, its parents up to--test-path, then, for a single test, its parent)--no-detailed-profiling--timeout SECONDS--skip-setuppip3 config/pip3 installsetup commands--dry-run-h,--help--help-allis not listed in--help. It shows the help with the full flow description and the hidden options(
--help-all,--archive,--extract-dir). Both--helpand--help-allprint to stdout.A test folder is one holding
onnx_model/orvitisai_config.json. It needsonnx_model/*.onnx,vitisai_config.jsonandoverlay/x_plus_ml.pdiplusoverlay/x_plus_ml.dtbo. Ifvaiml_config.custom_opsis set, it also needs
custom_ops_config.json.Flow
pip3setup commands, unless--skip-setupis given;LD_LIBRARY_PATH,XRT_AIARM, ...);flexmlrt,voeandonnxruntime-vitisaipackages. Missing packages are installed fromthe first
whl_files/folder found.fpgautil -Randfpgautil -b ./overlay/x_plus_ml.pdi -o ./overlay/x_plus_ml.dtbo.python ve2.py --input_model onnx_model/<model>.onnx --analyzer_profiling True.vitisai_config.jsonwithcontrol_instrumentationremoved fromvaiml_config.ai_analyzer_enhanced_profiling.vitisai_config.jsonis restored.vitisai_config.jsonis left as it is, and the original is kept asvitisai_config.json.with_control_instrumentation.(Run A). It runs only if detailed profiling is on.
aie_dtrace_ctx_*.ct,dtrace_dump_ctx_*.jsonorvai_profile*.zipfilesfrom earlier runs, they are saved in
backup_vaiprofile_<YYYYmmdd_HHMMSS>.zip. That way, data frombefore this script ran is kept separately from the data of Runs A to D.
vaiprofile-collect-datais run and itsvai_profile.zipbecomes thebackup.
vai_profile*.zipfiles are moved aside before that collect, so it cannot overwrite them.They are then added into the backup under their own names and removed from the test folder.
vai_profile*.zipfiles are still saved in the backup.--no-detailed-profilingis given and onlyif the Base Run passed:
vitisai_config.jsonwithcontrol_instrumentationadded and its ownprofiling_runtime_config.vaiprofile-collect-data.vitisai_config.jsonis restored afterwards.vaiprofile_reports/profiling_runtime_config.control_instrumentationdetailed_core_shim_read_ch_0interface_tile: detailed_ddr_read_bandwidth:0,aie_tile: compute_io_bounddetailed_shim_read_ch_1interface_tile: detailed_ddr_read_bandwidth:1detailed_shim_write_ch_0interface_tile: detailed_ddr_write_bandwidth:0detailed_shim_write_ch_1interface_tile: detailed_ddr_write_bandwidth:1If
control_instrumentationis not found invitisai_config.json,vitisai_config.json.with_control_instrumentationor
vitisai_config.json.orig, the script prints a warning that the design may not be compiled withcontrol_instrumentation. The profiling runs still go ahead.Output
<test-path>/setup.log<test-path>/vaiprofile_detailed_run_summary.csv<test>/fpgautil.log<test>/board_run.log<test>/backup_vaiprofile_<YYYYmmdd_HHMMSS>.zipvai_profile*.zipfiles, if any<test>/vaiprofile-collect-data_backup.logvaiprofile-collect-data, if it ran<test>/vaiprofile_reports/<run>/vitisai_config.json,board_run.log,vaiprofile-collect-data.log,vaiprofile_data.zipThe script exits non-zero if any Base Run or profiling run did not pass.
Examples
Generating Detailed Profile Report with Boundness Classification on Linux x86
Copy each test's
vaiprofile_reportsfolder to Linux x86. Then runvaiprofilewith the test case path, followedby all the
vaiprofile_data.zipfiles collected invaiprofile_reports:For example: