diff options
author | Ramy Elgammal <ramelg01@e129512.arm.com> | 2023-01-11 18:48:04 +0000 |
---|---|---|
committer | Ramy Elgammal <ramy.elgammal@arm.com> | 2023-01-25 10:24:23 +0000 |
commit | 002e6530f6218b00a28aef9be8b21efb08cf3602 (patch) | |
tree | f3e2f9d064b985ffe283512825b34cdd59f29f50 /tests/validation/fixtures/dynamic_fusion/gpu | |
parent | cc2877368d5e15d9ea89d31c84ec651fc0fffd13 (diff) | |
download | ComputeLibrary-002e6530f6218b00a28aef9be8b21efb08cf3602.tar.gz |
Implement dynamic fusion softmax operator
- Return aux tensorInfo by get_aux_tensors() at runtime to init the aux
tensor with the right size.
- Keep softmax unfusable for this commit
- Hence, added Tensor3D to template writer arguments declaration, for sake of
keeping dynamic fusion softmax componenets' kernels matching their cl
counterparts.
Resolves: COMPMID-5523
Change-Id: I667f39545db925f667036ef448302c79a0330373
Signed-off-by: Ramy Elgammal <ramy.elgammal@arm.com>
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/483924
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: bsgcomp <bsgcomp@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8986
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/fixtures/dynamic_fusion/gpu')
4 files changed, 25 insertions, 20 deletions
diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h index 235c8602b1..b15de71707 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h @@ -145,10 +145,11 @@ protected: // (Important) Allocate auxiliary tensor memory if there are any for(auto &data : runtime.get_auxiliary_tensors()) { - auto tensor = data.first; - const auto aux_mem_req = data.second; - tensor->allocator()->init(*data.first->info(), aux_mem_req.alignment); - tensor->allocator()->allocate(); + CLTensor *tensor = std::get<0>(data); + TensorInfo info = std::get<1>(data); + AuxMemoryInfo aux_mem_req = std::get<2>(data); + tensor->allocator()->init(info, aux_mem_req.alignment); + tensor->allocator()->allocate(); // Use ACL allocated memory } // Construct user tensors diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h index e0aecf5ed4..d9ce4dff18 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DirectConv2dFixture.h @@ -133,9 +133,10 @@ protected: // (Important) Allocate auxiliary tensor memory if there are any for(auto &data : runtime.get_auxiliary_tensors()) { - auto tensor = data.first; - const auto aux_mem_req = data.second; - tensor->allocator()->init(*data.first->info(), aux_mem_req.alignment); + CLTensor *tensor = std::get<0>(data); + TensorInfo info = std::get<1>(data); + AuxMemoryInfo aux_mem_req = std::get<2>(data); + tensor->allocator()->init(info, aux_mem_req.alignment); tensor->allocator()->allocate(); // Use ACL allocated memory } // Construct user tensors @@ -273,10 +274,11 @@ protected: for(auto &data : runtime.get_auxiliary_tensors()) { - auto tensor = data.first; - const auto aux_mem_req = data.second; - tensor->allocator()->init(*data.first->info(), aux_mem_req.alignment); - tensor->allocator()->allocate(); + CLTensor *tensor = std::get<0>(data); + TensorInfo info = std::get<1>(data); + AuxMemoryInfo aux_mem_req = std::get<2>(data); + tensor->allocator()->init(info, aux_mem_req.alignment); + tensor->allocator()->allocate(); // Use ACL allocated memory } // Construct user tensors TensorType t_input{}; diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h index e2722a1bdc..faed610874 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h @@ -131,10 +131,11 @@ protected: // (Important) Allocate auxiliary tensor memory if there are any for(auto &data : runtime.get_auxiliary_tensors()) { - TensorType *tensor = data.first; - AuxMemoryInfo aux_mem_req = data.second; - tensor->allocator()->init(*data.first->info(), aux_mem_req.alignment); - tensor->allocator()->allocate(); + CLTensor *tensor = std::get<0>(data); + TensorInfo info = std::get<1>(data); + AuxMemoryInfo aux_mem_req = std::get<2>(data); + tensor->allocator()->init(info, aux_mem_req.alignment); + tensor->allocator()->allocate(); // Use ACL allocated memory } // Construct user tensors diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/Pool2dFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/Pool2dFixture.h index efb67f8b11..efb5cf1e74 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/Pool2dFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/Pool2dFixture.h @@ -109,9 +109,10 @@ protected: // (Important) Allocate auxiliary tensor memory if there are any for(auto &data : runtime.get_auxiliary_tensors()) { - auto tensor = data.first; - const auto aux_mem_req = data.second; - tensor->allocator()->init(*data.first->info(), aux_mem_req.alignment); + CLTensor *tensor = std::get<0>(data); + TensorInfo info = std::get<1>(data); + AuxMemoryInfo aux_mem_req = std::get<2>(data); + tensor->allocator()->init(info, aux_mem_req.alignment); tensor->allocator()->allocate(); // Use ACL allocated memory } // Construct user tensors @@ -142,8 +143,8 @@ protected: return reference::pooling_layer<T>(src, pool_info, QuantizationInfo(), nullptr, DataLayout::NCHW); } - TensorType _target{}; - SimpleTensor<T> _reference{}; + TensorType _target{}; + SimpleTensor<T> _reference{}; }; template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |