Skip to content

[RUST][FRONTEND] Add rust frontend v0.1 - #2292

Merged
nhynes merged 20 commits into
apache:masterfrom
ehsanmok:rust_frontend
Feb 3, 2019
Merged

[RUST][FRONTEND] Add rust frontend v0.1#2292
nhynes merged 20 commits into
apache:masterfrom
ehsanmok:rust_frontend

Conversation

@ehsanmok

@ehsanmok ehsanmok commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

Overview

I'm delighted to submit this PR which adds Rust runtime frontend support as part of RFC 1601.

You can see the dev here. Here's a summary

  1. Add tvm_frontend bindings and idiomatic Rust API.
  2. Create a common crate refactoring TVMArgValue and TVMRetValue and unifying FFI across runtime and frontend.
  3. Various cleaning up and adding more documentations.

@nhynes @tqchen @jroesch

resolves #2306

@ehsanmok ehsanmok mentioned this pull request Dec 14, 2018
@nhynes
nhynes self-requested a review December 14, 2018 18:04
Comment thread rust/Cargo.toml Outdated
Comment thread rust/frontend/.gitignore
Comment thread rust/frontend/.rustfmt.toml
Comment thread rust/frontend/.travis.yml Outdated
Comment thread rust/frontend/Cargo.toml Outdated
Comment thread rust/frontend/src/value.rs Outdated
Comment thread rust/frontend/tvm-sys/Cargo.toml Outdated
Comment thread rust/frontend/tvm-sys/src/bindgen.rs Outdated
Comment thread rust/frontend/tvm-sys/build.rs Outdated
Comment thread rust/runtime/.gitignore

@nhynes nhynes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice work so far! a few more comments for your perusal :)

I'm looking forward to having this merged!

Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/function.rs
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/internal_api.rs Outdated
Comment thread rust/frontend/src/module.rs Outdated
Comment thread rust/frontend/src/module.rs Outdated
Comment thread rust/frontend/src/module.rs Outdated
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/Cargo.toml Outdated
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/function.rs Outdated
@ehsanmok

ehsanmok commented Dec 17, 2018

Copy link
Copy Markdown
Contributor Author

@nhynes @tqchen how come CI tvm-sys build is successful (tvm_runtime is found in ld path) as first dependency though tvm_frontend cannot find tvm_runtime?

@nhynes

nhynes commented Dec 18, 2018

Copy link
Copy Markdown
Member

tvm_frontend cannot find tvm_runtime

In what context is this bug occurring? The most likely cause is that LD_LIBRARY_PATH simply becomes unset.

Comment thread rust/frontend/tvm-sys/LICENSE Outdated
@ehsanmok

ehsanmok commented Dec 18, 2018

Copy link
Copy Markdown
Contributor Author

@nhynes Please checkout task_rust.sh.

@nhynes

nhynes commented Dec 18, 2018

Copy link
Copy Markdown
Member

What happens if you also export LD_LIBRARY_PATH a la https://github.com/dmlc/tvm/blob/master/tests/scripts/task_java_unittest.sh#L3

@ehsanmok

ehsanmok commented Dec 18, 2018

Copy link
Copy Markdown
Contributor Author

@nhynes Already exported in tests/scripts/task_rust.sh and I didn't change that.

@jroesch

jroesch commented Dec 18, 2018

Copy link
Copy Markdown
Member

I will take a pass over this later today.

@ehsanmok

Copy link
Copy Markdown
Contributor Author

@nhynes pinging for the updated PR!

@nhynes

nhynes commented Jan 23, 2019

Copy link
Copy Markdown
Member

re-reviewing now!

@nhynes nhynes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice! this is the last round of changes :)

Comment thread rust/common/Cargo.toml Outdated
Comment thread rust/common/src/lib.rs Outdated
Comment thread rust/common/tvm-sys/Cargo.toml Outdated
Comment thread rust/frontend/Cargo.toml Outdated
Comment thread rust/frontend/Cargo.toml Outdated
Comment thread rust/frontend/src/context.rs Outdated
Comment thread rust/frontend/src/function.rs Outdated
Comment thread rust/frontend/src/ty.rs
Comment thread rust/frontend/src/ty.rs Outdated
Comment thread rust/runtime/src/errors.rs Outdated
Comment thread rust/frontend/README.md

@nhynes nhynes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I pulled the branch and made some changes w.r.t. returning references instead of sprinkling in to_owneds

Comment thread rust/frontend/src/module.rs Outdated
@nhynes

nhynes commented Jan 28, 2019

Copy link
Copy Markdown
Member

We're going to need to work on error messages

thread 'main' panicked at '', tvm_rust/rust/frontend/src/function.rs:262:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

isn't a very helpful output of checked_call! :(

@ZihengJiang

Copy link
Copy Markdown
Contributor

@nhynes The jenkins image has been updated. Please submit an empty commit to retrigger the CI

@tqchen

tqchen commented Feb 2, 2019

Copy link
Copy Markdown
Member

Sorry, I have to revert the image due to a short outrage to recover ANTLR, will send in update

@nhynes
nhynes merged commit e2970b2 into apache:master Feb 3, 2019
libing4752 pushed a commit to libing4752/tvm that referenced this pull request Feb 18, 2019
merrymercy pushed a commit to merrymercy/tvm that referenced this pull request Feb 18, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
@yzhliu yzhliu mentioned this pull request Mar 2, 2019
28 tasks
@ehsanmok
ehsanmok deleted the rust_frontend branch April 27, 2022 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RUST] RFC and 0.5 Release Plans

6 participants