-
Notifications
You must be signed in to change notification settings - Fork 13.7k
libload / dlopen Enzyme/autodiff #146623
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
base: master
Are you sure you want to change the base?
libload / dlopen Enzyme/autodiff #146623
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -665,6 +665,22 @@ pub(crate) unsafe fn llvm_optimize( | |||
|
|||
let llvm_plugins = config.llvm_plugins.join(","); | |||
|
|||
fn call_dynamic() -> Result<*const c_void, Box<dyn std::error::Error>> { | |||
unsafe { | |||
let lib = libloading::Library::new("/home/manuel/prog/rust/build/x86_64-unknown-linux-gnu/enzyme/lib/libEnzyme-21.so")?; |
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.
You could do something like
rust/compiler/rustc_interface/src/util.rs
Lines 371 to 381 in 8a1b399
let target = host_tuple(); | |
let sysroot = sysroot | |
.all_paths() | |
.map(|sysroot| { | |
filesearch::make_target_lib_path(sysroot, target).with_file_name("codegen-backends") | |
}) | |
.find(|f| { | |
info!("codegen backend candidate: {}", f.display()); | |
f.exists() | |
}) |
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
Sounds exciting! With this, will we still have to compile LLVM in some "special" way, so that it has support for Enzyme? Or is having the |
That's not an issue anymore, I had removed all extra handling multiple months ago, in my previous push to get it on nightly. The only thing left would now be to add Enzyme as a downloadable rustup component. Would you be able to help with that and take over once I cleaned up and landed this PR @Kobzol? I don't know much about distributions and would like to avoid to have this laying around too many extra months. |
Yeah, if having |
A draft @davidlattimore and I developed at RustChina Unconf.
Closes #143295
r? @bjorn3 Does that generally look like what you had in mind?
I'll update the compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs to also go through libloading, and load the right path rather than hardcoding it. So far it passes some tests, I assume the other ones only fail due to enzyme_ffi not being updated yet.