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
[quant] AT_DISPATCH_FLOATING_AND_QINT_TYPES #48050
Conversation
[ghstack-poisoned]
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.
lg, can we add a test plan to the diff summary
What kind of test for the switch are you looking for? |
Differential Revision: [D25004159](https://our.internmc.facebook.com/intern/diff/D25004159) [ghstack-poisoned]
Codecov Report
@@ Coverage Diff @@
## gh/z-a-f/87/base #48050 +/- ##
====================================================
- Coverage 81.30% 81.30% -0.01%
====================================================
Files 1839 1839
Lines 198452 198452
====================================================
- Hits 161353 161345 -8
- Misses 37099 37107 +8 |
@@ -280,6 +280,25 @@ inline void deprecated_AT_DISPATCH_ALL_TYPES_AND_HALF_AND_COMPLEX() {} | |||
} \ | |||
}() | |||
|
|||
#define AT_DISPATCH_FLOATING_AND_QINT_TYPES(TYPE, NAME, ...) \ |
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 we can compose...would be even better if we can compose AT_DISPATCH_FLOATING_TYPES and AT_DISPATCH_QINT_TYPES somehow.
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.
Composition would require rewriting the dispatch switches to avoid the the default case.
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.
can we just define a macro for 3 AT_QINT_PRIVATE_CASE_TYPE and 2 AT_PRIVATE_CASE_TYPE ?
e.g.
#define QINT_CASES(__VA_ARGS__) AT_QINT_PRIVATE_CASE_TYPE(...) \
AT_QINT_PRIVATE_CASE_TYPE(...) \
AT_QINT_PRIVATE_CASE_TYPE(...)
AT_QINT_PRIVATE_CASE_TYPE( \ | ||
at::kQInt8, at::qint8, at::kChar, int8_t, __VA_ARGS__) \ | ||
AT_QINT_PRIVATE_CASE_TYPE( \ | ||
at::kQUInt8, at::quint8, at::kByte, uint8_t, __VA_ARGS__) \ | ||
AT_QINT_PRIVATE_CASE_TYPE( \ | ||
at::kQInt32, at::qint32, at::kInt, int, __VA_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.
e.g. we might be able to compose if we move these cases to a macro, and also the float cases to another macro
## Stale alert! Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack:
The switch does not require testing -- if need to confirm if it works right, you can run the tests for the reflection padding:
python test/test_quantization.py TestPadding
Differential Revision: D25004159