-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Quant] Implemented 4 bit embedding op support; added corresponding test case #69768
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
Conversation
…est case Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow For more information, please take a look at the CI Flow Wiki. |
…est case Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags ghstack-source-id: 318c8b8 Pull Request resolved: #69768
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit b908918 (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
…esponding test case" Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags [ghstack-poisoned]
torch.testing.assert_close(ref, qresult, atol=0.005, rtol=1e-3) | ||
|
||
""" Tests the correctness of the quantized 4 bit embedding lookup operator """ | ||
@given(num_embeddings=st.integers(10, 100), |
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.
is it possible to merge this test with test_embedding_byte?
also we don't want to use hypothesis for testing, might be good to remove hypothesis here as well and change it to simple for loops. (remove @given, example: https://github.com/pytorch/pytorch/blob/master/test/quantization/core/test_quantized_op.py#L1430), can be done in a separate PR.
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.
Do you mean removing hypothesis for both test_embedding_byte and test_embedding_4bit or just the latter? It was already there in test_embedding_byte, so I thought I was supposed to add it.
And yeah, I can easily combine test_embedding_byte and test_embedding_4bit. Is it acceptable to rename the function to something like test_embedding?
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.
Do you mean removing hypothesis for both test_embedding_byte and test_embedding_4bit or just the latter? It was already there in test_embedding_byte, so I thought I was supposed to add it.
we can combine the tests and remove hypothesis, it can be in a separate PR
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.
Sounds good. I'll put that in PR5
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, had a comment for test
…esponding test case" Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags [ghstack-poisoned]
…esponding test case" Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags [ghstack-poisoned]
please import the PR with ghimport |
…esponding test case" Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags [ghstack-poisoned]
…esponding test case" Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py Reviewers: jerryzh168 Subscribers: jerryzh168, supriyar Test plan: In pytorch main dir, execute ``` python test/test_quantization.py TestStaticQuantizedModule.test_embedding_api ``` to run the series of tests, including the newly added test_embedding_4bit function Tasks: T106931792 Tags [ghstack-poisoned]
@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…roduced by #69768" Differential Revision: [D33808593](https://our.internmc.facebook.com/intern/diff/D33808593) [ghstack-poisoned]
Differential Revision: [D33808593](https://our.internmc.facebook.com/intern/diff/D33808593) [ghstack-poisoned]
…roduced by #69768" Differential Revision: [D33808593](https://our.internmc.facebook.com/intern/diff/D33808593) [ghstack-poisoned]
Differential Revision: [D33808593](https://our.internmc.facebook.com/intern/diff/D33808593) [ghstack-poisoned]
…roduced by #69768" Differential Revision: [D33808593](https://our.internmc.facebook.com/intern/diff/D33808593) [ghstack-poisoned]
Differential Revision: [D33808593](https://our.internmc.facebook.com/intern/diff/D33808593) [ghstack-poisoned]
…69768 (#71387) Summary: Pull Request resolved: pytorch/pytorch#71387 Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33808593 Pulled By: dzdang fbshipit-source-id: 3950400dc7506006666fcd055819e9a08a42eda9 (cherry picked from commit 38dc2de)
…69768 (#71387) Summary: Pull Request resolved: pytorch/pytorch#71387 Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33808593 Pulled By: dzdang fbshipit-source-id: 3950400dc7506006666fcd055819e9a08a42eda9 (cherry picked from commit 38dc2de)
…69768 (#71387) Summary: Pull Request resolved: pytorch/pytorch#71387 Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33808593 Pulled By: dzdang fbshipit-source-id: 3950400dc7506006666fcd055819e9a08a42eda9 (cherry picked from commit 38dc2de)
…69768 (#71387) Summary: Pull Request resolved: pytorch/pytorch#71387 Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33808593 Pulled By: dzdang fbshipit-source-id: 3950400dc7506006666fcd055819e9a08a42eda9 (cherry picked from commit 38dc2de)
Stack from ghstack:
Summary: Support for the 4 embedding operator has been added. The support is analogous to the preexisting support for byte/8bit embedding. A corresponding test case was added to test_quantized_embedding_op.py
Reviewers: jerryzh168
Subscribers: jerryzh168, supriyar
Test plan: In pytorch main dir, execute
to run the series of tests, including the newly added test_embedding_4bit
function
Tasks: T106931792
Tags
Differential Revision: D33152673