Skip to content

[4a/10] [CMSIS-NN] Calculate CMSIS-NN buffer size with respect to architecture extensions - #9338

Merged
leandron merged 1 commit into
apache:mainfrom
Mousius:cmsisnn-buffer-calculations
Jan 5, 2022
Merged

[4a/10] [CMSIS-NN] Calculate CMSIS-NN buffer size with respect to architecture extensions#9338
leandron merged 1 commit into
apache:mainfrom
Mousius:cmsisnn-buffer-calculations

Conversation

@Mousius

@MousiusMousius commented Oct 21, 2021

Copy link
Copy Markdown
Member

This correctly calculates the buffer sizes for a variety of targets based on the -mcpu and -mattr flags passed to the cmsis-nn code generator.

Added for Conv2d, Depthwise Conv2d and Average Pool.

@Mousius

Copy link
Copy Markdown
MemberAuthor

CC @ashutosh-arm @manupa-arm

@Mousius
Mousiusforce-pushed the cmsisnn-buffer-calculations branch from b468ff7 to c347020CompareOctober 21, 2021 08:58
@MousiusMousius changed the title [CMSIS-NN] Calculate Conv2d buffer size with respect to architecture extensions[4a/10] [CMSIS-NN] Calculate Conv2d buffer size with respect to architecture extensionsOct 21, 2021

@asparkhiasparkhi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Chris! LGTM. Some minor comments in there.

Comment threadsrc/relay/backend/contrib/cmsisnn/buffer_size.cc
Comment threadsrc/relay/backend/contrib/cmsisnn/compiler_attrs.cc Outdated
Comment threadtests/python/relay/aot/aot_test_utils.py
This correctly calculates the buffer sizes for a variety of targets
based on the `-mcpu` and `-mattr` flags passed to the `cmsis-nn` code
generator.
Added for Conv2d, Depthwise Conv2d and Average Pool.
@Mousius
Mousiusforce-pushed the cmsisnn-buffer-calculations branch from 9795a5b to 11a2dadCompareDecember 29, 2021 15:35
@MousiusMousius changed the title [4a/10] [CMSIS-NN] Calculate Conv2d buffer size with respect to architecture extensions[4a/10] [CMSIS-NN] Calculate CMSIS-NN buffer size with respect to architecture extensionsDec 29, 2021
ASSERT_EQ(depthwise_conv2d_with_channels(kHasDSP, 4, 6), 0);
ASSERT_EQ(depthwise_conv2d_with_channels(kHasDSP, 8, 7), 0);
ASSERT_EQ(depthwise_conv2d_with_channels(kHasMVE, 4, 6), 0);
ASSERT_EQ(depthwise_conv2d_with_channels(kHasMVE, 8, 7), 0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like it that you have included multiples of 4 cases here for channel 😄

@asparkhi

asparkhi commented Jan 4, 2022

Copy link
Copy Markdown
Contributor

Thanks @Mousius for this support and also taking care of adding the buffer support for all the other layers that needed buffer size calculations. LGTM!

@leandronleandron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@leandron
leandron merged commit 92eeef6 into apache:mainJan 5, 2022
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
apache#9338)
This correctly calculates the buffer sizes for a variety of targets
based on the `-mcpu` and `-mattr` flags passed to the `cmsis-nn` code
generator.
Added for Conv2d, Depthwise Conv2d and Average Pool.
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
apache#9338)
This correctly calculates the buffer sizes for a variety of targets
based on the `-mcpu` and `-mattr` flags passed to the `cmsis-nn` code
generator.
Added for Conv2d, Depthwise Conv2d and Average Pool.
Sign up for freeto 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

@Mousius@asparkhi@leandron