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

[TOPI] bitserial_conv2d move to autotvm template and updates #2819

Merged
merged 10 commits into from
Apr 4, 2019

Conversation

cowanmeg
Copy link
Contributor

Updates to arm_cpu and x86 bitserial_conv2d operators

  • Moved to autotvm template
  • Support kernels that are pre-bitpacked for arm_cpu

@cowanmeg
Copy link
Contributor Author

@ZihengJiang

@tqchen
Copy link
Member

tqchen commented Mar 15, 2019

Please request reviewers

@cowanmeg
Copy link
Contributor Author

@eqy @ZihengJiang, please review

policy='candidate', candidate=[
[n, oh, ow, co, vh, vw, kh, kw, ci_o, kb, ib, vc, ci_i],
[n, oh, ow, co, vh, vw, kw, kh, ci_o, kb, ib, vc, ci_i],])
cfg.add_flop(2 * N * OH * OW * CO * CI * 8 * KH * KW)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the automatic flop calculation in #2776 work for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly no :( it gives an error about multiple output in the compute.

re_axes = cfg.define_reorder("reorder_0",
[n, oh, ow, co, vh, vw, kh, kw, kb, ib, vc, ci],
policy='interval_all', interval=(3, 7))
cfg.add_flop(2 * N * OH * OW * CO * CI * 8 * KH * KW)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

re_axes = cfg.define_reorder("reorder_0",
[n, co, oh, ow, vc, vh, vw, kh, kw, kb, ib, ci],
policy='interval_all', interval=(6, 11))
cfg.add_flop(2 * N * OH * OW * CO * CI * 8 * KH * KW)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

@@ -45,6 +44,9 @@ def test_bitserial_conv2d():
verify_bitserial_conv2d_nhwc(1, in_size, ic, oc, k, stride, pad, 1, 1, False)
verify_bitserial_conv2d_nhwc(1, in_size, ic, oc, k, stride, pad, 2, 1, False)

verify_bitserial_conv2d_nhwc(1, in_size, ic, oc, k, stride, pad, 1, 1, True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a correctness check here for random or precomputed inputs? It looks like generate_quantized_np is no longer used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, but it will only run on an arm device.

@tqchen
Copy link
Member

tqchen commented Mar 30, 2019

@ajtulloch @vinx13 please also help review the PR if you have time. @cowanmeg please try to rebase and fix the CI problem

@tqchen tqchen added the status: need update need update based on feedbacks label Mar 30, 2019
topi/python/topi/arm_cpu/bitserial_conv2d.py Outdated Show resolved Hide resolved
topi/python/topi/x86/bitserial_conv2d.py Outdated Show resolved Hide resolved
@tqchen tqchen merged commit 1735187 into apache:master Apr 4, 2019
@tqchen
Copy link
Member

tqchen commented Apr 4, 2019

Thanks, @vinx13 @cowanmeg @eqy, this is now merged

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

Successfully merging this pull request may close these issues.

4 participants