Skip to content

Commit fd9d777

Browse files
committed
Only LLMs scalar constant nodes need to be checked for saturation to further optimize model compile time
1 parent 9ebe7f5 commit fd9d777

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/plugins/intel_cpu/src/nodes/input.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,9 @@ void Input::cloneBlobIfRequired() {
402402
if (!size)
403403
return;
404404

405+
// Only LLMs scalar constant nodes with bf16 inferencePrecision need to be checked for saturation
405406
const bool do_bf16_saturation_check =
406-
(context->getConfig().inferencePrecision == ov::element::bf16) ? true : false;
407+
(context->getConfig().inferencePrecision == ov::element::bf16 && size == 1) ? true : false;
407408

408409
#if defined(OPENVINO_ARCH_X86_64)
409410
auto fn = jit_has_subnormals_function();

src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/bf16_convert_saturation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class BF16ConvertSaturation : public testing::WithParamInterface<selectParams>,
5858
in_data.resolution = 1;
5959
auto thenTensor = ov::test::utils::create_and_fill_tensor(precision, ov::Shape{1}, in_data);
6060

61-
in_data.start_from = 3.40282e+38;
61+
in_data.start_from = 1;
6262
in_data.range = 10;
6363
in_data.resolution = 2;
6464
auto elseTensor = ov::test::utils::create_and_fill_tensor(precision, ov::Shape{2, 1, 32, 32}, in_data);

0 commit comments

Comments
 (0)