- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.8k
 
WIP: Supported ref and jit depthwise 6d, added test #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
            antonvor
  wants to merge
  1
  commit into
  openvinotoolkit:master
from
antonvor:feature/antonvor/depthwise_6D
  
      
      
   
      
    
  
     Closed
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
  
    
      
          
            24 changes: 24 additions & 0 deletions
          
          24 
        
  ...engine/tests/functional/plugin/cpu/shared_tests_instances/subgraph_tests/multiply_add.cpp
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright (C) 2020 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| 
     | 
||
| #include <vector> | ||
| 
     | 
||
| #include "subgraph_tests/multiply_add.hpp" | ||
| 
     | 
||
| using namespace LayerTestsDefinitions; | ||
| 
     | 
||
| namespace { | ||
| 
     | 
||
| const std::vector<InferenceEngine::Precision> netPrecisions = { | ||
| InferenceEngine::Precision::FP32 | ||
| }; | ||
| 
     | 
||
| INSTANTIATE_TEST_CASE_P(MultipleAdd, MultiplyAddLayerTest, | ||
| ::testing::Combine( | ||
| ::testing::Values(std::vector<size_t >({1, 3, 2, 2, 4, 5})), | ||
| ::testing::ValuesIn(netPrecisions), | ||
| ::testing::Values(CommonTestUtils::DEVICE_CPU)), | ||
| MultiplyAddLayerTest::getTestCaseName); | ||
| 
     | 
||
| } // namespace | 
        
          
  
    
      
          
            32 changes: 32 additions & 0 deletions
          
          32 
        
  inference-engine/tests/functional/plugin/shared/include/subgraph_tests/multiply_add.hpp
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Copyright (C) 2020 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| #pragma once | ||
| 
     | 
||
| #include <tuple> | ||
| #include <string> | ||
| #include <vector> | ||
| #include <memory> | ||
| #include "functional_test_utils/layer_test_utils.hpp" | ||
| #include "ngraph_functions/builders.hpp" | ||
| #include "ngraph_functions/utils/ngraph_helpers.hpp" | ||
| #include "common_test_utils/test_constants.hpp" | ||
| 
     | 
||
| namespace LayerTestsDefinitions { | ||
| 
     | 
||
| using MultiplyAddParamsTuple = typename std::tuple< | ||
| std::vector<size_t>, //input shapes | ||
| InferenceEngine::Precision, //Network precision | ||
| std::string>; //Device name | ||
| 
     | 
||
| class MultiplyAddLayerTest: | ||
| public testing::WithParamInterface<MultiplyAddParamsTuple>, | ||
| public LayerTestsUtils::LayerTestsCommon{ | ||
| public: | ||
| std::shared_ptr<ngraph::Function> fn; | ||
| static std::string getTestCaseName(const testing::TestParamInfo<MultiplyAddParamsTuple> &obj); | ||
| protected: | ||
| void SetUp() override; | ||
| }; | ||
| 
     | 
||
| } // namespace LayerTestsDefinitions | 
        
          
  
    
      
          
            56 changes: 56 additions & 0 deletions
          
          56 
        
  inference-engine/tests/functional/plugin/shared/src/subgraph_tests/multiply_add.cpp
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Copyright (C) 2020 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| 
     | 
||
| #include <tuple> | ||
| #include <string> | ||
| #include <vector> | ||
| #include <memory> | ||
| #include <functional> | ||
| #include <debug.h> | ||
| #include "ie_core.hpp" | ||
| #include "common_test_utils/common_utils.hpp" | ||
| #include "functional_test_utils/blob_utils.hpp" | ||
| #include "functional_test_utils/precision_utils.hpp" | ||
| #include "functional_test_utils/plugin_cache.hpp" | ||
| #include "functional_test_utils/skip_tests_config.hpp" | ||
| #include "subgraph_tests/multiply_add.hpp" | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: typically we put corresponding header in the first  | 
||
| 
     | 
||
| namespace LayerTestsDefinitions { | ||
| std::string MultiplyAddLayerTest::getTestCaseName(const testing::TestParamInfo<MultiplyAddParamsTuple> &obj) { | ||
| std::vector<size_t> inputShapes; | ||
| InferenceEngine::Precision netPrecision; | ||
| std::string targetName; | ||
| std::tie(inputShapes, netPrecision, targetName) = obj.param; | ||
| std::ostringstream results; | ||
| 
     | 
||
| results << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_"; | ||
| results << "netPRC=" << netPrecision.name() << "_"; | ||
| results << "targetDevice=" << targetName << "_"; | ||
| return results.str(); | ||
| } | ||
| 
     | 
||
| void MultiplyAddLayerTest::SetUp() { | ||
| std::vector<size_t> inputShape; | ||
| auto netPrecision = InferenceEngine::Precision::UNSPECIFIED; | ||
| std::tie(inputShape, netPrecision, targetDevice) = this->GetParam(); | ||
| auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision); | ||
| auto params = ngraph::builder::makeParams(ngPrc, {inputShape}); | ||
| auto paramOuts = ngraph::helpers::convert2OutputVector( | ||
| ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(params)); | ||
| 
     | 
||
| std::vector<size_t> constShape(inputShape.size(), 1); | ||
| constShape[1] = inputShape[1]; | ||
| 
     | 
||
| auto const_mul = ngraph::builder::makeConstant(ngPrc, constShape, std::vector<float>{-1.0f, 2.0f, -3.0f}); | ||
| auto mul = std::make_shared<ngraph::opset3::Multiply>(paramOuts[0], const_mul); | ||
| auto const_add = ngraph::builder::makeConstant(ngPrc, constShape, std::vector<float>{1.0f, -2.0f, 3.0f}); | ||
| auto add = std::make_shared<ngraph::opset3::Add>(mul, const_add); | ||
| ngraph::ResultVector results{std::make_shared<ngraph::opset3::Result>(add)}; | ||
| function = std::make_shared<ngraph::Function>(results, params, "multiplyAdd"); | ||
| } | ||
| 
     | 
||
| TEST_P(MultiplyAddLayerTest, CompareWithRefs) { | ||
| Run(); | ||
| }; | ||
| } // namespace LayerTestsDefinitions | ||
  
  Submodule mkl-dnn
    updated
      
        3 files
      
      
          
    | +12 −9 | src/cpu/jit_uni_depthwise.cpp | |
| +5 −2 | src/cpu/ref_depthwise.cpp | |
| +1 −1 | src/cpu/ref_depthwise.hpp | 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can insertData->getDims().size() be 1 (insertData->getLayout() == Layout::C)? Does it mean that this line fails?