- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.7k
[TOPI] Bitserial dense operators for CPU #3051
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
| elif pack_dtype == 'uint64': | ||
| binary_op_multiplier = 64 | ||
|  | ||
| cfg.add_flop(batch * out_dim * in_dim * binary_op_multiplier) | 
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.
Does this match how we usually do flop calculation (e.g., including ops for padding) etc.?
| elif pack_dtype == 'uint32': | ||
| binary_op_multiplier = 32 | ||
| elif pack_dtype == 'uint64': | ||
| binary_op_multiplier = 64 | 
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: can we pattern match on the dtype str?
| elif pack_dtype == 'uint32': | ||
| binary_op_multiplier = 32 | ||
| elif pack_dtype == 'uint64': | ||
| binary_op_multiplier = 64 | 
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.
"
| index of axis to place bit axis in resulting packed data""" | ||
| ishape = data.shape | ||
| n = len(ishape) | ||
| if pack_type == 'uint8': | 
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.
"
TOPI cpu bitserial dense operators for low bit-widths. These very similar to the bitserial conv2d operators.
Please review @vinx13 @eqy @ajtulloch
Thanks!