Skip to content

Add RISC-V smoke test on QEMU#19399

Open
luhenry wants to merge 3 commits intopytorch:mainfrom
riseproject-dev:riscv-testing
Open

Add RISC-V smoke test on QEMU#19399
luhenry wants to merge 3 commits intopytorch:mainfrom
riseproject-dev:riscv-testing

Conversation

@luhenry
Copy link
Copy Markdown

@luhenry luhenry commented May 8, 2026

Summary

Implements Phase 1 of the RISC-V Support RFC: cross-compile executor_runner for riscv64-linux-gnu, run a small BundledProgram under qemu-user-static on a x86_64 runner, and assert the standard "Test_result: PASS" marker that the portable executor_runner already emits via the bundled-IO comparison path (examples/portable/executor_runner/executor_runner.cpp:646 1).

The riscv64-linux preset mirrors arm-ethosu-linux. The only deviation is glibc instead of musl to avoid the MUSL_TOOLCHAIN_ROOT tarball setup.

The reusable _test_riscv.yml workflow is is triggered via pull.yml on every pull request.

Test plan

Ran locally, and integration to CI for automated testing.

cc @GregoryComer @digantdesai @cbilgin @psiddh @AdrianLundell @rascani @mergennachin

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 8, 2026

🔗 Helpful Links

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

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

❌ 17 Awaiting Approval, 1 New Failure

As of commit 3f9eaa1 with merge base 9889c7c (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

NEW FAILURE - The following job has failed:

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 May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@luhenry luhenry changed the title Add RISC-V Phase 1 smoke test on QEMU Add RISC-V smoke test on QEMU May 8, 2026
Comment thread .github/workflows/_test_riscv.yml Outdated
run:
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
runner: ubuntu-latest
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I missed that, it should be a linux.Yxlarge. I'll update it

luhenry added 2 commits May 9, 2026 01:18
Implements Phase 1 of the RISC-V Support RFC (pytorch#18991):
cross-compile executor_runner for riscv64-linux-gnu, run a small
BundledProgram under qemu-user-static on a stock x86_64 GitHub runner,
and assert the standard "Test_result: PASS" marker that the portable
executor_runner already emits via the bundled-IO comparison path
(examples/portable/executor_runner/executor_runner.cpp:646).

The riscv64-linux preset mirrors arm-ethosu-linux: same Linux
cross-compile shape, same standard executor_runner, same filesystem
.pte, same option set with EXECUTORCH_ENABLE_BUNDLE_IO added so the
runner self-checks. Single deviation is glibc-via-apt instead of musl
to avoid the MUSL_TOOLCHAIN_ROOT tarball setup. The reusable
_test_riscv.yml workflow is wired into pull.yml on every PR.
The error we would get on CI is:
```
/usr/bin/riscv64-linux-gnu-gcc --sysroot=/usr/riscv64-linux-gnu    -o CMakeFiles/cmTC_eb936.dir/testCCompiler.c.o -c /pytorch/executorch/cmake-out/CMakeFiles/CMakeScratch/TryCompile-o3upsB/testCCompiler.c
Linking C executable cmTC_eb936
/opt/conda/envs/py_3.10/lib/python3.10/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_eb936.dir/link.txt --verbose=1
/usr/lib/gcc-cross/riscv64-linux-gnu/11/../../../../riscv64-linux-gnu/bin/ld: cannot find /usr/riscv64-linux-gnu/lib/libc.so.6 inside /usr/riscv64-linux-gnu
/usr/lib/gcc-cross/riscv64-linux-gnu/11/../../../../riscv64-linux-gnu/bin/ld: cannot find /usr/riscv64-linux-gnu/lib/libc_nonshared.a inside /usr/riscv64-linux-gnu
/usr/lib/gcc-cross/riscv64-linux-gnu/11/../../../../riscv64-linux-gnu/bin/ld: cannot find /usr/riscv64-linux-gnu/lib/ld-linux-riscv64-lp64d.so.1 inside /usr/riscv64-linux-gnu
collect2: error: ld returned 1 exit status
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants