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

FIX: Avoid needless copy from modules_to_save #2220

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Nov 18, 2024

  1. FIX Avoid needless copy from modules_to_save

    Resolves huggingface#2206
    
    NOT READY TO MERGE YET.
    
    Tentative solution to that issue.
    
    The problem is that we keep a "global" modules_to_save on the model
    which contains all possible modules_to_save for each adapter. When the
    first adapter targets layer "foo" with modules_to_save and the second
    adapter targets "bar", then "foo" will create a copy of the original
    module for the second adapter, even though it's not needed.
    
    This does not change the result but is unnecessary and takes up memory.
    Thus it should be avoided.
    
    TODO: Tests.
    BenjaminBossan committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    c024681 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2024

  1. Add unit test

    BenjaminBossan committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    6d4a96a View commit details
    Browse the repository at this point in the history