Skip to content

Commit

Permalink
Update README.md (#119)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md
  • Loading branch information
willtebbutt authored Apr 12, 2024
1 parent f5e2b90 commit 992a862
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ Fortunately, dealing with these performance limitations necessitates simplifying

# Trying it out

There is not presently a high-level interface to which we are committing, but if you want to compute the gradient of a function, take a look at `value_and_pullback!!` / `value_and_gradient!!`.
They both provide a high-level interface which will let you differentiate things, and their implementation demonstrates how an `rrule!!` / rrule-like function should be used.
(There are a couple of things that you have to get right when using `rrule!!` / functions returned from `build_rrule`, so it's best to use `value_and_pullback!!`).
There is not presently a high-level interface to which we are committing.
If you want to compute the gradient of a function, we recommend in the first instance using [DifferentiationInterface.jl](https://github.com/gdalle/DifferentiationInterface.jl/), and taking a looking at how things are implemented there to get an idea of how to work with `Tapir.jl`.
In particular, look at its use of `value_and_pullback!!` / `value_and_gradient!!`, and `build_rrule`.
(Observe that there are a couple of things that you have to get right when using `Tapir.jl`'s interfaces and working with mutating functions, so care is required. Proper documentation will be made available upon the creation of a proper release of this package).

*Note:* I have found that using a mixture of `PProf` and the `@profview` functionality from Julia's `VSCode` extension essential when profiling code generated by `Tapir.jl`.
`PProf` provides complete type information on its flame graphs, which is important for figuring out what is getting called, but it doesn't highilght type-instabilities.
Expand Down

0 comments on commit 992a862

Please sign in to comment.