-
Notifications
You must be signed in to change notification settings - Fork 26.3k
add Quantizer support to IValue #42438
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]
💊 CI failures summary and remediationsAs of commit 4bae4cd (more details on the Dr. CI page):
🚧 1 fixed upstream failure:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
| static torch::jit::Stack boxArgs(Args... args) { | ||
| // TODO Reuse stack vector instead of allocating? | ||
| torch::jit::Stack stack; | ||
| stack.reserve(sizeof...(Args)); |
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.
Should this reserve be called inside torch::jit::push? Maybe other call sites would benefit from it too.
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.
True, I can't think of a downside... OTOH I'm not sure I want to colocate that change with the other stuff in this PR 😁
This PR adds IValue support for the `Quantizer` class, by adding a `QuantizerType` tag and associated constructors and destructors. Notes: 1. This eliminates the final type unsupported by our boxed kernel wrappers, so here we also take the opportunity to eliminate the artifacts of our previous incomplete support: a) the special profiling entry points that would box a "can't box" string for unsupported types, and b) the metaprogramming to generate an error-raising wrapper for kernels with `Quantizer` in their signatures. 2. `ConstQuantizerPtr` still has some special logic associated with it in the JIT code, commented as temporary; this PR leaves that undisturbed, but should facilitate its elimination in a followup. Differential Revision: [D22894190](https://our.internmc.facebook.com/intern/diff/D22894190) [ghstack-poisoned]
This PR adds IValue support for the `Quantizer` class, by adding a `QuantizerType` tag and associated constructors and destructors. Notes: 1. This eliminates the final type unsupported by our boxed kernel wrappers, so here we also take the opportunity to eliminate the artifacts of our previous incomplete support: a) the special profiling entry points that would box a "can't box" string for unsupported types, and b) the metaprogramming to generate an error-raising wrapper for kernels with `Quantizer` in their signatures. 2. `ConstQuantizerPtr` still has some special logic associated with it in the JIT code, commented as temporary; this PR leaves that undisturbed, but should facilitate its elimination in a followup. Differential Revision: [D22894190](https://our.internmc.facebook.com/intern/diff/D22894190) [ghstack-poisoned]
This PR adds IValue support for the `Quantizer` class, by adding a `QuantizerType` tag and associated constructors and destructors. Notes: 1. This eliminates the final type unsupported by our boxed kernel wrappers, so here we also take the opportunity to eliminate the artifacts of our previous incomplete support: a) the special profiling entry points that would box a "can't box" string for unsupported types, and b) the metaprogramming to generate an error-raising wrapper for kernels with `Quantizer` in their signatures. 2. `ConstQuantizerPtr` still has some special logic associated with it in the JIT code, commented as temporary; this PR leaves that undisturbed, but should facilitate its elimination in a followup. Differential Revision: [D22894190](https://our.internmc.facebook.com/intern/diff/D22894190) [ghstack-poisoned]
Stack from ghstack:
This PR adds IValue support for the
Quantizerclass, by adding aQuantizerTypetag and associated constructors and destructors.Notes:
This eliminates the final type unsupported by our boxed kernel wrappers, so here we also take the opportunity to eliminate the artifacts of our previous incomplete support: a) the special profiling entry points that would box a "can't box" string for unsupported types, and b) the metaprogramming to generate an error-raising wrapper for kernels with
Quantizerin their signatures.ConstQuantizerPtrstill has some special logic associated with it in the JIT code, commented as temporary; this PR leaves that undisturbed, but should facilitate its elimination in a followup.Differential Revision: D22894190