Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU] Multi-port input support for unfusing (#30381)

Mingyu Kim431c5a4e67ad
diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/kernel_impl_params.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/kernel_impl_params.hpp
index a155cd03545..bb4bc6bed2e 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/graph/kernel_impl_params.hpp
+++ b/src/plugins/intel_gpu/include/intel_gpu/graph/kernel_impl_params.hpp
@@ -123,7 +123,7 @@ struct kernel_impl_params final {
const layout& get_output_layout(size_t idx = 0) const {
OPENVINO_ASSERT(output_layouts.size() > idx,
"The size of output layouts must be greater than the requested index: ",
- "Requested index is ", idx, ",",
+ "Requested index is ", idx, ", ",
"but the size of output layouts is ", output_layouts.size());
return output_layouts[idx];
}
@@ -131,7 +131,7 @@ struct kernel_impl_params final {
layout& get_output_layout(size_t idx = 0) {
OPENVINO_ASSERT(output_layouts.size() > idx,
"The size of output layouts must be greater than the requested index: ",
- "Requested index is ", idx, ",",
+ "Requested index is ", idx, ", ",
"but the size of output layouts is ", output_layouts.size());
return output_layouts[idx];
}
diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp
index 34172420933..9da647d5dc6 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp
+++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp
@@ -52,7 +52,7 @@ struct input_info {
}
primitive_id pid;
- int32_t idx;
+ int32_t idx; // output port index of primitive
struct cmp {
bool operator() (const input_info a, const input_info b) {
if (a.pid < b.pid) {
@@ -239,6 +239,8 @@ public:
size_t num_outputs;
virtual const std::string& get_type_info() const = 0;
+ virtual std::shared_ptr<primitive> clone() const = 0;
+
virtual void save(BinaryOutputBuffer& ob) const {
ob << type_string();
ob << id;
@@ -311,7 +313,7 @@ public:
std::to_string(idx),
" exceeds total dependencies count (",
std::to_string(input.size() + dependencies_map.size()),
- ") for",
+ ") for ",
id,
" primitive");
@@ -351,7 +353,8 @@ protected:
template <class PType>
class primitive_base : public primitive {
public:
- std::shared_ptr<PType> clone() const { return std::make_shared<PType>(static_cast<const PType &>(*this)); }
+ std::shared_ptr<PType> typed_clone() const { return std::make_shared<PType>(static_cast<const PType &>(*this)); }
+ std::shared_ptr<primitive> clone() const override { return typed_clone(); };
protected:
explicit primitive_base(const primitive_id& id,
diff --git a/src/plugins/intel_gpu/src/graph/dynamic_quantize.cpp b/src/plugins/intel_gpu/src/graph/dynamic_quantize.cpp
index 162dce3a713..514219ffd81 100644
--- a/src/plugins/intel_gpu/src/graph/dynamic_quantize.cpp
+++ b/src/plugins/intel_gpu/src/graph/dynamic_quantize.cpp
@@ -32,7 +32,7 @@ static bool should_skip_execution(dynamic_quantize_node const& node, const layou
// If batch size is 1, dynamic_quantize is disabled for performance reason
size_t input_batch = act_layout.batch();
- if (act_layout.format == format::bfyx) {
+ if (act_layout.format == format::bfyx && act_layout.get_partial_shape().size() != 2) {
// 3D input
input_batch = act_layout.batch() * act_layout.feature();
}
@@ -73,14 +73,23 @@ std::vector<layout> dynamic_quantize_inst::__calc_output_layouts(const dynamic_q
auto flag_skip_execution = should_skip_execution(node, act_layout);
GPU_DEBUG_TRACE_DETAIL << node.id() << " should_skip_execution " << flag_skip_execution << std::endl;
- if (flag_skip_execution)
- output_layouts[0] = act_layout; // When execution is skipped, output data type is same as input data type
if (attrs.quantization_type == ov::op::internal::DynamicQuantize::QuantizationType::Asymmetric &&
attrs.output_storage_type == ov::op::internal::DynamicQuantize::OutputStorageType::Planar) {
output_layouts.emplace_back(layout(output_shapes[2], attrs.zp_dt, output_format));
}
+ if (flag_skip_execution) {
+ // When execution is skipped, output data type is same as input data type
+ output_layouts[0] = act_layout;
+
+ // size of other dyn_quan outputs should be 0
+ for (size_t i = 1; i < output_layouts.size(); i++) {
+ *output_shapes[i].begin() = 0;
+ output_layouts[i].set_partial_shape(output_shapes[i]);
+ }
+ }
+
return output_layouts;
}
diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp
index 5a2ecf0aade..bdc268bb8af 100644
--- a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp
+++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp
@@ -463,7 +463,7 @@ void prepare_primitive_fusing::fuse_bias(program &p) {
continue;
}
- auto fc_with_bias_prim = desc->clone();
+ auto fc_with_bias_prim = desc->typed_clone();
fc_with_bias_prim->id = desc->id + "_tmp";
fc_with_bias_prim->bias = bias_name;
fc_with_bias_prim->output_data_types = {optional_data_type{fc.get_output_layout().data_type}};
diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp
index cf2dfa888fb..8373e6ee7b3 100644
--- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp
+++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp
@@ -140,6 +140,10 @@ bool has_any_cpu_user_not_shape_of(const std::list<const program_node*>& users)
}
return false;
}
+
+primitive_id tag_port_number(const primitive_id& in, size_t port = 0) {
+ return in + ".port" + std::to_string(port);
+}
} // namespace
bool is_any_user_cpu(const std::list<const program_node*>& users) {
@@ -1833,7 +1837,11 @@ void primitive_inst::reset_flags() {
void primitive_inst::prepare_primitive() {
OV_ITT_SCOPED_TASK(ov::intel_gpu::itt::domains::intel_gpu_plugin, openvino::itt::handle("primitive_inst::execute: " + id()));
const auto& primitive_id = id();
- OPENVINO_ASSERT(_has_valid_input, primitive_id, " has invalid/unset input");
+ if (!_has_valid_input) {
+ // For unfused network with dynamic_quantization, we may have empty/unused input
+ GPU_DEBUG_TRACE_DETAIL << primitive_id << " does not have valid input. do nothing" << std::endl;
+ return;
+ }
GPU_DEBUG_TRACE_DETAIL << "-----------------------------------------------------------------" << std::endl;
GPU_DEBUG_TRACE_DETAIL << "Execute " << id() << " (type: " << _impl_params->desc->type_string() << ") " << std::endl;
for (size_t i = 0; i < _deps.size(); ++i) {
@@ -2001,10 +2009,11 @@ void primitive_inst::execute() {
}
if (_unfused_subgraph != nullptr) {
+ GPU_DEBUG_TRACE << "Now execute unfused subgraph " << _node->id() << std::endl;
for (auto& d : _deps) {
if (!d.first->get_node().is_type<data>()) {
- auto allocated_mem = d.first->output_memory_ptr();
- auto actual_input_layout = d.first->get_output_layout();
+ auto allocated_mem = d.first->output_memory_ptr(d.second);
+ auto actual_input_layout = d.first->get_output_layout(d.second);
auto& engine = get_network().get_engine();
cldnn::memory_ptr actual_mem = nullptr;
// Need to use actual layout, not the fake aligned memory layout
@@ -2013,7 +2022,10 @@ void primitive_inst::execute() {
} else {
actual_mem = engine.allocate_memory(actual_input_layout);
}
- _unfused_subgraph->set_input_data(d.first->id(), std::move(actual_mem));
+ auto port_id = tag_port_number(d.first->id(), d.second);
+ GPU_DEBUG_TRACE_DETAIL << "set_input_data " << port_id << " " << actual_mem << std::endl;
+ if (actual_mem)
+ _unfused_subgraph->set_input_data(port_id, std::move(actual_mem));
}
}
GPU_DEBUG_TRACE_DETAIL << "[Start] Executing unfused subgraph of " << id() << std::endl;
@@ -2555,55 +2567,78 @@ std::string primitive_inst::generic_to_string(program_node const& node, const ch
cldnn::network::ptr primitive_inst::get_unfused_subgraph() {
GPU_DEBUG_TRACE_DETAIL << id() << ": Use unfused subgraph due to unexpected fusions\n";
if (!_unfused_subgraph) {
+ const auto has_primitive_id = [](std::vector<primitive_id> arr, const auto& target_pid) {
+ return std::any_of(arr.cbegin(), arr.cend(), [&](const auto& pid) {
+ return pid == target_pid;
+ });
+ };
+
topology t;
- std::vector<primitive_id> outer_dep_ids;
+ std::vector<primitive_id> added_prim_ids;
+ std::vector<primitive_id> outer_dep_ids_with_port; // added_prim_ids that is updated with port number. This contains original name without port
// Add input primitives: constants are moved as is
- // Any other primitive types are replaced with input_layout
- auto prim_of_fused_node = std::const_pointer_cast<primitive>(_impl_params->desc);
+ // Any other primitive types are replaced with input_layout
+ // Name has postfix of port number for multi-port connection case (such as dynamic_quantization)
+ auto prim_of_fused_node = _impl_params->desc->clone();
size_t dep_idx = 0;
for (auto& dep : get_node().get_dependencies()) {
cldnn::primitive_id dep_id = dep.first->id();
+ // Update name to have port number as postfix
+ auto port_dep_id = tag_port_number(dep_id, dep.second);
+
+ // Update input primitive name of prim_of_fused_node
+ if (dep_idx < prim_of_fused_node->dependencies().size())
+ prim_of_fused_node->get_dependency(dep_idx) = {port_dep_id, 0};
+
+ GPU_DEBUG_TRACE_DETAIL << " add primitive for outer_dep: " << port_dep_id << "\n";
+
if (dep.first->is_type<data>()) {
auto& data_node = dep.first->as<data>();
// need to rename primitive ids of dependent data of the current fused nodes with those in the original primitive
- if (dep_idx >= prim_of_fused_node->input_size() && dep_idx < prim_of_fused_node->dependencies().size())
- dep_id = prim_of_fused_node->dependencies()[dep_idx].pid;
// mem field of original primitive can be nullified during transfer_memory_to_device pass, thus use mem from program_node
- data data_prim(dep_id, data_node.get_attached_memory_ptr());
+ data data_prim(port_dep_id, data_node.get_attached_memory_ptr());
t.add(data_prim);
} else {
- input_layout in_prim(dep_id, dep.first->get_output_layout());
+ input_layout in_prim(port_dep_id, dep.first->get_output_layout());
t.add(in_prim);
}
- outer_dep_ids.push_back(dep_id);
+ added_prim_ids.push_back(dep_id);
+ outer_dep_ids_with_port.push_back(dep_id);
dep_idx += 1;
}
// Create the primitive itself
- t.add_primitive(std::const_pointer_cast<primitive>(get_node().get_primitive()));
- outer_dep_ids.push_back(get_node().id());
+ GPU_DEBUG_TRACE_DETAIL << " add main primitive " << prim_of_fused_node->id << "\n";
+ for (auto& in : prim_of_fused_node->dependencies()) {
+ GPU_DEBUG_TRACE_DETAIL << " input" << in.idx << " - " << in.pid << "\n";
+ }
+ t.add_primitive(prim_of_fused_node);
+ added_prim_ids.push_back(get_node().id());
+ GPU_DEBUG_TRACE_DETAIL << " Add fused primitives of " << get_node().id() << "\n";
// Add primitives for fused-ops
for (auto& fd : _impl_params->fused_desc) {
- auto prim = std::const_pointer_cast<primitive>(fd.desc);
+ auto prim = fd.desc->clone();
for (size_t i = 0; i < prim->input.size(); i++) {
auto& in = prim->input[i];
// If dependency name is not found in current topology, we need to remap it
// It may happen if dependency primitive has been fused into some previous primitive, e.g:
// prim1 -> eltwise1 -> eltwise2
+ // /
// prim2 -------/
- // fused_prim1=prim1 + eltwise1
- // fused_prim2=prim2 + eltwise2
- // from the names perspective fused graph will looka as follows:
- // prim1 -> prim2
+ //
+ // fused_prim1 = prim1 + eltwise1
+ // fused_prim2 = prim2 + eltwise2
+ //
+ // from the names perspective fused graph will look as follows:
+ // prim1 -> prim2
// And when we construct unfused subgraph for prim2, we take original eltwise2 primitive which expects eltwise1 primitive as input
// which doesn't exist anymore in the graph
// Thus we update dependency name used dependencies idx stored in fused descriptor.
- if (std::find_if(outer_dep_ids.begin(), outer_dep_ids.end(), [&](const primitive_id& pid) {
- return pid == in.pid;
- }) == outer_dep_ids.end()) {
+ GPU_DEBUG_TRACE_DETAIL << " input of prim " << prim->id << " - idx" << i << " " << in << std::endl;
+ if (!has_primitive_id(added_prim_ids, in.pid)) {
if (fd.has_outer_dep()) {
size_t dep_id = fd.outer_dep_start_idx;
auto outer_dep_id = get_node().get_dependency(dep_id).id();
@@ -2619,20 +2654,17 @@ cldnn::network::ptr primitive_inst::get_unfused_subgraph() {
in = get_node().id();
}
}
+
+ if (has_primitive_id(outer_dep_ids_with_port, in.pid))
+ in = tag_port_number(in.pid, in.idx);
+
+ GPU_DEBUG_TRACE_DETAIL << " input of prim " << prim->id << " - idx" << i << " " << in << "\n";
}
+ GPU_DEBUG_TRACE_DETAIL << " add fused_primitive " << prim->id << "\n";
t.add_primitive(prim);
- outer_dep_ids.push_back(prim->id);
- }
- // Samely, need to update dependency of the current fused nodes' input primitive ids with those in the current program
- for (size_t i = 0; i < prim_of_fused_node->input.size(); ++i) {
- auto& in = prim_of_fused_node->input[i];
- if (std::find_if(outer_dep_ids.begin(), outer_dep_ids.end(),
- [&](const primitive_id& pid) {
- return pid == in.pid;
- }) == outer_dep_ids.end()) {
- in = get_node().get_dependency(i).id();
- }
+ added_prim_ids.push_back(prim->id);
}
+
ExecutionConfig subgraph_config{
ov::intel_gpu::allow_static_input_reorder(true),
ov::intel_gpu::allow_new_shape_infer(true),
@@ -2652,6 +2684,11 @@ cldnn::network::ptr primitive_inst::get_unfused_subgraph() {
return _unfused_subgraph;
}
+#define LOG_AND_RETURN_FALSE(node) do { \
+ GPU_DEBUG_TRACE_DETAIL << (node)->id() << " : it is an invalid fusion" << std::endl; \
+ return false; \
+} while (0)
+
bool primitive_inst::is_valid_fusion() const {
if (!is_dynamic())
return true;
@@ -2669,12 +2706,12 @@ bool primitive_inst::is_valid_fusion() const {
if (fd.is_type<swiglu>()) {
OPENVINO_ASSERT(get_node().is_type<fully_connected>() && get_node().get_preferred_impl_type() == impl_types::ocl);
if (!get_node().get_selected_impl())
- return false;
+ LOG_AND_RETURN_FALSE(_node);
// TODO : support ref kernel too
if (get_node().get_selected_impl()->get_kernel_name().find("fully_connected_gpu_bf_tiled") != std::string::npos)
return true;
else
- return false;
+ LOG_AND_RETURN_FALSE(_node);
}
OPENVINO_THROW("[GPU] Unsupported fused operation in dynamic shape: type=", fd.desc->type_string(), ", id=", fd.desc->id);
@@ -2687,18 +2724,18 @@ bool primitive_inst::is_valid_fusion() const {
if (get_node().is_type<fully_connected>() || get_node().is_type<gemm>() || get_node().is_type<convolution>()) {
if (_impl_params->input_layouts[0].count() == 0 ||
_impl_params->input_layouts[1].count() == 0) {
- return false;
+ LOG_AND_RETURN_FALSE(_node);
}
}
if (get_node().is_type<fully_connected>() && get_node().get_preferred_impl_type() == impl_types::ocl) {
// TODO: Only fc_bf_tiled_kernel & ref kernel are verified for fused eltwise. To support more fc kernels for eltwise fusion
if (!get_node().get_selected_impl())
- return false;
+ LOG_AND_RETURN_FALSE(_node);
if (!data_type_traits::is_i8_u8(get_node().get_input_layout(0).data_type) &&
(get_node().get_selected_impl()->get_kernel_name().find("fully_connected_gpu_bf_tiled") == std::string::npos) &&
(get_node().get_selected_impl()->get_kernel_name().find("fully_connected_gpu_bfyx_ref") == std::string::npos)) {
- return false;
+ LOG_AND_RETURN_FALSE(_node);
}
}
@@ -2737,14 +2774,14 @@ bool primitive_inst::is_valid_fusion() const {
false);
if (gemm_dims[0] != data_dims[0] && gemm_dims[1] != 1)
- return false;
+ LOG_AND_RETURN_FALSE(_node);
}
#endif
// We check that broadcasting of extra input is possible and it doesn't change output shape. If it output shape is changed, then
// some dimension of dep_pshape is greater than out_pshape
if (!can_broadcast || merged_shape != out_pshape)
- return false;
+ LOG_AND_RETURN_FALSE(_node);
}
return true;
diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/fully_connected/fully_connected_kernel_bf_tiled.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/fully_connected/fully_connected_kernel_bf_tiled.cpp
index cf0b2d166cc..93bc49f3798 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/kernels/fully_connected/fully_connected_kernel_bf_tiled.cpp
+++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/fully_connected/fully_connected_kernel_bf_tiled.cpp
@@ -166,7 +166,11 @@ bool should_dynamic_quantize(const fully_connected_params& params) {
<< ", W:" << kernel_selector::toString(params.weights.GetDType())
<< "), Format(W:" << kernel_selector::toString(params.weights.GetLayout())
<< ") B: " << params.inputs[0].Batch().v << ", F: " << params.inputs[0].Feature().v
- << ", Y: " << params.inputs[0].Y().v << std ::endl;
+ << ", Y: " << params.inputs[0].Y().v
+ << ", X: " << params.inputs[0].X().v
+ << ", input_b: " << input_b
+ << ", input_f: " << input_f
+ << std ::endl;
return true;
}
diff --git a/src/plugins/intel_gpu/tests/unit/fusions/fully_connected_fusion_test.cpp b/src/plugins/intel_gpu/tests/unit/fusions/fully_connected_fusion_test.cpp
index 9506e9222ed..895ef796bbb 100644
--- a/src/plugins/intel_gpu/tests/unit/fusions/fully_connected_fusion_test.cpp
+++ b/src/plugins/intel_gpu/tests/unit/fusions/fully_connected_fusion_test.cpp
@@ -205,7 +205,8 @@ public:
#define CASE_FC_FP16_INT4_COMP_1 { 1, 128 }, { 1, 128 }, { 128, 128 }, data_types::f16, format::bfyx, data_types::u4, format::oiyx, data_types::f16, format::bfyx
-#define CASE_FC_FP16_INT4_COMP_2 { 2, 128 }, { 2, 128 }, { 128, 128 }, data_types::f16, format::bfyx, data_types::u4, format::oiyx, data_types::f16, format::bfyx
+#define CASE_FC_FP16_INT4_COMP_3D_1 { 1, 1, 128 }, { 1, 1, 128 }, { 128, 128 }, data_types::f16, format::bfyx, data_types::i4, format::oiyx, data_types::f16, format::bfyx
+#define CASE_FC_FP16_INT4_COMP_3D_2 { 1, 64, 128}, { 1, 64, 128}, { 128, 128 }, data_types::f16, format::bfyx, data_types::i4, format::oiyx, data_types::f16, format::bfyx
#define CASE_FC_FP16_INT8_COMP_1 { 1, 128 }, { 1, 128 }, { 128, 128 }, data_types::f16, format::bfyx, data_types::u8, format::oiyx, data_types::f16, format::bfyx
#define CASE_FC_FP16_3D_INT8_COMP_1 { 2, 32, 4 }, { 2, 32, 16 }, { 16, 4 }, data_types::f16, format::bfyx, data_types::u8, format::oiyx, data_types::f16, format::bfyx
@@ -797,42 +798,71 @@ INSTANTIATE_TEST_SUITE_P(fusings_gpu, fc_compressed_int8_bias_dynamic_onednn, ::
class fc_compressed_int8_bias_prod_unfused_dynamic_onednn : public FullyConnectedFusingTestOneDNN {};
TEST_P(fc_compressed_int8_bias_prod_unfused_dynamic_onednn, basic) {
+ // Unfusion will happen because of this mul_data_shape
auto p = GetParam();
auto test_input_layout = get_input_layout(p);
+ auto feature_len = test_input_layout.get_partial_shape()[-1].get_length(); // This is per-token quantization. feature_len == group_size
auto dynamic_input_layout = layout{ov::PartialShape::dynamic(test_input_layout.get_partial_shape().rank()), test_input_layout.data_type, test_input_layout.format};
- auto data_layout = layout{ ov::PartialShape{p.out_shape[0], 1}, p.default_type, p.default_format };
+
+ ov::PartialShape mul_data_partial_shape;
+ mul_data_partial_shape.emplace_back(2);
+ for (size_t i = 0; i < p.in_shape.size() - 1; i++)
+ mul_data_partial_shape.emplace_back(1);
+
+ auto mul_data_shape = layout{ mul_data_partial_shape, p.default_type, p.default_format };
auto supports_immad = engine.get_device_info().supports_immad;
- auto dcomp_zp_name = supports_immad ? "dcomp_zp" : "";
+ auto dcomp_zp_name = supports_immad ? "" : "";
auto fc_prim = fully_connected("fc_prim", input_info("input"), "weights", "", "scale", dcomp_zp_name, data_types::f16, get_output_dim_size(p), get_input_weights_rank(p));
- fc_prim.decompression_zero_point_scalar = 8.0f;
+ auto fc_prim_dyn_quan = fully_connected("fc_prim", input_info("dyn_quan", 0), "weights", "", "scale", dcomp_zp_name, input_info("dyn_quan", 1), input_info(""), data_types::f16, get_output_dim_size(p), get_input_weights_rank(p));
- // onednn FC supports scalar ZP for int4 compressed weight.
auto dcomp_zp_layout = layout{ {1, 1}, data_types::u8, format::bfyx };
- create_topologies(
+ auto weights = data("weights", get_mem(get_weights_layout(p)));
+ auto scale = data("scale", get_mem(get_scale_layout(p, feature_len)));
+ auto dcomp_zp = data("dcomp_zp", get_mem(dcomp_zp_layout, 8.0f));
+ auto mul_data = data("mul_data", get_mem(mul_data_shape, -2, 2));
+
+ dynamic_quantize::Attributes dq_config;
+ dq_config.quantization_dt = data_types::i8;
+ dq_config.scale_dt = data_types::f16;
+ dq_config.group_sizes = std::vector<uint64_t>(p.in_shape.size() - 1, 1);
+ dq_config.group_sizes.push_back(feature_len);
+
+ topology_non_fused.add(
input_layout("input", dynamic_input_layout),
- data("weights", get_mem(get_weights_layout(p))),
- data("scale", get_mem(get_scale_layout(p, 128))),
- data("bias", get_mem(get_bias_layout(p))),
- data("dcomp_zp", get_mem(dcomp_zp_layout, 8.0f)),
- data("mul_data", get_mem(data_layout, -10, 10)),
+ weights,
+ scale,
+ dcomp_zp,
+ mul_data,
fc_prim,
- eltwise("bias_add", { input_info("fc_prim"), input_info("bias") }, eltwise_mode::sum),
- eltwise("mul", { input_info("bias_add"), input_info("mul_data") }, eltwise_mode::prod),
+ eltwise("mul", { input_info("fc_prim"), input_info("mul_data") }, eltwise_mode::prod),
+ reorder("reorder_bfyx", input_info("mul"), p.default_format, data_types::f32)
+ );
+
+ topology_fused.add(
+ input_layout("input", dynamic_input_layout),
+ weights,
+ scale,
+ dcomp_zp,
+ mul_data,
+ dynamic_quantize("dyn_quan", input_info("input"), dq_config, 3),
+ fc_prim_dyn_quan,
+ eltwise("mul", { input_info("fc_prim"), input_info("mul_data") }, eltwise_mode::prod),
reorder("reorder_bfyx", input_info("mul"), p.default_format, data_types::f32)
);
bool is_dynamic = true;
+ cfg_fused.set_property(ov::intel_gpu::allow_new_shape_infer(is_dynamic));
cfg_not_fused.set_property(ov::intel_gpu::allow_new_shape_infer(is_dynamic));
- cfg_not_fused.set_property(ov::hint::dynamic_quantization_group_size(0));
tolerance = 1.0f;
execute(p, false, is_dynamic);
}
INSTANTIATE_TEST_SUITE_P(fusings_gpu, fc_compressed_int8_bias_prod_unfused_dynamic_onednn, ::testing::ValuesIn(std::vector<fully_connected_test_params>{
- fully_connected_test_params{ CASE_FC_FP16_INT4_COMP_2, 2, 4 },
+ fully_connected_test_params{ CASE_FC_FP16_INT4_COMP_3D_1, 2, 3 },
+ fully_connected_test_params{ CASE_FC_FP16_INT4_COMP_3D_2, 3, 3 },
}));
class fc_fp16_eltwise_sub : public FullyConnectedFusingTestOneDNN {