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
> This package is under active development at the moment and may change its API and supported end systems at any time. End-users are advised to wait until a corresponding release with broader availability is made. Package developers are suggested to try out Reactant for integration, but should be advised of the same risks.
[](https://github.com/SciML/ColPrac)
Reactant takes Julia function and compile it into MLIR and run fancy optimizations on top of it, including using EnzymeMLIR for automatic differentiation, and create relevant executables for CPU/GPU/TPU via XLA. It presently operates as a tracing system. Compiled functions will assume the same control flow pattern as was originally taken by objects used at compile time, and control flow (e.g. if, for) as well as any type instabilities will be removed. The benefits of this approach is immediately making all such code available for advanced optimization with little developer effort. This system and corresponding semantics is subject to change to a (potentially partial) source rewriter in the future.
12
22
@@ -16,7 +26,7 @@ Reactant provides two new array types at its core, a ConcreteRArray and a Traced
You can also create a ConcreteRArray-version of an arbitrary data type by tracing through the structure, like below. This method will automatically handle recursive data structures or shared objects.
@@ -30,13 +40,13 @@ end
30
40
pair =Pair(ones(3), ones(10))
31
41
32
42
reactant_pair = Reactant.to_rarray(pair)
33
-
```
43
+
```
34
44
35
45
To compile programs using ConcreteRArray's, one uses the compile function, like as follows:
Copy file name to clipboardExpand all lines: docs/src/introduction/FAQs.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ When you encounter OOM (Out of Memory) errors, you can try to clear the cache by
19
19
Julia's builtin `GC.gc()` between memory-intensive operations.
20
20
21
21
!!! note
22
+
22
23
This will only free memory which is not currently live. If the result of compiled
23
24
function was stored in a vector, it will still be alive and `GC.gc()` won't free it.
24
25
@@ -85,7 +86,7 @@ After using Julia's built-in `GC.gc()`:
85
86
## Benchmark results feel suspiciously fast
86
87
87
88
If you see benchmark results that are suspiciously fast, it's likely because the benchmark
88
-
was executed with compiled functions where `sync=false` was used (the default). In this case, the compiled
89
+
was executed with compiled functions where `sync=false` was used (the default). In this case, the compiled
89
90
functionwill be executed asynchronously, and the benchmark results will be the time it takes
90
91
for the functionto schedule the computation on the device. Compile functions with `sync=true` to get the actual runtime. You can also use the `Reactant.synchronize` on the result of the computation to block until the computation is complete.
91
92
@@ -106,13 +107,13 @@ y = Reactant.to_rarray(rand(Float32, 1000))
0 commit comments