-
Notifications
You must be signed in to change notification settings - Fork 66
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
Yaml parsing fails with a custom mapping provided to SmoothQuantModifier recipe #105
Comments
Thanks for raising this issue. We are working on improving the SmoothQuant layermapping UX. Any suggestions you have for how to make it more intuitive would be appreciated. For now, we have a sample of quantizing Phi3 here -> https://huggingface.co/neuralmagic/Phi-3-medium-128k-instruct-quantized.w8a8 Your recipe should look like this: recipe = [
SmoothQuantModifier(
smoothing_strength=0.8,
mappings=[
[["re:.*qkv_proj"], "re:.*input_layernorm"],
[["re:.*gate_up_proj"], "re:.*post_attention_layernorm"],
],
),
GPTQModifier(
sequential=True,
targets="Linear",
scheme="W8A8",
ignore=["lm_head"],
dampening_frac=0.01,
observer="mse",
)
] |
cc @Satrat @rahul-tuli for visibility |
Thank you @robertgshaw2-neuralmagic I tried yours and the DEFAULT_SMOOTHQUANT_MAPPINGS
|
Can you post your full script so I can try to reproduce? |
@robertgshaw2-neuralmagic |
same problam, I use like https://huggingface.co/neuralmagic/Phi-3-medium-128k-instruct-quantized.w8a8/blob/main/recipe.yaml, here is my script and error:
|
same problem too |
@dsikka and @kylesayrs can we take a look into this one alongside the latest fixes we're doing for the vision pipelines and see if that is handled there or is an easy fix to include? |
Using released llmcompressor 0.1.0 on python 3.11 on ubuntu 20.04
Phi3Small Instruct does not have the default weights in the mapping (q_proj, k_proj, v_proj), so I supplied my own and it failed with a yaml parsing error :( I believe my mapping should pass. The same thing happens when I pass in the default mapping
Usage:
recipe = [ SmoothQuantModifier(smoothing_strength=0.8, mappings=[[["re:.*mlp",], "re:.*input_layernorm"]]) ]
gives
I tried passing in the default mapping and got a similar issue
import llmcompressor.modifiers.smoothquant.base as llmb SmoothQuantModifier(smoothing_strength=0.8, mappings=llmb.DEFAULT_SMOOTHQUANT_MAPPINGS)
gives a similar error
The text was updated successfully, but these errors were encountered: