Skip to content

Why wrapping only blocks with grad checkpoint in ViT #1303

Answered by rwightman
DaniNem asked this question in Q&A
Discussion options

You must be logged in to vote

@DaniNem only recent version of pytorch (I think 1.11+) allowed safely checkpointing the first block (once use_reentrant flag was added, and can be set to False), however, the additional gains are minimal so I opted to keep it simple and just checkpiont the blocks for all models where it made sense to do so

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DaniNem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants