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

Support qlora in CPU #9233

Merged
merged 3 commits into from
Oct 27, 2023
Merged

Support qlora in CPU #9233

merged 3 commits into from
Oct 27, 2023

Conversation

yangw1234
Copy link
Contributor

Description

Support qlora in CPU

@yangw1234
Copy link
Contributor Author

yangw1234 commented Oct 20, 2023

@hzjane @Uxito-Ada please refer this PR

Comment on lines 52 to 54
model = prepare_model_for_kbit_training(model, use_gradient_checkpointing=False)

model.enable_input_require_grads()
Copy link
Contributor Author

@yangw1234 yangw1234 Oct 20, 2023

Choose a reason for hiding this comment

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

Somehow both setting use_gradient_checkpoint=False and calling model.enable_input_require_grads() are necessary. I still have not figure out why.

@@ -71,8 +73,8 @@
max_steps=200,
learning_rate=2e-4,
save_steps=100,
fp16=True,
logging_steps=20,
bf16=True,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

must use "bf16" in for cpu

@yangw1234 yangw1234 changed the title [WIP] Support qlora in CPU Support qlora in CPU Oct 27, 2023
Copy link
Contributor

@jason-dai jason-dai left a comment

Choose a reason for hiding this comment

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

LGTM

@yangw1234
Copy link
Contributor Author

ARC test is unstable. Merge it for now.

@yangw1234 yangw1234 merged commit b0f71f1 into intel-analytics:main Oct 27, 2023
16 of 17 checks passed
liu-shaojun pushed a commit that referenced this pull request Mar 25, 2024
* support qlora in CPU

* revert example

* fix style
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.

2 participants