-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TOPI] Bitserial low-precision convolution #1332
Conversation
…ing and accessing vectors
please remove change in the submodule and update to the lastest one |
topi/python/topi/generic/nn.py
Outdated
@@ -53,6 +53,22 @@ def schedule_conv2d_nhwc(outs): | |||
""" | |||
return _default_schedule(outs, False) | |||
|
|||
@tvm.target.generic_func | |||
def schedule_qdense(outs): |
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.
qdense->bitserial_dense?
def _intrin_func(ins, outs): | ||
ww, xx = ins | ||
zz = outs[0] | ||
vpadd_id = tvm.const(647, 'uint32') |
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.
Did we develop an intrinsic id query function by name? since this may differ in llvm version
Some actionable items to improve the intrinsic id finding
|
topi/python/topi/generic/nn.py
Outdated
|
||
@tvm.target.generic_func | ||
def schedule_bitserial_conv2d_nhwc(outs): | ||
"""Schedule for qconv2d_nhwc |
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.
qconv2d -> bitserial, maybe try to do a search for qconv2d and rename
func(a, w, b) | ||
np.testing.assert_allclose(b.asnumpy(), b_np, rtol=1e-5) | ||
|
||
def test_bitserial_conv2d(): |
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.
Since there is a specialization path for ARM, let us add a testcase up to codegen(but not actually run the code) and quickly checking we have the intrinsic we need
topi/python/topi/generic/nn.py
Outdated
@@ -53,6 +53,22 @@ def schedule_conv2d_nhwc(outs): | |||
""" | |||
return _default_schedule(outs, False) | |||
|
|||
@tvm.target.generic_func | |||
def schedule_qdense(outs): |
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.
qdense->bitserial_dense
topi/python/topi/generic/nn.py
Outdated
@@ -143,6 +159,41 @@ def schedule_depthwise_conv2d_nhwc(outs): | |||
""" | |||
return _default_schedule(outs, False) | |||
|
|||
@tvm.target.generic_func | |||
def schedule_bitserial_conv2d_nchw(outs): | |||
"""Schedule for qconv2d_nchw |
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.
qconv2d->bitserial_conv2d, do a search over qconv2d and replace by bitserial_conv2d
please followup with the naming change and llvm intrinsic id query function |
Thanks @cowanmeg for improving the PR! this is now merged |
Bitserial low-precision convolution operators for x86 and raspberry pi
Raspberry pi schedules include optimized microkernel