-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GPU] Some fixes to enable dynamic validation model (#18340)
* skip fuse_quantize_f if input or output layout is dynamic * Update condition of can_fuse_reorder_to_prev for concat in shapeof subgraph * skip concat_in_place_optimization if concat is shape of subgraph Signed-off-by: Andrew Park <[email protected]> * Add reorder if eltwise is shapeof subgraph and data type between input and output is different * Skip reorder optimization if reorder has dynamic shape on remove_redundant_reorders * Add reproducible TCs for ov_gpu_unit_tests --------- Signed-off-by: Andrew Park <[email protected]>
- Loading branch information
1 parent
68e1f07
commit 9069dab
Showing
8 changed files
with
203 additions
and
7 deletions.
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
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
65 changes: 65 additions & 0 deletions
65
src/plugins/intel_gpu/tests/unit/passes/add_required_reorders_test.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,65 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "test_utils.h" | ||
|
||
#include "intel_gpu/runtime/engine.hpp" | ||
|
||
#include "intel_gpu/graph/network.hpp" | ||
#include "intel_gpu/graph/program.hpp" | ||
#include "data_inst.h" | ||
#include "shape_of_inst.h" | ||
#include "gather_inst.h" | ||
#include "eltwise_inst.h" | ||
#include "reshape_inst.h" | ||
#include "concatenation_inst.h" | ||
#include "pass_manager.h" | ||
#include "to_string_utils.h" | ||
|
||
#include "program_wrapper.h" | ||
|
||
#include <memory> | ||
|
||
using namespace cldnn; | ||
using namespace ::tests; | ||
|
||
TEST(add_required_reorders, input_reorder_inside_shape_of_subgraph) { | ||
auto& engine = get_test_engine(); | ||
auto input_layout_dynamic = layout{ov::PartialShape{1, 32, ov::Dimension::dynamic(), ov::Dimension::dynamic()}, | ||
data_types::f16, format::bfyx}; | ||
auto input = engine.allocate_memory({ov::PartialShape{1, 32, 32, 32}, data_types::f16, format::bfyx}); | ||
auto data_0 = engine.allocate_memory({ ov::PartialShape{}, data_types::i32, format::bfyx }); | ||
auto data_1 = engine.allocate_memory({ ov::PartialShape{}, data_types::f32, format::bfyx }); | ||
|
||
topology topology; | ||
topology.add(input_layout("input", input_layout_dynamic)); | ||
topology.add(data("data_0", data_0)); | ||
topology.add(data("data_1", data_1)); | ||
topology.add(shape_of("shape_of", input_info("input"), 4, data_types::i32)); | ||
topology.add(gather("gather0", input_info("shape_of"), input_info("data_0"), 0, {}, 0, true)); | ||
topology.add(eltwise("eltwise0", {input_info("gather0"), input_info("data_1")}, eltwise_mode::prod, data_types::f32)); | ||
topology.add(reshape("reshape0", input_info("eltwise0"), false, {}, | ||
ov::PartialShape{1}, reshape::reshape_mode::unsqueeze)); | ||
topology.add(gather("gather1", input_info("shape_of"), input_info("data_0"), 0, {}, 0, true)); | ||
topology.add(eltwise("eltwise1", {input_info("gather1"), input_info("data_1")}, eltwise_mode::prod, data_types::f32)); | ||
topology.add(reshape("reshape1", input_info("eltwise1"), false, {}, | ||
ov::PartialShape{1}, reshape::reshape_mode::unsqueeze)); | ||
topology.add(concatenation("concat0", {input_info("reshape0"), input_info("reshape1")}, 0, data_types::f32)); | ||
|
||
ExecutionConfig config = get_test_default_config(engine); | ||
config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); | ||
config.set_property(ov::intel_gpu::optimize_data(true)); | ||
network network(engine, topology, config); | ||
network.set_input_data("input", input); | ||
|
||
network.execute(); | ||
|
||
auto prog = network.get_program(); | ||
ASSERT_NE(prog, nullptr); | ||
|
||
auto& eltwise_node = prog->get_node("eltwise0"); | ||
auto eltwise_in_layout = eltwise_node.get_input_layout(); | ||
|
||
ASSERT_EQ(eltwise_in_layout.data_type, data_types::f32); | ||
} |
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