-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[Quant] Make quantizable LSTM scriptable #83304
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: Previously `torch.nn.quantizable.LSTM` was not scriptable due to (1) the use of asterisk to unpack arguments, and (2) some arguments being Optional, which was not understood by setitem. This commit resolves both of these issues, enabling LSTM quantized through custom modules to work with TorchScript. Test Plan: python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm Reviewers: jerryzh, z-a-f Subscribers: jerryzh, z-a-f, supriyar Tasks: #83211 #75042 [ghstack-poisoned]
🔗 Helpful links
✅ No Failures (0 Pending)As of commit 7f5745b (more details on the Dr. CI page): Expand to see more💚 💚 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: Previously `torch.nn.quantizable.LSTM` was not scriptable due to (1) the use of asterisk to unpack arguments, and (2) some arguments being Optional, which was not understood by setitem. This commit resolves both of these issues, enabling LSTM quantized through custom modules to work with TorchScript. Test Plan: python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm Reviewers: jerryzh168, z-a-f Subscribers: jerryzh168, z-a-f, supriyar Tasks: #83211 #75042 [ghstack-poisoned]
Summary: Previously `torch.nn.quantizable.LSTM` was not scriptable due to (1) the use of asterisk to unpack arguments, and (2) some arguments being Optional, which was not understood by setitem. This commit resolves both of these issues, enabling LSTM quantized through custom modules to work with TorchScript. Test Plan: python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm Reviewers: jerryzh168, z-a-f Subscribers: jerryzh168, z-a-f, supriyar Tasks: #83211 #75042 [ghstack-poisoned]
Summary: Previously `torch.nn.quantizable.LSTM` was not scriptable due to (1) the use of asterisk to unpack arguments, and (2) some arguments being Optional, which was not understood by setitem. This commit resolves both of these issues, enabling LSTM quantized through custom modules to work with TorchScript. Test Plan: python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm Reviewers: jerryzh168, z-a-f Subscribers: jerryzh168, z-a-f, supriyar Tasks: #83211 #75042 [ghstack-poisoned]
Summary: Previously `torch.nn.quantizable.LSTM` was not scriptable due to (1) the use of asterisk to unpack arguments, and (2) some arguments being Optional, which was not understood by setitem. This commit resolves both of these issues, enabling LSTM quantized through custom modules to work with TorchScript. Test Plan: python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm Reviewers: jerryzh168, z-a-f Subscribers: jerryzh168, z-a-f, supriyar Tasks: #83211 #75042 ghstack-source-id: ee4e281 Pull Request resolved: #83304
@pytorchbot merge |
@pytorchbot successfully started a merge job. Check the current status here. |
Hey @andrewor14. |
Summary: Previously `torch.nn.quantizable.LSTM` was not scriptable due to (1) the use of asterisk to unpack arguments, and (2) some arguments being Optional, which was not understood by setitem. This commit resolves both of these issues, enabling LSTM quantized through custom modules to work with TorchScript. Pull Request resolved: #83304 Approved by: https://github.com/jerryzh168 Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/f81b4ae55cf4d9b44641178f31fd713f65d5af2e Test plan from GitHub: python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm Reviewed By: atalman Differential Revision: D38658671 Pulled By: andrewor14 fbshipit-source-id: 5091e6e1edc91f82bb26bc91b020b9997b17e07e
Stack from ghstack (oldest at bottom):
Summary: Previously
torch.nn.quantizable.LSTM
was not scriptabledue to (1) the use of asterisk to unpack arguments, and (2) some
arguments being Optional, which was not understood by setitem.
This commit resolves both of these issues, enabling LSTM quantized
through custom modules to work with TorchScript.
Test Plan:
python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm
Reviewers: jerryzh168, z-a-f
Subscribers: jerryzh168, z-a-f, supriyar
Tasks:
#83211
#75042