Skip to content

Add --bf16-emulation flag to C++ aiecc binary#2958

Merged
erwei-xilinx merged 3 commits intoXilinx:mainfrom
erwei-xilinx:erwei/add-bf16-emulation-to-cpp-aiecc
Mar 13, 2026
Merged

Add --bf16-emulation flag to C++ aiecc binary#2958
erwei-xilinx merged 3 commits intoXilinx:mainfrom
erwei-xilinx:erwei/add-bf16-emulation-to-cpp-aiecc

Conversation

@erwei-xilinx
Copy link
Collaborator

Summary

Add the --bf16-emulation CLI flag to the C++ aiecc binary. This flag was originally added to the Python aiecc in #2942 but was lost when the Python aiecc was replaced by the C++ binary in #2925.

Changes

  • Add --bf16-emulation cl::opt<bool> to aiecc.cpp
  • Thread it into the convert-vector-to-aievec pipeline string as bf16-emulation=true

Context

The mlir-air aircc compiler passes --bf16-emulation to aiecc when users request f32-to-bf16 emulation. Without this flag in the C++ binary, f32 vector ops (mulf, maximumf, fma, select) fail to lower because the bf16 emulation pass is never activated.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 12, 2026 05:10
The --bf16-emulation flag was added to the Python aiecc in Xilinx#2942 but
was lost when the Python aiecc was replaced by the C++ binary in
Xilinx#2925. This adds it to the C++ binary and threads it through to the
convert-vector-to-aievec pipeline string.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds back the --bf16-emulation CLI flag to the C++ aiecc driver and wires it into the Vector→AIEVec lowering pipeline so aircc can enable bf16-based emulation of f32 vector arithmetic (restoring behavior that previously existed in the Python aiecc).

Changes:

  • Introduce a new --bf16-emulation cl::opt<bool> in tools/aiecc/aiecc.cpp.
  • Conditionally append bf16-emulation=true to the convert-vector-to-aievec{...} pipeline string for AIE2+ targets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@erwei-xilinx erwei-xilinx enabled auto-merge March 12, 2026 06:15
@erwei-xilinx erwei-xilinx added this pull request to the merge queue Mar 12, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 12, 2026
@erwei-xilinx erwei-xilinx added this pull request to the merge queue Mar 12, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 12, 2026
@erwei-xilinx erwei-xilinx added this pull request to the merge queue Mar 13, 2026
Merged via the queue into Xilinx:main with commit ff23880 Mar 13, 2026
60 checks passed
@erwei-xilinx erwei-xilinx deleted the erwei/add-bf16-emulation-to-cpp-aiecc branch March 13, 2026 01:43
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.

2 participants