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 usage of deprecated parameters/functions in X-LoRA #2010

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

EricLBuehler
Copy link
Member

@EricLBuehler EricLBuehler commented Aug 16, 2024

As pointed out by @benjamin-marie in #2002, we were calling prepare_model_for_int8_training and passing use_flash_attention_2. These are deprecated and this PR fixes any usages.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@BenjaminBossan
Copy link
Member

@EricLBuehler Is this ready for review? Please always ping me when that's the case.

@EricLBuehler
Copy link
Member Author

Sounds good @BenjaminBossan, yes this is ready for review!

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for fixing these small issues. Just a question: Why use _attn_implementation and not attn_implementation? I did a test and the latter seems to work.

@EricLBuehler
Copy link
Member Author

Thanks for the recommendation, there was no reason, actually. I guess I've been using the wrong parameter then.

@@ -170,8 +170,8 @@ class XLoraModel(BaseTuner):

Example:
```py
>>> from transformers import AutoModelForCausalLM, AutoConfig
>>> from peft import LoraConfig, PeftModel, get_peft_model, prepare_model_for_int8_training
Copy link
Member

Choose a reason for hiding this comment

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

Sorry I didn't notice earlier: prepare_model_for_int8_training is deprecated, but prepare_model_for_kbit_training replaces it and can be used here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah ok thanks! I updated it to call prepare_model_for_kbit_training.

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes.

@BenjaminBossan BenjaminBossan merged commit f71e89f into huggingface:main Aug 20, 2024
14 checks passed
@EricLBuehler EricLBuehler deleted the xlora_fix_deprecated branch August 20, 2024 09:45
@EricLBuehler
Copy link
Member Author

Thanks!

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.

3 participants