armnn icon indicating copy to clipboard operation
armnn copied to clipboard

OriginsDescriptor behaviour is inconsistent

Open Rob-Hughes-Arm opened this issue 6 years ago • 1 comments

Creating a network with a concat layer (INetwork::AddConcatLayer) described with an OriginsDescriptor may result in inconsistent behaviour depending on which backend is used.

OriginsDescriptor contains two independent mechanisms for describing how to combine the input tensors:

  1. SetConcatAxis (to define a simple concat along a single axis)
  2. SetViewOriginCoord (to define a more general concat which may combine along multiple axes) There is no validation to ensure that these two definitions are consistent with each other. Therefore it is possible to create a network with an OriginsDescriptor that is inconsistent with itself.

How this data is interpreted varies depending on the backend used to execute the layer, and therefore you get different results depending on the backend:

  • The reference backend uses the ViewOriginCoords and ignores the concat axis
  • The Neon backend uses the ViewOriginCoords if subtensors are used and otherwise uses the ConcatAxis. Each case ignores the other definition.

The parsers set both of these definitions consistently with each other so this bug is likely only reproducible when using the armnn network creation API directly.

I can see the following resolutions:

  1. Remove the ViewOriginCoords completely and use just the ConcatAxis. It does not seem the more general use case is actually required.
  2. Ensure that the two definitions are always kept in sync, either automatically or by an explicit validation.

Thanks

Rob-Hughes-Arm avatar Jul 26 '19 08:07 Rob-Hughes-Arm

Thanks @rhughesgeomerics.

I think we don't need ViewOriginCoords any more, and the ConcatAxis is way simpler to use. The work needed would be to rewrite the subtensor handling and reference backend to use the ConcatAxis, and remove ViewOriginCoords handling from the parsers.

MatthewARM avatar Jul 26 '19 08:07 MatthewARM

Hi @Rob-Hughes-Arm

I have created an internal ticket for the request but I can not give any estimated time on when the ticket will be completed.

We are an open source project so if you would like to, you are welcome to get involved! Here is a link to our contibutor guide: https://github.com/ARM-software/armnn/blob/master/CONTRIBUTING.md

There is also some information available on our README: https://github.com/ARM-software/armnn/blob/master/README.md

Regards, Francis.

FrancisMurtagh-arm avatar Dec 14 '22 15:12 FrancisMurtagh-arm