-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quantization] PackedSequence support for quantized LSTM #29585
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
[ghstack-poisoned]
jianyuh
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.
LGTM! Thanks for finishing this so quickly!
aten/src/ATen/native/RNN.cpp
Outdated
| if (use_miopen(data, dropout_p)) { | ||
| Tensor output, hy, cy; | ||
| lstm_packed_miopen_stub(data.type().device_type(), output, hy, cy, data, batch_sizes, hx, | ||
| _params, has_biases, num_layers, dropout_p, train, bidirectional); | ||
| return std::make_tuple(std::move(output), std::move(hy), std::move(cy)); | ||
| } |
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 we need to add the same handler in Line 1160?
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.
Actually, not sure this should even be here. I just directly copy-pasted from the regular LSTM function
BTW do we actually support cudnn for these ops?
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.
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.
@jianyuh I don't think those implementations (miopen and cudnn) actually support dynamic quantization
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.
Oh I thought you were asking if lstm_packed_miopen has cuda/cudnn implementation. Yep, the dynamic quantization is only supported on the CPU side.
jianyuh
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.
Check the BC issue:
Nov 11 23:15:22 processing existing schema: aten::quantized_lstm(Tensor input, Tensor[] hx, Tensor[] params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, bool batch_first, *, int? dtype=None, bool use_dynamic=False) -> (Tensor, Tensor, Tensor)
Nov 11 23:15:22 Can NOT find backward compatible schemas after changes for schema aten::quantized_lstm(Tensor input, Tensor[] hx, Tensor[] params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, bool batch_first, *, int? dtype=None, bool use_dynamic=False) -> (Tensor, Tensor, Tensor) from the following candidates:
Nov 11 23:15:22 [
Nov 11 23:15:22 aten::quantized_lstm.data(Tensor data, Tensor batch_sizes, Tensor[] hx, Tensor[] params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, *, int? dtype=None, bool use_dynamic=False) -> (Tensor, Tensor, Tensor)
Nov 11 23:15:22 aten::quantized_lstm.tensor(Tensor input, Tensor[] hx, Tensor[] params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, bool batch_first, *, int? dtype=None, bool use_dynamic=False) -> (Tensor, Tensor, Tensor)
Nov 11 23:15:22 ]
Nov 11 23:15:22 The PR is introducing backward incompatible changes to the operator library. Please contact PyTorch team to confirm whether this change is wanted or not.
|
@jianyuh I believe the BC issue is a false positive: the only difference from before is it has the |
Fixes #27963 Differential Revision: [D18436569](https://our.internmc.facebook.com/intern/diff/D18436569) [ghstack-poisoned]
Fixes #27963 Differential Revision: [D18436569](https://our.internmc.facebook.com/intern/diff/D18436569) [ghstack-poisoned]
Fixes #27963 Differential Revision: [D18436569](https://our.internmc.facebook.com/intern/diff/D18436569) [ghstack-poisoned]
Summary: Pull Request resolved: pytorch/pytorch#29585 Test Plan: Imported from OSS Differential Revision: D18436569 Pulled By: jamesr66a fbshipit-source-id: 0f32c0fcc897894e30d8e7ff203392c1a961ce60
|
@jamesr66a merged this pull request in 20fb8a8. |
…ntized LSTM As Title says. This is a follow-up for #29585. Check #27963 Differential Revision: [D18497319](https://our.internmc.facebook.com/intern/diff/D18497319/) [ghstack-poisoned]
…ntized LSTM As Title says. This is a follow-up for #29585. Check #27963 Differential Revision: [D18497319](https://our.internmc.facebook.com/intern/diff/D18497319/) ghstack-source-id: 93883524 Pull Request resolved: #29786
Stack from ghstack:
Fixes #27963
Differential Revision: D18436569