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

Temporary fix for QAT quantizer when linear layer bias is True #1087

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

elfisworking
Copy link
Contributor

Copy link

pytorch-bot bot commented Oct 16, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1087

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b6982c0 with merge base 6ea36c5 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 16, 2024
@andrewor14
Copy link
Contributor

Hi @elfisworking, thanks for fixing this. Changes look great! Would you mind adding a test in test/quantization/test_qat.py for the bias case? Just to check that bias is in fact True after QAT module replacement.

@@ -617,7 +617,7 @@ def _replace_linear_int4(
copy_weights: bool = False,
):
for name, child in module.named_children():
if isinstance(child, nn.Linear) and (skip_layer_func is None or not skip_layer_func(child.weight)):
if isinstance(child, nn.Linear) and child.bias is None and (skip_layer_func is None or not skip_layer_func(child.weight)):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also add a TODO: support linear bias (here and L982)

@elfisworking
Copy link
Contributor Author

test has been added

@andrewor14
Copy link
Contributor

Thanks @elfisworking, merging this.

@andrewor14 andrewor14 merged commit 3103e7e into pytorch:main Oct 17, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants