diff options
author | Pablo Tello <pablo.tello@arm.com> | 2018-06-14 15:35:49 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:53:09 +0000 |
commit | 7282d562d459066dff3e27fd5299f71e0809990d (patch) | |
tree | ed13231d9d4a2eecbc5d1a6227bff0effbd10c95 /src | |
parent | 542e92d95536f2ab7fc6f1cc1aa1bd4f1d471212 (diff) | |
download | ComputeLibrary-7282d562d459066dff3e27fd5299f71e0809990d.tar.gz |
COMPMID-1287: Extending NEWinogradLayer test suite
Added NHWC to the dataset to the validation tests
Fixed a problem in the output transform which made the Activation to fail
because way/ordering the output transform wrote the data to the output tensor.
Change-Id: I9609f86605dbfef70b47a0fb043287bf0e5d675b
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/136015
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp | 12 | ||||
-rw-r--r-- | src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp | 6 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp b/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp index cfd53d7082..50e69a8adf 100644 --- a/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp +++ b/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp @@ -182,7 +182,6 @@ Status validate_arguments_winograd_output_trans(const ITensorInfo *input, const ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input); ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(output); ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F32); - ARM_COMPUTE_RETURN_ERROR_ON(winograd_info.output_data_layout != DataLayout::NCHW); ARM_COMPUTE_RETURN_ERROR_ON(input->dimension(1) != num_tiles.area()); ARM_COMPUTE_RETURN_ERROR_ON_MSG((kernel_dims.width != 3U && kernel_dims.width != 5U), "Winograd output transform only supports 3x3 and 5x5 kernels"); ARM_COMPUTE_RETURN_ERROR_ON_MSG((kernel_dims.width != kernel_dims.height), "Winograd output transform only supports 3x3 and 5x5 kernels"); @@ -529,12 +528,15 @@ void NEWinogradLayerTransformOutputKernel<T, OutputTileRows, OutputTileCols, Ker _num_rows = num_rows; _num_cols = num_cols; _num_channels = num_channels; - // We don't have the biases buffer at this stage as it hasn't been allocated, we pass in nullptr OutputTransform is only used here to compute the window OutputTransform output_transform(_output_workspace, _matrix_stride, _matrix_row_stride, nullptr, nullptr, _num_batches, _num_rows, _num_cols, _num_channels); - Window win; - auto win_last = output_transform.get_window(); + + Window win; + auto win_last = output_transform.get_window(); win.set(Window::DimX, Window::Dimension(0, win_last, 1)); + + _output_nhwc->info()->set_valid_region(ValidRegion(Coordinates(), _output_nhwc->info()->tensor_shape())); + INEKernel::configure(win); } @@ -548,7 +550,7 @@ void NEWinogradLayerTransformOutputKernel<T, OutputTileRows, OutputTileCols, Ker OutputTransform output_transform(_output_workspace, _matrix_stride, _matrix_row_stride, (_biases ? reinterpret_cast<T *>(_biases->buffer()) : nullptr), reinterpret_cast<T *>(_output_nhwc->buffer()), - _num_batches, _num_rows, _num_cols, _num_channels); + _num_batches, _num_rows, _num_cols, _num_channels, 0, _output_nhwc->info()->strides_in_bytes()[2] / sizeof(T), _output_nhwc->info()->strides_in_bytes()[1] / sizeof(T)); // The code below cannot be moved to configure because biases hasn't been allocated at that point const size_t fst = window.x().start(); diff --git a/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp b/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp index d9f6c0e0f8..39175c26c6 100644 --- a/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp @@ -61,7 +61,6 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *weights, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F32); ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights); ARM_COMPUTE_RETURN_ERROR_ON_MSG(weights->dimension(width_idx) != 3 && weights->dimension(height_idx) != 5, "Only 3 and 5 kernels are supported"); - ARM_COMPUTE_RETURN_ERROR_ON(data_layout != DataLayout::NCHW); // COMPMID-1287 ARM_COMPUTE_RETURN_ERROR_ON(weights->num_dimensions() > 4); ARM_COMPUTE_RETURN_ERROR_ON_MSG(conv_info.stride().first != 1 || conv_info.stride().second != 1, "Winograd layer only supports unit strides."); @@ -325,7 +324,7 @@ void NEWinogradConvolutionLayer::configure(const ITensor *input, const ITensor * //Configure Activation Layer _is_activationlayer_enabled = act_info.enabled(); - if(data_layout == DataLayout::NCHW && _is_activationlayer_enabled) + if(_is_activationlayer_enabled) { _activationlayer_function.configure(_output, nullptr, act_info); } @@ -363,6 +362,7 @@ void NEWinogradConvolutionLayer::run() { _activationlayer_function.run(); } + _memory_group.release(); } @@ -396,6 +396,7 @@ Status NEWinogradConvolutionLayer::validate(const ITensorInfo *input, const ITen // Validate input transform const TensorShape input0_shape = misc::shape_calculator::compute_winograd_input_transform_shape(*input, winograd_info); const TensorInfo input0 = input->clone()->set_tensor_shape(input0_shape); + switch(weights->dimension(idx_width)) { case 3: @@ -482,7 +483,6 @@ Status NEWinogradConvolutionLayer::validate(const ITensorInfo *input, const ITen break; } } - // Validate Activation Layer if(act_info.enabled()) { |