Skip to content

Arm Backend: Add Silero VAD Ethos-U example and recurrent-state lowering - #22172

Open
usamahz wants to merge 4 commits into
pytorch:mainfrom
usamahz:codex/mletorch-2112-silero-vad-ethos-u
Open

Arm Backend: Add Silero VAD Ethos-U example and recurrent-state lowering#22172
usamahz wants to merge 4 commits into
pytorch:mainfrom
usamahz:codex/mletorch-2112-silero-vad-ethos-u

Conversation

@usamahz

@usamahz usamahz commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Silero VAD is a compact streaming model that demonstrates a realistic recurrent-state workload on Ethos-U85 rather than another stateless classification example.

This PR adds an in-tree Silero VAD Ethos-U example covering model preparation, PT2E quantization, Arm lowering, bare-metal execution on Corstone-320, and host-side output validation. It also adds the reusable Arm backend support needed to lower the LSTMCell gate/update pattern while preserving model-owned mutable hidden and cell state between audio frames.

The runtime accepts one 576-sample audio input per frame, keeps recurrent state inside the model, prints speech probabilities and detected segments over serial, and validates the FVP results against export-time reference probabilities.

Tracking: MLETORCH-2112

This PR was developed with OpenAI Codex assistance.

Test plan

  • python -m pytest -q backends/arm/test/passes/test_mutable_buffers.py backends/arm/test/misc/test_silero_vad_example.py — 14 passed.
  • backends/arm/test/test_arm_ootb.sh run_silero_vad_e2e_ethos_u — exports the PTE, builds the runtime, runs Corstone-320 / Ethos-U85-256 FVP, and compares 79 output frames.
  • FVP validation: maximum absolute error 0.156800, mean absolute error 0.018459, and zero threshold-decision mismatches at 0.55.
  • Repository pre-push lint, license, commit-message, and Arm documentation checks passed.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

Add an in-tree Silero VAD example for Corstone-320 and Ethos-U85. The
flow loads the Silero weights into the eager model, calibrates PT2E
quantization with real audio, lowers supported operators, and exports a
PTE with reference probabilities.

Add a bare-metal runtime that streams WAV frames and carries recurrent
state between calls. It prints probabilities and speech segments over
serial, and stops the FVP with end-of-transmission. Add deterministic
OOTB coverage using separate calibration and validation clips.

The implementation was developed with OpenAI Codex assistance.

Signed-off-by: Usamah Zaheer <usamah.zaheer@arm.com>
AI-Assisted-By: OpenAI Codex
Change-Id: I4974461b9b86d508a019c52a0234f66f9822313a
Decompose LSTMCell for batched and unbatched inputs, including
negative tuple indices, so the recurrent gate and state-update pattern
can be lowered through the Arm INT pipeline.

Preserve mutable-buffer names and storage identity around each Arm
transform. Use the mutable-aware constant folder from the
repository-pinned torchao revision so mutable state reads are not
frozen.

Store Silero hidden and cell state as model-owned int8 buffers with
calibration-derived quantization parameters. This avoids a torchao pin
update or backend storage rewrite while keeping the recurrent update
delegated. Only small boundary conversions and the mutable-buffer write
remain portable.

Improve mutable-buffer mutation tagging and reset Silero calibration
state at audio-stream boundaries. Add focused regression coverage for
identical buffers, reordered mutations, quantized state, and LSTMCell
lowering.

The implementation was developed with OpenAI Codex assistance.

Signed-off-by: Usamah Zaheer <usamah.zaheer@arm.com>
AI-Assisted-By: OpenAI Codex
Change-Id: I66b7f6719324fbeea6983dc83940ba5ba8e01123
@pytorch-bot

pytorch-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22172

Note: Links to docs will display an error until the docs builds have been completed.

⏳ 1 Pending, 2 Unrelated Failures

As of commit c490ecc with merge base 300987a (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 26, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Aug 26, 2026
@usamahz
usamahz marked this pull request as draft August 26, 2026 10:46
@usamahz usamahz closed this Aug 26, 2026
@usamahz
usamahz deleted the codex/mletorch-2112-silero-vad-ethos-u branch August 26, 2026 10:47
@usamahz
usamahz restored the codex/mletorch-2112-silero-vad-ethos-u branch August 26, 2026 12:19
@usamahz usamahz reopened this Aug 26, 2026
@usamahz
usamahz marked this pull request as ready for review August 26, 2026 12:19
@usamahz usamahz self-assigned this Aug 26, 2026
@usamahz usamahz added the release notes: arm Changes to the ARM backend delegate label Aug 26, 2026
@usamahz
usamahz requested a review from zingo August 26, 2026 12:25
@usamahz usamahz changed the title Add Silero VAD Ethos-U example and recurrent-state lowering Arm Backend: Add Silero VAD Ethos-U example and recurrent-state lowering Aug 26, 2026

@zingo zingo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge (if Arm tests passes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants