Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable RISC-V 64-bit Cross-Compiling Support for ONNX Runtime on Linux #19238

Merged
merged 4 commits into from
Jan 25, 2024

Conversation

phoebesv
Copy link
Contributor

@phoebesv phoebesv commented Jan 23, 2024

Description

This pull request introduces the necessary changes to enable RISC-V 64-bit cross-compiling support for the ONNX Runtime on Linux. The RISC-V architecture has gained popularity as an open standard instruction set architecture, and this contribution aims to extend ONNX Runtime's compatibility to include RISC-V, thereby broadening the reach of ONNX models to a wider range of devices.

Motivation and Context

RISC-V is a free and open-source instruction set architecture (ISA) based on established RISC principles. It is provided under open licenses without fees. Due to its extensibility and freedom in both software and hardware, RISC-V is poised for widespread adoption in the future, especially in applications related to AI, parallel computing, and data centers.

Example Build Command

./build.sh --parallel --config Debug --rv64 --riscv_toolchain_root=/path/to/toolchain/root --skip_tests

Documentation Updates

Relevant sections of the documentation will be updated to reflect the newly supported RISC-V 64-bit cross-compilation feature. #19239

snnn
snnn previously approved these changes Jan 23, 2024
@snnn
Copy link
Member

snnn commented Jan 23, 2024

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux OpenVINO CI Pipeline, Linux QNN CI Pipeline, MacOS CI Pipeline, Windows ARM64 QNN CI Pipeline

@snnn
Copy link
Member

snnn commented Jan 23, 2024

/azp run Windows CPU CI Pipeline, Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows x64 QNN CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed

Copy link

Azure Pipelines successfully started running 8 pipeline(s).

1 similar comment
Copy link

Azure Pipelines successfully started running 8 pipeline(s).

Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
Download the xnnpack dependency libraries to enable riscv64
cross-building on Linux with xnnpack EP.

Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
@phoebesv
Copy link
Contributor Author

@snnn I have updated the commits to fix the lint warning. Thanks!

@phoebesv phoebesv requested review from snnn and edgchen1 January 24, 2024 06:11
@snnn
Copy link
Member

snnn commented Jan 24, 2024

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux OpenVINO CI Pipeline, Linux QNN CI Pipeline, MacOS CI Pipeline, Windows ARM64 QNN CI Pipeline

@snnn
Copy link
Member

snnn commented Jan 24, 2024

/azp run Windows CPU CI Pipeline, Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows x64 QNN CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed

Copy link

Azure Pipelines successfully started running 8 pipeline(s).

1 similar comment
Copy link

Azure Pipelines successfully started running 8 pipeline(s).

@snnn snnn added the build build issues; typically submitted using template label Jan 24, 2024
@snnn snnn merged commit 4477f57 into microsoft:main Jan 25, 2024
56 checks passed
@csukuangfj
Copy link
Contributor

I am able to build onnxruntime for riscv64 with this PR. However, when I run it with my speech recognition model
using qemu-riscv64, it gives me wrong results.

Has the correctness of the compiled libs been verified/tested?

tianleiwu pushed a commit that referenced this pull request Apr 5, 2024
Update the document for PR: Enable Cross-Compiling Support for ONNX
Runtime on Linux for RISC-V 64-bit.
#19238

Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants