Skip to content

Fix rust compile issues and add GH action to run build validations and tests#18346

Merged
snnn merged 3 commits into
microsoft:mainfrom
devigned:fix-rust-compile-issues
Nov 9, 2023
Merged

Fix rust compile issues and add GH action to run build validations and tests#18346
snnn merged 3 commits into
microsoft:mainfrom
devigned:fix-rust-compile-issues

Conversation

@devigned

@devigned devigned commented Nov 8, 2023

Copy link
Copy Markdown
Member

Description

This PR gets the onnxruntime Rust bindings to a foundation where they can be extended and validated as the onnxruntime progresses. Specifically, the PR does the following.

  • fixes some of the existing compilation issues due to missing some enums output tensor data types.
  • introduces a just vendor task that will vendor the source code from the onnxruntime to enable a common base directory within the crate directory rather than using a relative parent path. This enables crate package to be able to archive the onnxruntime native code, which will enable consumers of the onnxruntime-sys crate to be able to compile on their target.
  • introduces a GH action to lint the Rust code (rustfmt, clippy), build the library, validate through tests, and validate crate can package correctly.

TODOs:

Motivation and Context

This is the first step to getting new onnxruntime Rust crates published through this project, which will unblock community Rust projects which would like to take a dependency on onnxruntime Rust.

Follow up work to enable publication of onnxruntime Rust crates:

  • change name of the crates to be published (onnxruntime-rs and onnxruntime-sys are already taken and we'll need new names)
  • update authors / license to reflect contributions from previous maintainer(s) and new maintainers
  • introduce a crate publish GH action or ADO pipeline

@devigned
devigned requested a review from a team as a code owner November 8, 2023 13:34
@devigned
devigned requested a review from a team November 8, 2023 13:34
@devigned

devigned commented Nov 8, 2023

Copy link
Copy Markdown
Member Author

This PR is closely related to #18305

@devigned
devigned force-pushed the fix-rust-compile-issues branch from e5f211f to 8afce7b Compare November 8, 2023 15:03
@devigned
devigned force-pushed the fix-rust-compile-issues branch from 8afce7b to d8455da Compare November 8, 2023 22:29
@snnn

snnn commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

/azp run 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

@snnn

snnn commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

/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, Windows CPU CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 7 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 9 pipeline(s).

@snnn
snnn merged commit 2c22b49 into microsoft:main Nov 9, 2023
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
…d tests (microsoft#18346)

### Description
This PR gets the onnxruntime Rust bindings to a foundation where they
can be extended and validated as the onnxruntime progresses.
Specifically, the PR does the following.
- fixes some of the existing compilation issues due to missing some
enums output tensor data types.
- introduces a `just vendor` task that will vendor the source code from
the onnxruntime to enable a common base directory within the crate
directory rather than using a relative parent path. This enables `crate
package` to be able to archive the onnxruntime native code, which will
enable consumers of the onnxruntime-sys crate to be able to compile on
their target.
- introduces a GH action to lint the Rust code (rustfmt, clippy), build
the library, validate through tests, and validate crate can package
correctly.


TODOs:
- [x] This PR is based on microsoft#18200 and will need to be rebased once that
PR is merged.



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

This is the first step to getting new onnxruntime Rust crates published
through this project, which will unblock community Rust projects which
would like to take a dependency on onnxruntime Rust.

Follow up work to enable publication of onnxruntime Rust crates:
- change name of the crates to be published (onnxruntime-rs and
onnxruntime-sys are already taken and we'll need new names)
- update authors / license to reflect contributions from previous
maintainer(s) and new maintainers
- introduce a crate publish GH action or ADO pipeline

---------

Signed-off-by: David Justice <david@devigned.com>
@chiichen chiichen mentioned this pull request Jul 28, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants