Cross-compile executor_runner for riscv64-linux-gnu and run it under
qemu-user-static against a small bundled program. The end-to-end check
mirrors the Arm Cortex-M e2e flow: a Test_result: PASS line in stdout from
the bundled-IO comparison path is the pass criterion.
This is the Phase 1 deliverable for the RISC-V Support RFC at pytorch/executorch#18991. The cross-compile and runner artifacts (toolchain file, preset, AOT script) are designed to carry over unchanged to a hardware-runner job once one becomes available; only the invocation step (qemu-user vs. native) would change.
examples/riscv/setup.sh # apt: gcc-riscv64-linux-gnu, qemu-user-static
examples/riscv/run.sh # export, cross-compile, run under qemu-userThe driver does three steps:
python examples/riscv/aot_riscv.pyexports atorch.addmodule toriscv_test/add_riscv.bpte(a BundledProgram with reference outputs embedded for two test cases).cmake --preset riscv64-linuxconfigures the cross-build usingexamples/riscv/riscv64-linux-gnu-toolchain.cmakeandtools/cmake/preset/riscv64_linux.cmake.executor_runneris built against portable kernels withET_BUNDLE_IO_ENABLEDdefined.qemu-riscv64-staticinvokes the runner with--model_pathpointing at the.bpte. The runner detects the bundle, runs every embedded test case, and emitsTest_result: PASS(orFAIL) per case.
.github/workflows/_test_riscv.yml is a reusable workflow_call
job (mirroring _test_cortex_m_e2e.yml) invoked from riscv64.yml. It runs on
the mt-l-x86iavx512-8-64 x86_64 runner using the
executorch-ubuntu-24.04-gcc14 docker image.