-
Notifications
You must be signed in to change notification settings - Fork 257
Add int8 LUT CPU ops #2026
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
Add int8 LUT CPU ops #2026
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2026
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 665dab3 with merge base df532f0 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Looks good, left some comments around the UK api
@@ -126,7 +126,7 @@ void pack_weights( | |||
bias); | |||
} | |||
|
|||
template <int weight_nbit, int nr, int kr, int sr> | |||
template <int weight_nbit, int nr_, int kr_, int sr_> |
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.
Nit: suffix _ has different meaning too i.e. class private variables, what about capitalized?
pack_weights_fn_type pack_weights{nullptr}; | ||
pack_weights_with_lut_fn_type pack_weights_with_lut{nullptr}; |
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 we have a different uKernel config for LUT? or even worse a union
:)
pack_weights_fn_type pack_weights{nullptr}; | |
pack_weights_with_lut_fn_type pack_weights_with_lut{nullptr}; | |
union pack_weights_fn_t { | |
pack_weights_fn_type tiled{nullptr}; | |
pack_weights_with_lut_fn_type tiled_with_lut{nullptr}; | |
} |
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.
I prefer separate ones for now
int weight_nbit, | ||
bool has_weight_zeros, | ||
bool has_bias, | ||
packed_weights_size_fn_type packed_weights_with_lut_size, |
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.
function overload?
weight_nbit | ||
); | ||
constexpr bool has_lut = true; | ||
int preferred_alignment = 16; |
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.
nit: push this down closer to the kernel?
Adds op support for 1-4 bit LUT kernels (int8 multiple of FP32 scale).