Skip to content

Commit

Permalink
Code reorganization and testing
Browse files Browse the repository at this point in the history
Functional DWC2D schedule with test

Code cleanup and linting

Fix padding to match Relay and add tests

Fix test cases
  • Loading branch information
guberti committed Aug 31, 2022
1 parent dd608cf commit 27e0663
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 204 deletions.
7 changes: 3 additions & 4 deletions python/tvm/relay/op/strategy/arm_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,16 @@ def conv2d_strategy_arm_cpu(attrs, inputs, out_type, target):
# Additional work could remove some of these restrictions.

elif (
isa.has_dsp_support
target.features.has_dsp
and kernel.shape[0] == kernel.shape[1] == 3
and dilation_w == dilation_h == 1
and kernel.shape[3] == 1 # channel_multiplier == 1
and data.dtype == "int8"
and padding == "SAME"
and data.shape[3] % 4 == 0
):
strategy.add_implementation(
wrap_compute_conv2d(topi.arm_cpu.depthwise_conv2d_nhwc),
wrap_topi_schedule(topi.arm_cpu.schedule_depthwise_conv2d_nhwc),
wrap_compute_conv2d(topi.arm_cpu.depthwise_conv2d_nhwc_dsp),
wrap_topi_schedule(topi.arm_cpu.schedule_depthwise_conv2d_nhwc_dsp),
name="depthwise_conv2d_nhwc_dsp.arm_cpu",
)

Expand Down
Loading

0 comments on commit 27e0663

Please sign in to comment.