Skip to content

Add an external option to toggle offload_to_cpu #3694

@scissorstail

Description

@scissorstail

https://github.com/huggingface/accelerate/blob/5565412840d1f4c215fe089aee733337f3d57d56/src/accelerate/accelerator.py#L3782C58-L3782C77

I was trying to fix an issue where training with FSDP on 2 GPUs hangs when saving the model at the end. While digging through the code, I accidentally discovered that setting offload_to_cpu to False makes everything work perfectly. Instead of modifying the library code directly, it would be great to have an option to configure this externally.

By the way, one really strange thing is that the training works fine the very first time after rebooting the computer, but from the second run onward, it always hangs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions