Skip to content

[WIP] Fix quantization for adapter v2 - #314

Closed
rasbt wants to merge 1 commit into
mainfrom
fix-quantize-adapter-v2
Closed

[WIP] Fix quantization for adapter v2#314
rasbt wants to merge 1 commit into
mainfrom
fix-quantize-adapter-v2

Conversation

@rasbt

@rasbt rasbt commented May 22, 2023

Copy link
Copy Markdown
Contributor

Arg, I noticed that llm.int8() quantization breaks for adapter-v2-finetuned models, giving a

    F.linear(input, self.weight, self.bias) + self.adapter_bias
RuntimeError: expected mat1 and mat2 to have the same dtype, but got: c10::BFloat16 != signed char

error.

I tried manually setting the dtype in the new v2 parameters (see this PR) but still get the same issue. Is there perhaps something I should be doing with

    with fabric.device:
        torch.set_default_tensor_type(...)

ArturK-85 referenced this pull request in ArturK-85/lit-parrot May 23, 2023
@awaelchli

Copy link
Copy Markdown
Contributor

@rasbt This might be the fix we were looking for: #323 :)

@rasbt

rasbt commented May 25, 2023

Copy link
Copy Markdown
Contributor Author

Oh yes, this may be it! Will test it out and continue the discussion in the other PR!

@rasbt

rasbt commented Jun 2, 2023

Copy link
Copy Markdown
Contributor Author

We can probably close this because of #323

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