Repository navigation
Report Vela op placement in imx8mp-npu-pose - #36
Merged
Merged
Conversation
Nothing in the build says which ops stay on the CPU. quantize-model.py only catches a degenerate quantization, so a model that converts cleanly but falls back to the CPU shows up as low FPS on the board. On a target that uses Vela, its per-op report is thrown away because nothing runs it. Add check-op-placement.sh and call it from app-compile.sh after quantization. Where Vela is in the SDK it compiles the INT8 model for the Ethos-U65, prints the CPU vs NPU operator counts and the CPU ops, and fails when the CPU share is over MAX_CPU_PCT. Without Vela it prints a skip line, so the 8M Plus build is unchanged. The default limit is 15%. Vela 5.2.0 puts 29 of this model's 221 ops (13.1%) on the CPU, all of them decode and quantize-boundary ops, so the limit guards against regressions above that baseline rather than setting a target. MAX_CPU_PCT must be a number, because awk compares a non-number as a string and "5%" would pass any model. No target enables the check yet. A target turns it on by adding nativesdk-ethos-u-vela through a target-<name>: override. Signed-off-by: Javier Tia <javier@peridio.com>
Avocado References — Build Check
Totals: 1 ✅ passed · 0 ❌ failed Per-reference logs: workflow run |
nicksinas
approved these changes
Oct 2, 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.
Problem
Nothing in the build says which ops stay on the CPU.
quantize-model.pyonly catches a degenerate quantization, so a model that converts cleanly
but falls back to the CPU shows up as low FPS on the board. On a target
that uses Vela, its per-op report is thrown away because nothing runs it.
Solution
check-op-placement.shruns fromapp-compile.shafter quantization.Where Vela is in the SDK it compiles the INT8 model for the Ethos-U65,
prints the CPU vs NPU operator counts and the CPU ops, and fails when the
CPU share is over
MAX_CPU_PCT(default 15). Without Vela it prints a skipline, so the 8M Plus build is unchanged.
Key changes
check-op-placement.sh, called fromapp-compile.sh.avocado.yamlchange. A target turns the check on by addingnativesdk-ethos-u-velathrough atarget-<name>:override.Reviewer notes
Vela 5.2.0 (PyPI, not the NXP fork) on this model's real INT8 output puts 29
of 221 ops (13.1%) on the CPU, all decode and quantize-boundary ops, so 15% is
a regression guard, not a target. Tested against that Vela: pass, over-limit
fail, no-Vela skip, unparseable-output fail, and a non-numeric limit fail;
shellcheck clean. A local
avocado build --target ucm-imx8m-plusruns the hook(skip line) and builds the
appextension, then stops atstone validate(
imx-bootnot found). The same failure happens on untouchedmainon mymachine (CLI 1.0.0-rc.4), so CI's build check is the real gate here.
Feedback wanted: whether an operator-count share is the right signal, or
whether you would rather gate on estimated cycles.