-
Notifications
You must be signed in to change notification settings - Fork 108
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
adding rust ADBench version #1797
base: main
Are you sure you want to change the base?
Conversation
Usage instruction:
Enzyme/enzyme/Enzyme/GradientUtils.cpp Line 9136 in 880fb32
|
printing the module before AD (with a few helping infos at the end) |
@@ -127,6 +127,19 @@ extern "C" { | |||
double* reproj_err, | |||
double* w_err | |||
); | |||
|
|||
void rust2_ba_objective( |
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.
weak symbol variant of this.
-> running these doesn't require rust.
%-opt.ll: %-raw.ll | ||
opt $^ -o $@ -S | ||
#opt $^ -O2 -o $@ -S | ||
$(dir)/benchmarks/ReverseMode/ba/target/release/libbars.a: src/lib.rs Cargo.toml |
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.
if this can be optional?
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.
What would you like this variable to use when determining if Rust is enabled? We could run cargo +enzyme version
(checking whether a toolchain named enzyme
is configured) and/or we could have an environment variable to be set (by CMake or otherwise).
This makes the reverse mode correct, and a bit faster than the old version (with allocations inside the AD'd code).
This reverts commit 629f87c.
Usage for Rust side
export ENZYME_LOOSE_TYPES=1
cargo +enzyme run --release
Comipling a lib.so to use from C:
cargo +enzyme rustc --release --lib --crate-type=cdylib