pytorch / pytorch/executorch

[discussion] Upstreaming an HPMicro bare-metal RISC-V MCU backend

Open
#19,666 10 comments 2 reactions 1 assignee View on GitHub

@rascani is already working on this.

Since May 22, 2026.

module: microcontrollers rfc
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🚀 The feature, motivation and pitch

Hi ExecuTorch maintainers,

We're working on ExecuTorch support for HPMicro RISC-V MCUs and would like to
discuss the right upstream path before preparing PRs.

HPMicro is an MCU vendor shipping RISC-V microcontrollers such as the HPM5xxx
and HPM6xxx series. Some devices, including HPM6750-class parts, include packed
SIMD instructions through the RISC-V P extension. The public SDK is available
at github.com/hpmicro/hpm_sdk.

We currently have ExecuTorch running in the HPM SDK on HPMicro evaluation
boards. The platform startup code, linker scripts, device drivers, memory
configuration, and PAL implementation remain part of the HPM SDK runtime
environment.

The upstream-facing scope we would like to discuss is:

  1. An ExecuTorch integration path for building/linking ExecuTorch from the
    HPM SDK environment (we're inclined to mirror the existing
    zephyr/CMakeLists.txt integration shape unless a different pattern is
    preferred).
  2. RISC-V P-extension optimized int8 kernels for HPMicro-class MCUs.
  3. Any backend/delegate structure, registration, tests, and documentation that
    ExecuTorch maintainers would expect for such acceleration support.

Proposed upstream path

One possible split is:

  1. Start with an RFC or skeleton that defines the expected upstream structure
    for HPMicro/RISC-V P-extension acceleration support.
  2. Add the minimal build/link integration needed for ExecuTorch to be consumed
    from the HPM SDK environment.
  3. Add RISC-V P-extension optimized int8 kernels incrementally, with tests.
  4. Agree on the validation requirements before expanding operator coverage.

Please let us know if a different split would fit the project better.

Scope

The intended ExecuTorch-side scope is:

  • HPMicro/RISC-V P-extension acceleration support for int8 inference.
  • Optimized kernels for common operator categories such as arithmetic,
    activation, comparison, matrix multiplication, and potentially
    convolution-related paths where appropriate.
  • Build/link integration following the upstream ExecuTorch structure.
  • Tests and documentation expected by maintainers for this type of support.

Validation

We would like to understand the minimum validation expected for an initial
proposal. Target execution for HPMicro devices would run in the HPM SDK
environment, since that is where the board startup, linker scripts, drivers,
memory setup, and PAL live.

For upstream review, would maintainers expect host-buildable kernel/backend
tests first, target execution evidence from the HPM SDK environment, simulator
coverage, a self-hosted runner, or another validation path?

Questions

  1. Is HPMicro/RISC-V P-extension acceleration support a direction the project
    would consider upstreaming?
  2. What upstream structure would maintainers prefer for this work?
  3. Should we start with an RFC/skeleton before sending implementation PRs?
  4. Which parts, if any, should live in ExecuTorch versus remain in the HPM SDK?
  5. What is the minimum validation bar for the initial proposal?

Thanks for your time.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @psiddh @AdrianLundell @digantdesai @rascani

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.