Add baremetal RISC-V smoke tests (rv32, rv64)#19917
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19917
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
Cross-compiles with riscv64-unknown-elf + picolibc, embeds the .bpte into
the ELF, and runs under qemu-system-riscv{32,64} -machine virt with
semihosting carrying stdout and exit status. Same bundled-IO PASS criterion
as the existing linux runs.
7cc42fe to
00d0173
Compare
|
@claude Review this PR. |
|
Claude finished @rascani's task in 2m 51s —— View job Review: Add baremetal RISC-V smoke tests (rv32, rv64)
Overall this is a well-structured PR that cleanly extends the existing RISC-V linux testing to baremetal (rv32 + rv64) using QEMU system mode with semihosting. The architecture mirrors Bugs1. Stale preset path in The default set(EXECUTORCH_BUILD_PRESET_FILE
"${EXECUTORCH_ROOT}/tools/cmake/preset/riscv64_baremetal.cmake" # ← doesn't existThis won't break CI (because 2. Stale path filter in - tools/cmake/preset/riscv64_*.cmakeThe preset files were renamed to 3. Stale reference to echo "[run.sh] ERROR: ${qemu} not found on PATH; install with examples/riscv/setup.sh" >&2
Minor Issues4. README The table shows only 5. README link to see [setup.sh](setup.sh)This is a broken link since the file was renamed. Design Observations (non-blocking)
SummaryThree bugs that should be fixed before merge (stale file references after the |
|
Thanks for putting this together @luhenry! |
sentencepiece fails to compile on GCC 15 due to missing #include <cstdint>
|
@luhenry Thanks for putting this together. From the MCU / bare-metal angle we discussed in #19666, this looks like the right RV32/RV64 portable-kernel CI baseline to me. One question: |
Yes, Portable Kernels is the baseline. A following contribution could be to add a rv64gc scalar and a rv64gc+RVV backend so that we can have that as a baseline for future RISC-V contributions.
|
Summary
This adds testing on CI and with local script of the portable backend on baremetal for RISC-V. It cross-compiles with riscv64-unknown-elf + picolibc, embeds the .bpte into the ELF, and runs under
qemu-system-riscv{32,64}with semihosting. We use the same bundled-IO PASS criterion as the existing linux runs for pass/fail.Test plan
The CI is the testing plan as we add configurations to CI. I've validated it works locally with
examples/riscv/test-matrix.sh.cc @psiddh @AdrianLundell @digantdesai @rascani