You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fd88e61
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/doc/unstable-book/src/compiler-flags/autodiff.md
+34-13Lines changed: 34 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,37 @@ The tracking issue for this feature is: [#124509](https://github.com/rust-lang/r
6
6
7
7
This feature allows you to differentiate functions using automatic differentiation.
8
8
Set the `-Zautodiff=<options>` compiler flag to adjust the behaviour of the autodiff feature.
9
-
Multiple options can be separated with a comma. Valid options are:
10
-
11
-
`Enable` - Required flag to enable autodiff
12
-
`PrintTA` - print Type Analysis Information
13
-
`PrintTAFn` - print Type Analysis Information for a specific function
14
-
`PrintAA` - print Activity Analysis Information
15
-
`PrintPerf` - print Performance Warnings from Enzyme
16
-
`PrintSteps` - prints all intermediate transformations
17
-
`PrintModBefore` - print the whole module, before running opts
18
-
`PrintModAfter` - print the module after Enzyme differentiated everything
19
-
`LooseTypes` - Enzyme's loose type debug helper (can cause incorrect gradients)
20
-
`Inline` - runs Enzyme specific Inlining
21
-
`RuntimeActivity` - allow specifying activity at runtime
9
+
Multiple options can be separated with a comma.
10
+
11
+
## Syntax
12
+
```bash
13
+
rustc -Z autodiff=Enable[,options]
14
+
```
15
+
16
+
Where `options` can be:
17
+
18
+
-`Enable` - Required flag to enable autodiff
19
+
-`PrintTA` - print Type Analysis Information
20
+
-`PrintTAFn=<fn_name>` - print Type Analysis Information for a specific function (consider combining it with `no_mangle`)
21
+
-`PrintAA` - print Activity Analysis Information
22
+
-`PrintPerf` - print Performance Warnings from Enzyme
23
+
-`PrintSteps` - prints all intermediate transformations
24
+
-`PrintModBefore` - print the whole module, before running opts
25
+
-`PrintModAfter` - print the module after Enzyme differentiated everything
26
+
-`LooseTypes` - Enzyme's loose type debug helper (can cause incorrect gradients)
27
+
-`Inline` - runs Enzyme specific Inlining
28
+
-`RuntimeActivity` - allow specifying activity at runtime
29
+
30
+
31
+
## Examples
32
+
33
+
```bash
34
+
# Enable autodiff via cargo, assuming `enzyme` being a toolchain that supports autodiff
35
+
"RUSTFLAGS=-Zautodiff=Enable" cargo +enzyme build
36
+
37
+
# Enable autodiff directly via rustc
38
+
rustc -Z autodiff=Enable
39
+
40
+
# Print TypeAnalysis updates for the function `foo`, as well as Activity Analysis for all differentiated code.
0 commit comments