Skip to content

Fix FP16 Add->Ceil rounding in CPU#3

Open
yuxu42 wants to merge 1 commit into
masterfrom
fix/fp16-add-ceil-rounding
Open

Fix FP16 Add->Ceil rounding in CPU#3
yuxu42 wants to merge 1 commit into
masterfrom
fix/fp16-add-ceil-rounding

Conversation

@yuxu42
Copy link
Copy Markdown
Owner

@yuxu42 yuxu42 commented Feb 24, 2026

Summary of issue:

FP16 Add→Ceil on CPU produced +1 errors when fused, because intermediate rounding to FP16 was skipped. Summary of fix:

Insert an explicit low‑precision convert between Add and Ceil when low‑precision inputs are involved, preserving FP16/BF16 rounding semantics in src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/insert_convert_before_ceil.cpp and register it in src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp. Guard low‑precision Add→Ceil chains from snippets fusion in src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.cpp. Added FP16 regression coverage in src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/common/add_ceil_fp16.cpp. Local commit:

Fix FP16 Add->Ceil rounding in CPU (548182ee7d)
Test:

PYTHONPATH=... LD_LIBRARY_PATH=... python bug_3.py

Details:

  • item1
  • ...

Tickets:

  • CVS-178759

Summary of issue:

FP16 Add→Ceil on CPU produced +1 errors when fused, because intermediate rounding to FP16 was skipped.
Summary of fix:

Insert an explicit low‑precision convert between Add and Ceil when low‑precision inputs are involved, preserving FP16/BF16 rounding semantics in src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/insert_convert_before_ceil.cpp and register it in src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp.
Guard low‑precision Add→Ceil chains from snippets fusion in src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.cpp.
Added FP16 regression coverage in src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/common/add_ceil_fp16.cpp.
Local commit:

Fix FP16 Add->Ceil rounding in CPU (548182ee7d)
Test:

PYTHONPATH=... LD_LIBRARY_PATH=... python bug_3.py
@yuxu42 yuxu42 marked this pull request as ready for review February 24, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant