Skip to content

Commit 293ab97

Browse files
committed
adding CI and updating README
1 parent 2de98a2 commit 293ab97

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed

README.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,68 @@
1-
# The Rust Programming Language
1+
# The Rust Programming Language + AutoDiff
22

33
[![Rust Community](https://img.shields.io/badge/Rust_Community%20-Join_us-brightgreen?style=plastic&logo=rust)](https://www.rust-lang.org/community)
44

55
This is the main source code repository for [Rust]. It contains the compiler,
6-
standard library, and documentation.
6+
standard library, and documentation. It is modified to use Enzyme for AutoDiff.
7+
8+
9+
Please configure this fork using the following command:
10+
11+
```
12+
mkdir build
13+
cd build
14+
../configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --release-channel=nightly --enable-llvm-assertions --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs
15+
```
16+
17+
Afterwards you can build rustc using:
18+
```
19+
../x.py build --stage 1 library/std library/proc_macro library/test tools/rustdoc
20+
```
21+
22+
Afterwards rustc toolchain link will allow you to use it through cargo:
23+
```
24+
rustup toolchain link enzyme `pwd`/build/`rustup target list --installed`/stage1
25+
rustup toolchain install nightly # enables -Z unstable-options
26+
```
27+
28+
You can then look at examples in the `library/autodiff/examples/*` folder and run them with
29+
30+
```bash
31+
# rosenbrock forward iteration
32+
cargo +enzyme run --example rosenbrock_fwd_iter --release
33+
34+
# or all of them
35+
cargo +enzyme test --examples
36+
```
37+
38+
## Enzyme Config
39+
To help with debugging, Enzyme can be configured using environment variables.
40+
```bash
41+
export ENZYME_PRINT_TA=1
42+
export ENZYME_PRINT_AA=1
43+
export ENZYME_PRINT=1
44+
export ENZYME_PRINT_MOD=1
45+
export ENZYME_PRINT_MOD_AFTER=1
46+
```
47+
The first three will print TypeAnalysis, ActivityAnalysis and the llvm-ir on a function basis, respectively.
48+
The last two variables will print the whole module directly before and after Enzyme differented the functions.
49+
50+
When experimenting with flags please make sure that EnzymeStrictAliasing=0
51+
is not changed, since it is required for Enzyme to handle enums correctly.
52+
53+
## Bug reporting
54+
Bugs are pretty much expected at this point of the development process.
55+
In order to help us please minimize the Rust code as far as possible.
56+
This tool might be a nicer helper: https://github.com/Nilstrieb/cargo-minimize
57+
If you have some knowledge of LLVM-IR we also greatly appreciate it if you could help
58+
us by compiling your minimized Rust code to LLVM-IR and reducing it further.
59+
60+
The only exception to this strategy is error based on "Can not deduce type of X",
61+
where reducing your example will make it harder for us to understand the origin of the bug.
62+
In this case please just try to inline all dependencies into a single crate or even file,
63+
without deleting used code.
64+
65+
766

867
[Rust]: https://www.rust-lang.org/
968

0 commit comments

Comments
 (0)