-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quant][embedding qat] Support Embedding QAT via FX API #68296
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
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: 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/slowFor more information, please take a look at the CI Flow Wiki. |
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit e1f5fa6 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: ghstack-source-id: ebf204e Pull Request resolved: #68296
|
@b-koopman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: ghstack-source-id: 49f0e8c Pull Request resolved: #68296
|
@b-koopman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: ghstack-source-id: 13eda3a Pull Request resolved: #68296
|
@b-koopman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
supriyar
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.
So to clarify, for Embedding QAT we don't need a custom mapping for prepare_qat_fx but we need one for convert_fx?
cc @jerryzh168
Correct, this is implemented where nn.Embedding -> nn.qat.Embedding is implemented via However for nn.qat.Embedding -> nn.quantized.Embedding, in convert_fx, this requires a custom static mapping right now, since embedding QAT is not included in the default mappings (as is also currently needed for the eager QAT case) |
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: ghstack-source-id: 84a4462 Pull Request resolved: #68296
|
@b-koopman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: ghstack-source-id: 5fba23b Pull Request resolved: #68296
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: Differential Revision: [D32404517](https://our.internmc.facebook.com/intern/diff/D32404517) [ghstack-poisoned]
Summary: Support QAT workflow by using torch.fx QAT API. e.g. `prepare_qat_fx` and `convert_fx`. Test Plan: `pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"` Reviewers: supriyar, HDCharles Subscribers: Tasks: Tags: ghstack-source-id: 5b6f6cc Pull Request resolved: #68296
|
@b-koopman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
This broke MacOS test sanity see https://github.com/pytorch/pytorch/runs/4398281864?check_suite_focus=true#step:8:31 , reverting |
|
This pull request has been reverted by a0367f8. To re-land this change, follow these steps. |
|
This pull request has been reverted by a0367f8. To re-land this change, follow these steps. |
Stack from ghstack:
Summary:
Support QAT workflow by using torch.fx QAT API. e.g.
prepare_qat_fxandconvert_fx.Test Plan:
pytest test/quantization/fx/test_quantize_fx.py -v -k "test_qat_embedding_linear"Reviewers:
supriyar, HDCharles
Subscribers:
Tasks:
Tags:
Differential Revision: D32404517