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

Save differentiable model head on CPU #444

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

tomaarsen
Copy link
Member

Supersedes #327

Hello!

Pull Request overiew

  • Save differentiable model head on CPU
  • Move differentiable model heads to the right device after loading

Details

See #327 for more information:

If we train a differentiable head on a CUDA machine, the head checkpoint cannot be loaded via Joblib on CPU machine (Serialization error).
To address this issue, I modified the code to store the head checkpoint with CPU mapping.
When we load the head checkpoint, we map it to the target device.

Thanks @karter-liner for providing the PR. I've simply applied roughly their changes on top of the upcoming v1.0.0-pre branch.

  • Tom Aarsen

And move models to the right head after loading

Co-authored-by: karter-liner <88304414+karter-liner@users.noreply.github.com>
@HuggingFaceDocBuilderDev

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

@tomaarsen tomaarsen merged commit 4123609 into huggingface:v1.0.0-pre Nov 24, 2023
18 checks passed
@tomaarsen tomaarsen deleted the feat/cpu_load_diff_head branch November 24, 2023 12:55
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.

None yet

2 participants