Skip to content

Best practices jit and vmap #5199

Answered by avital
GJBoth asked this question in Q&A
Dec 15, 2020 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

Generally, you can always jit the top-most level (but it's fine to jit inner functions -- that doesn't impact the end result.)

vmap changes the function signature so put it where it makes sense -- if you want to have a forward pass function that works on batches but defined on single elements, then you should vmap that function.

But I agree we should have a simple page with best practices for jit, vmap, etc. I'll file an issue for that.

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@shoyer
Comment options

Comment options

You must be logged in to vote
2 replies
@inoryy
Comment options

@8bitmp3
Comment options

Comment options

You must be logged in to vote
3 replies
@matpalm
Comment options

@yiyixuxu
Comment options

@ddrous
Comment options

Answer selected by shoyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants
Converted from issue

This discussion was converted from issue #5199 on December 15, 2020 22:41.