Add optimized YOLOv10n ONNX reference port (721s to ~8s on ET-SoC1) - #224
Open
ruimouradev wants to merge 11 commits into
Open
Add optimized YOLOv10n ONNX reference port (721s to ~8s on ET-SoC1)#224ruimouradev wants to merge 11 commits into
ruimouradev wants to merge 11 commits into
Conversation
…ial barrier backoff, board time 69s to 34s
The SiLU was compute bound on that polynomial, so the packed exponential is the win. Board kernel wait drops from 17.31s to 16.55s.
The convolution is compute bound and the build does not auto vectorize, so the packed multiply-add is the win. Kernel wait drops from 16.55s to 15.81s.
Board kernel wait drops from 15.81s to 12.91s.
…he depthwise 3x3 conv
AFOliveira
approved these changes
Jul 26, 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.
Summary
Adds a pinned-ONNX YOLOv10n reference port for ET-SoC1 and optimizes it from the
initial working port at 721.396s down to ~7.96s on the board, about 90x,
keeping full FP32 numerical correctness. Model identity is pinned in
artifacts.json(onnx-community/yolov10n, fixed revision and sha256).Approach
All of the optimization is in
src/ref_runtime.c. The graph is memory bound onET-SoC1, so the wins come from spreading work across all 16 harts and from the
vector unit, never from lowering precision.
writing a disjoint cache-line-aligned slice. L1 is minion-local and not
coherent, so two harts never share a line.
spatial positions at a time with packed FMA, two output channels sharing each
activation load.
hardware packed exponential and reciprocal, so the intermediate is never
materialized.
Transpose, Split, Reshape and ReduceMax each ran on a single hart. All of them
now split across 16 with the same cache-line-aligned publish discipline.
Each step was validated on the board before being kept. Loop-order cache-blocking
of the convs and running them on the tensor engine both regressed on this
memory-bound graph and were dropped.
Results
Board runs on ET-SoC1 (aifoundry2), metric
Kernel wait seconds.run_sysemu_model_ports.shpasstools/compare_full.pyreports FULL_COMPARE PASS on every run above, 16checkpoints at
atol=5e-5 rtol=1e-4, against a host oracle built from the pinnedONNX model. FP32 throughout, and the host build is clean under
-Wall -Wextra -Werror.Benchmark registration
Registered as
models.yolov10n_hf_referenceso board CI selects and scores it,with the deterministic input and weight blobs under
assets/asfile_loads.src/leaderboard_full.cis the single translation unit the leaderboard buildwants, compiling the same units and flags the scripts use separately. I built that
ELF on the board with its own toolchain and ran it there as a check:
pass,8.22834s, FULL_COMPARE PASS, same output bytes.
The entry declares
src/as the port's source root sohost_full_runner.candhost_range_runner.cdo not trip the coverage check. They are the x86 host oraclethis port validates against, so they cannot be in a board ELF, and the config has
no way to mark a source as host-side. Glad to move them out of
src/instead ifyou prefer.
Notes
Outside the port directory this touches only the
benchmark_config.jsonentry, a.gitignoreexception for the committed benchmark blobs (same pattern asyoloand
dncnn), and the model line in the top-level README list.data/*.jsonandthe generated leaderboard block are left for CI. No submodule changes.