Add BFloat16 support analysis and plan for CPU and CUDA execution providers#28769
Draft
Copilot wants to merge 3 commits into
Draft
Add BFloat16 support analysis and plan for CPU and CUDA execution providers#28769Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Copilot
AI
changed the title
[WIP] Analyze bfloat16 support status in CPU and CUDA EP
Add BFloat16 support analysis and plan for CPU and CUDA execution providers
Jun 3, 2026
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.
Description
Adds
docs/BFloat16_Support.md, a documentation-only analysis of currentbfloat16(BF16) kernel coverage across the CPU and CUDA execution providers, with a phased plan to close the gaps. Coverage numbers are derived from the registered kernels indocs/OperatorKernels.md(the auto-generated kernel-registry snapshot) and cross-checked against the kernel sources.tensor(bfloat16)registration, split byai.onnxvscom.microsoft:ai.onnxops (45/197), but all data-movement (Cast, Reshape, Gather, Concat, Slice, Transpose, control-flow). No BF16 compute — no MatMul/Add/Softmax/LayerNorm/activations. Element-wise sources even carry explicit// Supposed to add BFloat16 but we are not supporting nowmarkers.ai.onnxops (83/149) plus 25 contrib fusions (Attention, MHA, GQA, SkipLayerNorm, MatMulNBits, MoE…); runs most BF16 transformer/CNN graphs end-to-end, with a long tail of gaps (BatchNorm, pooling, several activations/reductions, some fusions).BFloat16type andCastsupport, FP32-accumulation requirement, MLASSBGemmbeing an ARM64 FP32 fast-math path rather than a native BF16 datatype kernel, andOpTesterBF16 readiness.Motivation and Context
Most modern models (LLMs, diffusion, transformers) are published in BF16. Today, running them on the CPU EP forces FP32 fallback with inserted
Castnodes (doubling memory footprint), and the CUDA EP still has scattered gaps. This document establishes a measurable, prioritized roadmap toward comprehensive BF16 support.