Skip to content

Conversation

@sergio-grovety
Copy link
Contributor

Issue #8717
Add x86 schedule for depthwise_conv2d_nhwc
use x86 depthwise_conv2d_nhwc schedule for arm_cpu

return s


def schedule_depthwise_conv2d_nhwc(outs):
Copy link
Contributor

Choose a reason for hiding this comment

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

@junrushao1994 @mbrookhart is this location ok? i believe this schedule is generic. could you take a look at it?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like x86 always packs depthwise conv to NCHWc, so this will never get hit on an x86 machine. That makes it feel a little misplaced. Any reason not to put it here? https://github.com/apache/tvm/blob/main/python/tvm/topi/generic/conv2d.py
I think that's where a lot of the multi-CPU specialization ends up, i.e, all of the int8 kernels for ARM and X86 go through there.

@areusch
Copy link
Contributor

areusch commented Sep 23, 2021

@sergey-grovety could you add a test to exercise this schedule?

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

thanks @sergey-grovety i'd like to get @mbrookhart or @junrushao1994 's feedback on schedule placement, then we can merge this.

if file["path"] in {"CMSIS/DSP/Include", "CMSIS/DSP/Include/dsp", "CMSIS/NN/Include"}:
include_trees.update({file["path"]: file["sha"]})

for path, sha in include_trees.items():
Copy link
Contributor

Choose a reason for hiding this comment

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

do you mind factoring this into a helper function in python/tvm/contrib/download.py? it's fairly complex so would prefer if we can reuse it if needed.

Sergey Smirnov added 2 commits September 28, 2021 15:44
…m/sergey-grovety/tvm into issue8717-x86-DwsConv2d-schedule"

This reverts commit e927567, reversing
changes made to 0ccb5a0.
This reverts commit 32ede71.
fix format
move schedule_depthwise_conv2d_nhwc to generic conv2d, add test for schedule_depthwise_conv2d_nhwc
fix test_export_model_library_format_workspace
use x86 depthwise_conv2d_nhwc schedule for arm_cpu
Add x86 schedule for depthwise_conv2d_nhwc

# Conflicts:
#	python/tvm/relay/op/strategy/arm_cpu.py
Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

thanks @sergey-grovety!

@areusch
Copy link
Contributor

areusch commented Sep 30, 2021

Merging due to separate reports of problems with WinMacBuild.

@areusch areusch merged commit 12330ca into apache:main Sep 30, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
* [microTVM] Update support for ARMv7m intrinsic

 - Improved implementaion of gemm function for conv2d
 - Removed %4 restriction for channels
 - Added test case to verify SMLAD intrinsic speed acceleration

Signed-off-by: Sergey Smirnov <Sergey@grovety.com>

* [microTVM] Update support for ARMv7m intrinsic

 - Improved implementaion of gemm function for conv2d
 - Removed %4 restriction for channels
 - Added test case to verify SMLAD intrinsic speed acceleration

Signed-off-by: Sergey Smirnov <Sergey@grovety.com>

* Issue 8717 Add schedule for depthwise_conv2d_nhwc

* Implemented discussed changes.

* Removed unnecessary test files.

* Formatting fixed.

* Formatting fixed2.

* Formatting fixed3.

* Formatting fixed4.

* Formatting fixed5.

* Fixed test time result checking.

* Check rebuild.

* Formatting fixed.

* Formatting fixed.

* Add default DepthwiseConv2D schedule in NHWC layout for arm cpu

* Fixed micro model library test. Checking size reduced to 16 bytes from 2466816.

* Revert "Merge branch 'update-arm-simd-intrinsic' of https://github.com/sergey-grovety/tvm into issue8717-x86-DwsConv2d-schedule"

This reverts commit e927567, reversing
changes made to 0ccb5a0.

* Revert "fix test_export_model_library_format_workspace"

This reverts commit 32ede71.
fix format
move schedule_depthwise_conv2d_nhwc to generic conv2d, add test for schedule_depthwise_conv2d_nhwc
fix test_export_model_library_format_workspace
use x86 depthwise_conv2d_nhwc schedule for arm_cpu
Add x86 schedule for depthwise_conv2d_nhwc

# Conflicts:
#	python/tvm/relay/op/strategy/arm_cpu.py

* move schedule_depthwise_conv2d_nhwc to generic conv2d, add test for schedule_depthwise_conv2d_nhwc
fix format
Revert "fix test_export_model_library_format_workspace"
added a missing comma

* Revert wrong merge changes

* empty commit to force pipeline restart

* Add condition to use compute_at for generic schedule_depthwise_conv2d_nhwc

Co-authored-by: Sergey Smirnov <Sergey.Smirnov@mir.dev>
Co-authored-by: Alex-grovety <Alexey.Yazev@mir.dev>
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* [microTVM] Update support for ARMv7m intrinsic

 - Improved implementaion of gemm function for conv2d
 - Removed %4 restriction for channels
 - Added test case to verify SMLAD intrinsic speed acceleration

Signed-off-by: Sergey Smirnov <Sergey@grovety.com>

* [microTVM] Update support for ARMv7m intrinsic

 - Improved implementaion of gemm function for conv2d
 - Removed %4 restriction for channels
 - Added test case to verify SMLAD intrinsic speed acceleration

Signed-off-by: Sergey Smirnov <Sergey@grovety.com>

* Issue 8717 Add schedule for depthwise_conv2d_nhwc

* Implemented discussed changes.

* Removed unnecessary test files.

* Formatting fixed.

* Formatting fixed2.

* Formatting fixed3.

* Formatting fixed4.

* Formatting fixed5.

* Fixed test time result checking.

* Check rebuild.

* Formatting fixed.

* Formatting fixed.

* Add default DepthwiseConv2D schedule in NHWC layout for arm cpu

* Fixed micro model library test. Checking size reduced to 16 bytes from 2466816.

* Revert "Merge branch 'update-arm-simd-intrinsic' of https://github.com/sergey-grovety/tvm into issue8717-x86-DwsConv2d-schedule"

This reverts commit e927567, reversing
changes made to 0ccb5a0.

* Revert "fix test_export_model_library_format_workspace"

This reverts commit 32ede71.
fix format
move schedule_depthwise_conv2d_nhwc to generic conv2d, add test for schedule_depthwise_conv2d_nhwc
fix test_export_model_library_format_workspace
use x86 depthwise_conv2d_nhwc schedule for arm_cpu
Add x86 schedule for depthwise_conv2d_nhwc

# Conflicts:
#	python/tvm/relay/op/strategy/arm_cpu.py

* move schedule_depthwise_conv2d_nhwc to generic conv2d, add test for schedule_depthwise_conv2d_nhwc
fix format
Revert "fix test_export_model_library_format_workspace"
added a missing comma

* Revert wrong merge changes

* empty commit to force pipeline restart

* Add condition to use compute_at for generic schedule_depthwise_conv2d_nhwc

Co-authored-by: Sergey Smirnov <Sergey.Smirnov@mir.dev>
Co-authored-by: Alex-grovety <Alexey.Yazev@mir.dev>
@sergio-grovety sergio-grovety deleted the issue8717-x86-DwsConv2d-schedule branch October 26, 2022 09:20
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

Successfully merging this pull request may close these issues.

3 participants