-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add convert path for 8da4w QAT #154
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Apr 22, 2024
jerryzh168
reviewed
Apr 22, 2024
@@ -123,6 +155,7 @@ def forward(self, x: torch.Tensor) -> torch.Tensor: | |||
) | |||
return torch.nn.functional.linear(x_fq, w_fq) | |||
|
|||
# TODO: move this to common util |
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.
right, this probably doesn't have to live here, I'm also adding a new util for this as well in quant_primitives.py as well
jerryzh168
approved these changes
Apr 22, 2024
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.
looks good!
andrewor14
force-pushed
the
8da4w_qat_convert
branch
2 times, most recently
from
April 23, 2024 14:05
4c8663a
to
7d93bf7
Compare
Summary: This commit implements the convert path for 8da4w QAT, which swaps the QAT linear with the quantized linear, and quantizing the weights the same way as the PTQ flow. The result is a model that is identical to the one output by the PTQ flow. Test Plan: python test/quantization/test_qat.py -k test_qat_8da4w_quantizer Reviewers: jerryzh168, cpuhrsch Subscribers: jerryzh168, cpuhrsch, supriyar
andrewor14
force-pushed
the
8da4w_qat_convert
branch
from
April 24, 2024 19:57
7d93bf7
to
36fad62
Compare
dbyoung18
pushed a commit
to dbyoung18/ao
that referenced
this pull request
Jul 31, 2024
Summary: This commit implements the convert path for 8da4w QAT, which swaps the QAT linear with the quantized linear, and quantizing the weights the same way as the PTQ flow. The result is a model that is identical to the one output by the PTQ flow. Test Plan: python test/quantization/test_qat.py -k test_qat_8da4w_quantizer Reviewers: jerryzh168, cpuhrsch Subscribers: jerryzh168, cpuhrsch, supriyar
yanbing-j
pushed a commit
to yanbing-j/ao
that referenced
this pull request
Dec 9, 2024
yanbing-j
pushed a commit
to yanbing-j/ao
that referenced
this pull request
Dec 9, 2024
* clean up gguf loading. Move model loading to meta. * remove cpu * Fix CI and validation scripts (pytorch#154) * missing device (pytorch#232) * Use generator args to group all arguments to generator (pytorch#231) * prompt * chat_mode, num_samples * Move more generator args to use dataclass (pytorch#233) * prompt * chat_mode, num_samples * move more args * more gen args * update * args * undo some changes * typos * Minor lint fixes (pytorch#236) * remove redundancy & remove int4 linear test from ET tests (pytorch#237) * remove redundancy * no int4 linear on ET * small changes --------- Co-authored-by: Guang Yang <[email protected]> Co-authored-by: Michael Gschwind <[email protected]> Co-authored-by: Mergen Nachin <[email protected]>
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: This commit implements the convert path for 8da4w QAT, which swaps the QAT linear with the quantized linear, and quantizing the weights the same way as the PTQ flow. The result is a model that is identical to the one output by the PTQ flow.
Test Plan:
python test/quantization/test_qat.py -k test_qat_8da4w_quantizer
Reviewers: jerryzh168, cpuhrsch
Subscribers: jerryzh168, cpuhrsch, supriyar