-
Notifications
You must be signed in to change notification settings - Fork 31.3k
[Quantization] fix fbgemm #42561
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
[Quantization] fix fbgemm #42561
Conversation
|
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. |
SunMarc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ! Just a nit
| # Sanity checks | ||
| if isinstance(module, FbgemmFp8Linear): | ||
| if tensor_name == "weight" and value.dtype == torch.float8_e4m3fn: | ||
| raise ValueError("Expect unquantized weights but got a quantized weight") | ||
| if tensor_name == "weight_scale": | ||
| raise ValueError("Expect unquantized weights but got a weight_scale") | ||
| if isinstance(module, FbgemmFp8Llama4TextExperts): | ||
| if tensor_name == "gate_up_proj_scale" or tensor_name == "down_proj_scale": | ||
| raise ValueError("Expect unquantized weights but got a quantized weight_scale") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove those checks, this shouldn't be possible here.
| # Sanity checks | |
| if isinstance(module, FbgemmFp8Linear): | |
| if tensor_name == "weight" and value.dtype == torch.float8_e4m3fn: | |
| raise ValueError("Expect unquantized weights but got a quantized weight") | |
| if tensor_name == "weight_scale": | |
| raise ValueError("Expect unquantized weights but got a weight_scale") | |
| if isinstance(module, FbgemmFp8Llama4TextExperts): | |
| if tensor_name == "gate_up_proj_scale" or tensor_name == "down_proj_scale": | |
| raise ValueError("Expect unquantized weights but got a quantized weight_scale") |
| current_key_name=None, | ||
| quantization_config=None, | ||
| pre_quantized=False, | ||
| config=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use model.config directly
| if tp_plan is not None: | ||
| tp_key = re.sub(r"\d+", "*", f"{module_name}.down_proj_scale") | ||
| tp_plan[tp_key] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment this for now
|
[For maintainers] Suggested jobs to run (before merge) run-slow: fbgemm_fp8 |
What does this PR do?
Fixes fbgemm