-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RUST] Rust DSO module #2976
Conversation
There was a problem hiding this 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!
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
$( | ||
let fn_ptr = $lib.get::<*mut $sig>(concat!("__", stringify!($fn)).as_bytes()); | ||
if let Ok(fn_ptr) = fn_ptr { | ||
**fn_ptr = $fn; |
There was a problem hiding this comment.
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
ping @nhynes to see if you would like to address some of the comments :) |
Yes, absolutely! It's literally on the top of my to-do list for this weekend :) |
soft ping @nhynes |
a6b5201
to
da7da73
Compare
gee, it's sure been a long weekend hasn't it?
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? |
Sure sounds good, please do fix the ci though :) |
ping |
This PR depends on #2969
cc @ehsanmok
cc @kazimuth in reference to your question about being able to load PackedFuncs directly from Rust.