Repository navigation
Support building ONNX runtime with clang on Windows for Windows ML #29741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adrastogi
wants to merge
25
commits into
main
Choose a base branch
from
adrastogi/clang-windows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+452
−195
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
38f88ab
Enable clang-cl builds of ONNX Runtime on Windows (core shared lib)
Copilot 32c03ae
Make DirectML EP compile with clang-cl on Windows
949f100
Fix clang-cl build of ONNX Runtime test targets on Windows
5d13f56
Patch ONNX 1.22.0 scoped_resource.h for clang-cl compatibility
adrastogi 5c81cd1
Merge remote-tracking branch 'origin/main' into adrastogi/clang-windows
adrastogi 4d6091b
Merge remote-tracking branch 'origin/main' into adrastogi/clang-windows
adrastogi 0b36e55
Reject x86 and ARM64X targets with --use_clang_cl
adrastogi 3466c36
Fix clang-cl MLAS flags for AVX2-VNNI split kernels
adrastogi 4e0ed35
Order override objects first so test targets link with lld-link
adrastogi c00fe2a
Fix clang-cl MLAS flags for the 2-bit packer and AVX2 dequant kernel
adrastogi 5c28986
Order override sources first in the no-exceptions provider bridge test
adrastogi f181107
Reject non-x64 hosts for --use_clang_cl
adrastogi 1101a88
Do not enable AVX512-VNNI for the non-VNNI AVX-512 SQNBitGemm kernel …
adrastogi 8334be6
Merge commit '0e21de25ea~1' into adityar-microsoft-clang-windows-pr-u…
adrastogi 502cd71
Merge remote-tracking branch 'origin/main' into adrastogi/clang-windows
adrastogi 4e2ced2
Merge remote-tracking branch 'origin/main' into adityar-microsoft-cla…
adrastogi 00e8cd6
Merge remote-tracking branch 'origin/main' into adityar-microsoft-cla…
adrastogi d44ba71
Fix clang-cl build after merging main
adrastogi b1bc93c
Link clang-cl builds with MSVC link.exe
adrastogi f8970e6
Share MLAS x86-64 C++ ISA source groups across compilers
adrastogi 6b3e01a
Address clang-cl review feedback
adrastogi 23b0384
Merge remote-tracking branch 'origin/main' into adityar-microsoft-cla…
adrastogi 89dc240
Forward ClangCL toolset for ARM targets; relax OneCore test timeout
adrastogi fee6d85
Add missing standard includes to AbstractOperatorDesc.h
adrastogi 077abe3
Address review feedback on comparison operators, math test and Spectr…
adrastogi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why is this true for integrating clang on windows also? Also why not for <?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Agentic Response]: Good questions. I reproduced both with main's header.
==, and!=is rewritten in terms of==.MLFloat16 == MLFloat16therefore matches the inheritedFloat16Impl::operator==(const Float16Impl&)both normally and reversed, each needing the same derived-to-base conversion. Clang reports this as-Wambiguous-reversed-operator, a warning that becomes an error under warnings-as-errors. cl.exe doesn't diagnose it, and neither does a C++17 build. So this isn't specific to Windows: any clang C++20 build would warn. A comparison operator taking the derived type, the same patternBFloat16already uses, gives an exact match and removes the ambiguity.<: relational operators aren't reversed or rewritten in C++20; only==/!=are, and<=>is synthesized for the others. The inheritedoperator<has a single candidate, so it isn't ambiguous.In 077abe3 I corrected the code comment, which wrongly called this an error, and noted why
<is unaffected.