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

[RUST] Rust DSO module #2976

Merged
merged 9 commits into from May 28, 2019
Merged

[RUST] Rust DSO module #2976

merged 9 commits into from May 28, 2019

Conversation

nhynes
Copy link
Member

@nhynes nhynes commented Apr 6, 2019

This PR depends on #2969

cc @ehsanmok

cc @kazimuth in reference to your question about being able to load PackedFuncs directly from Rust.

Copy link
Contributor

@ehsanmok ehsanmok left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

rust/runtime/src/module/dylib.rs Outdated Show resolved Hide resolved
@jroesch
Copy link
Member

jroesch commented Apr 8, 2019

This adds support to just open compiled shared objects and load packed functions from them. Just curious, looks good overall.

rust/runtime/src/module/dylib.rs Outdated Show resolved Hide resolved
rust/runtime/src/module/dylib.rs Outdated Show resolved Hide resolved
$(
let fn_ptr = $lib.get::<*mut $sig>(concat!("__", stringify!($fn)).as_bytes());
if let Ok(fn_ptr) = fn_ptr {
**fn_ptr = $fn;
Copy link
Member

Choose a reason for hiding this comment

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

Check if you would like to handle these cases https://github.com/dmlc/tvm/blob/master/src/runtime/dso_module.cc#L71

  • The ctx_addr is used to handle callback when the library tries to callback to a PackedFunc that is local to the current module
  • The dev_mblob records other modules that this module imported through a binary blob

@tqchen tqchen added the status: need update need update based on feedbacks label Apr 9, 2019
@tqchen
Copy link
Member

tqchen commented Apr 18, 2019

ping @nhynes to see if you would like to address some of the comments :)

@nhynes
Copy link
Member Author

nhynes commented Apr 19, 2019

Yes, absolutely! It's literally on the top of my to-do list for this weekend :)

@tqchen
Copy link
Member

tqchen commented May 20, 2019

soft ping @nhynes

@nhynes nhynes force-pushed the rust-dso branch 3 times, most recently from a6b5201 to da7da73 Compare May 21, 2019 09:53
@nhynes
Copy link
Member Author

nhynes commented May 21, 2019

gee, it's sure been a long weekend hasn't it?

would like to handle [...] dev_mblob

Of the functions supported by DSOModule, dev_mblob seems to be the most complex. It might be worth saving that for a later time when there's more of a story around non-llvm targets in the static rust runtime. Do you think the basic functionality is okay for now?

@tqchen
Copy link
Member

tqchen commented May 21, 2019

Sure sounds good, please do fix the ci though :)

@tqchen
Copy link
Member

tqchen commented May 24, 2019

ping

@nhynes nhynes requested a review from tqchen May 26, 2019 17:01
@nhynes nhynes removed the status: need update need update based on feedbacks label May 26, 2019
@tqchen tqchen merged commit a479432 into apache:master May 28, 2019
@tqchen
Copy link
Member

tqchen commented May 28, 2019

Thanks, @nhynes @ehsanmok @kazimuth , this is now merged

@nhynes nhynes deleted the rust-dso branch May 28, 2019 22:57
wweic pushed a commit to wweic/tvm that referenced this pull request Jun 26, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Jun 27, 2019
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.

None yet

4 participants