-
Notifications
You must be signed in to change notification settings - Fork 266
Adding Estimate NPU Latency pass and unit test #2178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree company="AMD" |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| optuna | ||
| pandas | ||
| peft | ||
| perf-estimator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no package called perf-estimator on pypi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we are working to push the package into pypi. Will update once that is done.
Describe your changes
Overview
Added the EstimateNPULatency pass under
olive/onnx/vitis_ai/estimate_latency.pyEstimateNPULatency makes use of the NPU Perf Estimator tool to predict computational performance of workloads given a set of parameters.
This is an analysis pass and does not transform the graph at all. Used for performance analysis only.
Installation
To install (if not installed through requirements.txt), run the following:
pip install [placeholder for wheel]Confirm python version installed is >= 3.10 for compatibility.
If perf estimator package is not installed, the following warning will show and the pass will simply be bypassed:

Usage
Inputs
EstimateNPULatency takes in both the model in the form of an
OnnxModelHandlerobject and a list of optional parameters in the form of a dict ofPassConfigParams(consistent with all other passes).Optional Parameters
To pass in optional parameters, list parameter name and parameter value as key-value pairs in the json file. See example:
strstx["stx"]Adding Pass to Config File
Should ideally be run as the last pass and listed last in the
<model>.jsonfile. For example:Output
Generates a
concise_summarydirectory within the run directory with the following files:{model_name}_concise_summary.txtwill display the following info on roofline latency, total compute ops, and what conclusion can be drawn on performance bottleneck (whether it is DDR Bandwidth bound or Compute bound):{model_name}_concise_summary.csvwill display the same info but specific to per op. Ops are listed in descending order of latency:Known Passing Tests
Resnet w/ Perf Estimator
Refer to Olive Recipes Repo
MobileNet w/ Perf Estimator
Refer to Olive Recipes Repo
Unit Test
python -m pytest test/unit_test/passes/vitis_ai/test_estimate_latency.pyChecklist before requesting a review
lintrunner -a(Optional) Issue link