Skip to content
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

Support for non multiple-of-128 channels #28

Closed
daquexian opened this issue May 22, 2019 · 1 comment
Closed

Support for non multiple-of-128 channels #28

daquexian opened this issue May 22, 2019 · 1 comment

Comments

@daquexian
Copy link
Contributor

Related issue: #23

The length of SIMD registers in arm devices is 128-bit, and an element is only 1-bit in BNNs, so only the case that the number of channels is 64 or a multiple of 128 is currently supported. It covers some popular networks, like ResNet, while other networks, unfortunately, cannot be deployed on dabnn.

A possible solution is to unify these unsupported cases into BGEMM:

  1. Pad on the channel dimension of weight when reading the model so that the channel of weight is a multiple of 128.
  2. When generating the image mat by im2col, pad the mat so that the number of rows is a multiple of 128.
  3. Since there is no way to perform zero-pad in BNNs, the padded elements will change the result of BGEMM. Correct the result in the following affine layer.
@daquexian
Copy link
Contributor Author

Fixed in #49 and #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant