-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[GPU] Conv should not extend strides and dilations for 3d output #26415
Merged
kelvinchoi-intel
merged 2 commits into
openvinotoolkit:master
from
kelvinchoi-intel:enable_melo_tts
Oct 10, 2024
Merged
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 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 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 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
118 changes: 118 additions & 0 deletions
118
...intel_gpu/tests/functional/subgraph_tests/dynamic/dynamic_smoke_test_with_static_conv.cpp
This file contains 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,118 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include "shared_test_classes/base/ov_subgraph.hpp" | ||
#include "shared_test_classes/single_op/convolution.hpp" | ||
|
||
#include "common_test_utils/ov_tensor_utils.hpp" | ||
#include "common_test_utils/node_builders/convolution.hpp" | ||
#include "common_test_utils/data_utils.hpp" | ||
#include "common_test_utils/node_builders/constant.hpp" | ||
#include "common_test_utils/node_builders/fake_quantize.hpp" | ||
|
||
#include "openvino/op/parameter.hpp" | ||
#include "openvino/op/constant.hpp" | ||
#include "openvino/op/result.hpp" | ||
#include "openvino/op/convolution.hpp" | ||
#include "openvino/op/fake_quantize.hpp" | ||
|
||
|
||
namespace { | ||
using ov::test::InputShape; | ||
|
||
typedef std::tuple< | ||
std::vector<InputShape>, // input shape | ||
ov::element::Type, // Network precision | ||
std::string // Device name | ||
> convStaticConcatDynamicGPUTestDynamicParamsSet; | ||
class ConvStaticConcatDynamicGPUTestDynamic : public testing::WithParamInterface<convStaticConcatDynamicGPUTestDynamicParamsSet>, | ||
virtual public ov::test::SubgraphBaseTest { | ||
public: | ||
static std::string getTestCaseName(const testing::TestParamInfo<convStaticConcatDynamicGPUTestDynamicParamsSet>& obj) { | ||
std::vector<InputShape> inputShape; | ||
ov::element::Type model_type; | ||
std::string targetDevice; | ||
|
||
convStaticConcatDynamicGPUTestDynamicParamsSet basicParamsSet = obj.param; | ||
std::tie(inputShape, model_type, targetDevice) = basicParamsSet; | ||
|
||
std::ostringstream result; | ||
result << "IS_Dynamic="; | ||
result << ov::test::utils::partialShape2str({inputShape[0].first}) << "_"; | ||
for (const auto& actual_shape : {inputShape[0].second}) { | ||
result << ov::test::utils::partialShape2str({actual_shape[0]}) << "_"; | ||
} | ||
result << "IS_Static="; | ||
result << ov::test::utils::partialShape2str({inputShape[1].first}) << "_"; | ||
for (const auto& actual_shape : {inputShape[1].second}) { | ||
result << ov::test::utils::partialShape2str({actual_shape[0]}) << "_"; | ||
} | ||
result << "model_type=" << model_type << "_"; | ||
result << "targetDevice=" << targetDevice; | ||
return result.str(); | ||
} | ||
|
||
protected: | ||
void SetUp() override { | ||
std::vector<InputShape> inputShape; | ||
ov::element::Type model_type; | ||
convStaticConcatDynamicGPUTestDynamicParamsSet basicParamsSet = this->GetParam(); | ||
std::tie(inputShape, model_type, targetDevice) = basicParamsSet; | ||
|
||
init_input_shapes(inputShape); | ||
|
||
ov::ParameterVector inputParams; | ||
for (auto&& shape : inputDynamicShapes) | ||
inputParams.push_back(std::make_shared<ov::op::v0::Parameter>(model_type, shape)); | ||
|
||
// Constant weight | ||
auto sh0 = inputShape[0].first[1].get_length(); | ||
auto sh1 = inputShape[1].first[1].get_length(); | ||
ov::PartialShape inShape1 = {sh0, sh1, 1}; | ||
auto tensor1 = ov::test::utils::create_and_fill_tensor(model_type, inShape1.to_shape()); | ||
std::shared_ptr<ov::Node> constantWeightOp = std::make_shared<ov::op::v0::Constant>(tensor1); | ||
constantWeightOp->set_friendly_name("constantWeight"); | ||
|
||
// Static convolution | ||
auto convolutionOp = ov::test::utils::make_convolution(inputParams[1], constantWeightOp, model_type, | ||
{3}, {1}, {0}, {0}, {1}, ov::op::PadType::EXPLICIT, 1); | ||
convolutionOp->set_friendly_name("convolution"); | ||
|
||
// Dynamic Concat | ||
const auto concat = std::make_shared<ov::op::v0::Concat>(ov::OutputVector({inputParams[0], convolutionOp}), 2); | ||
|
||
// Function | ||
auto makeFunction = [](const ov::element::Type &ngPrc, ov::ParameterVector ¶ms, const std::shared_ptr<ov::Node> &lastNode) { | ||
ov::ResultVector results; | ||
|
||
for (size_t i = 0; i < lastNode->get_output_size(); i++) | ||
results.push_back(std::make_shared<ov::op::v0::Result>(lastNode->output(i))); | ||
|
||
return std::make_shared<ov::Model>(results, params, "Concat"); | ||
}; | ||
function = makeFunction(model_type, inputParams, concat); | ||
} | ||
}; | ||
|
||
TEST_P(ConvStaticConcatDynamicGPUTestDynamic, Inference) { | ||
run(); | ||
} | ||
|
||
const std::vector<std::vector<ov::test::InputShape>> dynInputShapes1D = { | ||
{ | ||
{{1, 192, ov::Dimension::dynamic()}, {{1, 192, 1}}}, | ||
{{1, 256, 1}, {{1, 256, 1}}}, | ||
}, | ||
{ | ||
{{1, 32, ov::Dimension::dynamic()}, {{1, 32, 1}}}, | ||
{{1, 48, 1}, {{1, 48, 1}}}, | ||
}, | ||
}; | ||
|
||
INSTANTIATE_TEST_SUITE_P(smoke_static_conv_n_dynamic_concat, ConvStaticConcatDynamicGPUTestDynamic, | ||
::testing::Combine(::testing::ValuesIn(dynInputShapes1D), | ||
::testing::Values(ov::element::f16), | ||
::testing::Values(ov::test::utils::DEVICE_GPU)), | ||
ConvStaticConcatDynamicGPUTestDynamic::getTestCaseName); | ||
|
||
} // namespace |
Oops, something went wrong.
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.
does this test fail without fixing the code? I tried this and it succeeded without your fix.
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.
This 1D conv test is just for filling the 1d conv unit test to ensure 1d case because of it's missing part. This test is not related to the fix code.
"smoke_static_conv_n_dynamic_concat" functional test is related with the fix code.