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 inference with WOQ and LoRA adapter #1434

Open
Yuan0320 opened this issue Mar 28, 2024 · 3 comments
Open

Support inference with WOQ and LoRA adapter #1434

Yuan0320 opened this issue Mar 28, 2024 · 3 comments
Assignees

Comments

@Yuan0320
Copy link

Hi itrex team, thanks for the great work!

I've been experimenting with the Weight Only Quantization (WOQ) from ITREX, following the provided examples in weightonlyquant.md#example-for-cpu-device. The results are promising.

Now I'm interested in extending this by incorporating a trained LoRA adapter for inference. I'd like to combine pretrained weights (WOQ) with LoRA adapter (FP32/16) for inference. I'm wondering if it's feasible to achieve this, or if it's on the roadmap for future updates? Any insights or assistance would be greatly appreciated. Thanks!

@XinyuYe-Intel
Copy link
Collaborator

Hi @Yuan0320 , thanks for using ITREX.

Regarding combine pretrained weights (WOQ) with LoRA adapter (FP32/16) for inference, do you mean to add LoRA adapter (FP32/16) on top of the WOQ model, or just merge the LoRA adapter's weight to the WOQ model, could you please clarify it?

If you meant for the latter case, you can just load the LoRA adapter and merge it to the model before WOQ, and do WOQ after LoRA adapter has been merged into the model, in this way, the model's structure won't change, only its weights are updated.

@Yuan0320
Copy link
Author

Hi @XinyuYe-Intel, thanks for the quick reply and insight, it makes sense. I initially meant the former case, as I want to keep the high precision in adapter to minimize the accuracy loss from WOQ. I think it might be challenging to achieve this (add LoRA adapter (FP32/16) on top of the WOQ model).

@XinyuYe-Intel
Copy link
Collaborator

Hi @XinyuYe-Intel, thanks for the quick reply and insight, it makes sense. I initially meant the former case, as I want to keep the high precision in adapter to minimize the accuracy loss from WOQ. I think it might be challenging to achieve this (add LoRA adapter (FP32/16) on top of the WOQ model).

No problem at all. And yes, we haven't supported the former case yet.

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