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

Peft version upgrade from 0.4.0 to 0.14.0 results in "No module named \u0027peft.utils.config\u0027" error #2339

Open
2 of 4 tasks
incchar opened this issue Jan 21, 2025 · 1 comment

Comments

@incchar
Copy link

incchar commented Jan 21, 2025

System Info

Hello,

I'm migrating my sagemaker endpoint from the huggingface-pytorch-inference:2.1.0-transformers4.37.0-gpu-py310-cu118-ubuntu20.04 image (which is being deprecated) to the huggingface-pytorch-inference:2.3.0-transformers4.46.1-gpu-py311-cu121-ubuntu20.04-v1.0 image, which is supported.

This new version does not support the 0.4.0 version of peft, so we have upgraded to 1.14.0 and upgraded to a compatible diffusers version. The sagemaker endpoint deploys correctly with these new versions, but once it's run, we receive the following error:

No module named \u0027peft.utils.config\u0027

I dug around and found that there' no usage of peft.utils.config in our inference code. The only usage I could find is here, in the peft code itself: https://github.com/huggingface/peft/blob/main/src/peft/config.py. However, in this code, It looks like utils.config does not exist at all.

Here's what I'm currently using:
diffusers==0.32.2
peft==0.14.0

Is the peft library somehow breaking itself by looking for a peft.utils.config that doesn't exist? Have I missed a step that would create the utils.config file? Or is there another hidden dependency using peft.utils.config?

Who can help?

@BenjaminBossan @sayakpaul

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder
  • My own task or dataset (give details below)

Reproduction

Create a sagemaker endpoint using the new huggingface-pytorch-inference:2.3.0-transformers4.46.1-gpu-py311-cu121-ubuntu20.04-v1.0 huggingface DLC image.

Use a requirements.txt that looks like the following:
diffusers==0.32.2
peft==0.14.0

Observe that all requests to the sagemaker endpoint respond with 500 errors.

Expected behavior

The Sagemaker endpoint should continue to process requests as it did before the version upgrade (using peft 0.4.0)

@githubnemo
Copy link
Collaborator

githubnemo commented Jan 23, 2025

Hey, thanks for reporting the issue.

Indeed, peft.utils.config was renamed to peft.config in ed396a6.

I'm assuming that you are using SageMaker as an inference endpoint for a specific model. Could it be that the model itself is a pickle file that has a reference to peft.utils.config?

If that is the case, I suggest loading the model in an old environment, dumping the weights, loading the weights in the new environment and saving it.

It would be very helpful if you could report the full error message including tracebacks.

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

No branches or pull requests

2 participants