Skip to content

[fx] Add use_reentrant=False to checkpoint in codegen#1463

Merged
FrankLeeeee merged 23 commits intohpcaitech:mainfrom
Cypher30:feature/add_ckpt_reentrant_False_to_codegen
Aug 17, 2022
Merged

[fx] Add use_reentrant=False to checkpoint in codegen#1463
FrankLeeeee merged 23 commits intohpcaitech:mainfrom
Cypher30:feature/add_ckpt_reentrant_False_to_codegen

Conversation

@Cypher30
Copy link
Copy Markdown
Contributor

The previous PR #1460 added use_reentrant=False feature in checkpoint, to address the problems we encountered in activation searching strategy in #1451. In this PR, I bring this feature to our ColoTracer codegen process. Once the activation_codegen detects that one checkpoint's input will be used in an in-place operation, it will use use_reentrant=False option when calling the colossalai.utils.activation_checkpoint.checkpoint, otherwise it will use use_reentrant=True which consists with the original checkpoint function.

@FrankLeeeee FrankLeeeee merged commit 092b9c8 into hpcaitech:main Aug 17, 2022
@super-dainiu
Copy link
Copy Markdown
Contributor

I suggest you should test on torchvision models instead of customized models.

@Cypher30
Copy link
Copy Markdown
Contributor Author

I suggest you should test on torchvision models instead of customized models.

I think we could add some compatibility test in the future, I think the customized model could be short and efficiently covers the situation we might encounter

@Cypher30 Cypher30 deleted the feature/add_ckpt_reentrant_False_to_codegen branch August 26, 2022 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants