Add --bf16-emulation flag to C++ aiecc binary#2958
Merged
erwei-xilinx merged 3 commits intoXilinx:mainfrom Mar 13, 2026
Merged
Conversation
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]>
Contributor
There was a problem hiding this comment.
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-emulationcl::opt<bool>intools/aiecc/aiecc.cpp. - Conditionally append
bf16-emulation=trueto theconvert-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the
--bf16-emulationCLI flag to the C++aieccbinary. This flag was originally added to the Pythonaieccin #2942 but was lost when the Python aiecc was replaced by the C++ binary in #2925.Changes
--bf16-emulationcl::opt<bool>toaiecc.cppconvert-vector-to-aievecpipeline string asbf16-emulation=trueContext
The mlir-air
aircccompiler passes--bf16-emulationtoaieccwhen 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