Skip to content
2 changes: 2 additions & 0 deletions src/plugins/intel_gpu/src/graph/impls/ocl/activation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ attach_activation_impl::attach_activation_impl() {
auto types = {
data_types::f32,
data_types::f16,
data_types::i16,
data_types::u16,
data_types::i8,
data_types::u8,
data_types::i32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static bool IsTypeUsedIn(Datatype type, const base_params& params) {

Datatype KernelBase::GetUnitType(const base_params& params) const {
Datatype types_prioritized[] =
{Datatype::INT8, Datatype::F16, Datatype::INT32, Datatype::INT64, Datatype::UINT8, Datatype::UINT32};
{Datatype::INT8, Datatype::INT16, Datatype::UINT16, Datatype::F16, Datatype::INT32, Datatype::INT64, Datatype::UINT8, Datatype::UINT32};
Comment thread
peterchen-intel marked this conversation as resolved.

Comment thread
peterchen-intel marked this conversation as resolved.
for (Datatype type : types_prioritized)
if (IsTypeUsedIn(type, params))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ ParamsKey ActivationKernelRef::GetSupportedKey() const {
k.EnableInputDataType(Datatype::INT8);
k.EnableInputDataType(Datatype::UINT8);
k.EnableInputDataType(Datatype::INT32);
k.EnableInputDataType(Datatype::INT16);
k.EnableInputDataType(Datatype::UINT16);
k.EnableInputDataType(Datatype::F16);
k.EnableInputDataType(Datatype::F32);
k.EnableOutputDataType(Datatype::INT8);
k.EnableOutputDataType(Datatype::INT32);
k.EnableOutputDataType(Datatype::UINT8);
k.EnableOutputDataType(Datatype::INT16);
k.EnableOutputDataType(Datatype::UINT16);
k.EnableOutputDataType(Datatype::F16);
k.EnableOutputDataType(Datatype::F32);
k.EnableDifferentTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,45 @@ INSTANTIATE_TEST_SUITE_P(DISABLED_fusings_gpu, activation_eltwise_activation, ::
activation_test_params{ CASE_ACTIVATION_3D_F32_4, 2, 4, "activation_ref" }, // FIXME - accuracy bug
activation_test_params{ CASE_ACTIVATION_3D_F32_5, 2, 4, "activation_ref" }, // FIXME - accuracy bug
}));

TEST_F(ActivationFusingTest, reorder_activation_i16) {
// This tests CVS-188408: Ensure int16 Reorder -> Abs activation compiles cleanly
// Prior to fix, this would fail with CL_BUILD_PROGRAM_FAILURE due to "fabs" macro ambiguity.
auto& engine = get_test_engine();
ov::PartialShape input_shape = { 1, 4, 1, 1 };
layout in_layout{ input_shape, data_types::f32, format::bfyx };

topology topology(
input_layout("input", in_layout),
reorder("reorder", input_info("input"), format::bfyx, data_types::i16),
activation("abs", input_info("reorder"), activation_func::abs),
reorder("reorder_out", input_info("abs"), format::bfyx, 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);

bool abs_fused = false;
for (const auto& pi : network.get_primitives_info()) {
for (const auto& fused_id : pi.c_fused_ids) {
if (fused_id == "abs") {
abs_fused = true;
break;
}
}
if (abs_fused)
break;
}
EXPECT_TRUE(abs_fused) << "Expected 'abs' to be fused when optimize_data(true)";
Comment on lines +360 to +371

auto input_mem = engine.allocate_memory(in_layout);
set_values(input_mem, { -5.0f, 10.0f, -15.0f, 20.0f });
network.set_input_data("input", input_mem);
auto outputs = network.execute();
auto out_mem = outputs.at("reorder_out").get_memory();
cldnn::mem_lock<float> out_ptr(out_mem, get_test_stream());
std::vector<float> expected_output = { 5.0f, 10.0f, 15.0f, 20.0f };
for (size_t i = 0; i < expected_output.size(); ++i) { EXPECT_EQ(out_ptr[i], expected_output[i]); }
}
Loading