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. ❌ 1 New Failure, 1 Cancelled Job, 1 Unrelated Failure, 14 Unclassified FailuresAs of commit 4b616c0 with merge base 4469d84 ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following job 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. |
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.
|
|
I updated
This table explicitely doesn't contain the following combinations:
|
|
compiling |
Unfortunately not, but I'm looking into it. |
Looks they're not available externally, so the best bet is probably to build it locally. I can also give it a shot if you're not able to. |
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