Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mixed precision hook as part of the unwrap_model #860

Merged
merged 4 commits into from
Nov 16, 2022
Merged

Conversation

muellerzr
Copy link
Collaborator

Closes #858

Adds a new remove_fp32_hook param to extract_model_from_parallel and unwrap_model that will check to see if the forward pass is an instance of ConvertOutputsToFp32 and if so then sets the forward pass back to the original forward pass

@muellerzr muellerzr added the enhancement New feature or request label Nov 16, 2022
@muellerzr muellerzr requested a review from sgugger November 16, 2022 20:23
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

src/accelerate/accelerator.py Outdated Show resolved Hide resolved
muellerzr and others added 2 commits November 16, 2022 16:04
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@muellerzr muellerzr merged commit 0efabe4 into main Nov 16, 2022
@muellerzr muellerzr deleted the remove-fp32 branch November 16, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove accelerate.prepare hooks and FP32 conversion
3 participants