Skip to content

[MLAS] Fix MLAS AVX2 build failure on toolchains without AVX-VNNI assembler support - #28767

Merged
hariharans29 merged 11 commits into
mainfrom
copilot/fix-avx2-mlas-build-issues
Jul 27, 2026
Merged

[MLAS] Fix MLAS AVX2 build failure on toolchains without AVX-VNNI assembler support#28767
hariharans29 merged 11 commits into
mainfrom
copilot/fix-avx2-mlas-build-issues

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

On toolchains where the assembler lacks AVX-VNNI support (e.g., RHEL 9.x with GCC 11 + binutils < 2.36), MLAS AVX2 builds fail with inlining failed ... target specific option mismatch and no such instruction: vpdpbusd.

CMake (cmake/onnxruntime_mlas.cmake)

  • Replace the flawed compiler-version gate (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "11", which incorrectly includes GCC 11.x since "11.3.1" > "11.0.0") with a check_cxx_source_compiles probe that tests actual -mavxvnni support end-to-end (compiler + assembler). -mavxvnni is only added when the probe succeeds.

Header files (sqnbitgemm_kernel_avx2_int8_blklen{16,32,64}.h, sqnbitgemm_m1_sym_kernel_avx2_int8_blklen32.h)

  • Replace #if !defined(__GNUC__) || (__GNUC__ > 10) with #if !defined(__GNUC__) || defined(__AVXVNNI__).
    __AVXVNNI__ is defined by GCC and Clang only when -mavxvnni is active, making this a reliable feature check rather than a version heuristic. Non-GCC compilers (MSVC) are unaffected since __GNUC__ remains undefined for them.

Motivation and Context

RHEL 9.x ships GCC 11 with binutils that predate AVX-VNNI assembler support. The version-based heuristics in cmake and the C++ guards both incorrectly enabled the AVX-VNNI code path for GCC 11, causing build failures. Red Hat currently carries these as downstream patches; this upstreams a robust fix.

Copilot AI changed the title [WIP] Fix AVX2 MLAS build to handle AVX-VNNI correctly Fix MLAS AVX2 build failure on toolchains without AVX-VNNI assembler support Jun 3, 2026
Copilot AI requested a review from hariharans29 June 3, 2026 18:31
xadupre
xadupre previously approved these changes Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes MLAS’s AVX-VNNI usage detection robust on toolchains where the assembler cannot assemble AVX-VNNI instructions (e.g., GCC 11 paired with older binutils), preventing AVX2 build failures caused by incorrectly enabling AVX-VNNI paths.

Changes:

  • Replace a compiler-version heuristic in cmake/onnxruntime_mlas.cmake with an end-to-end compile probe to decide whether to add -mavxvnni.
  • Update several AVX2 SQNBitGEMM headers to gate AVX-VNNI code on __AVXVNNI__ instead of __GNUC__ version checks.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmake/onnxruntime_mlas.cmake Uses a compile test to detect usable -mavxvnni and conditionally applies AVX-VNNI compile flags.
onnxruntime/core/mlas/lib/sqnbitgemm_m1_sym_kernel_avx2_int8_blklen32.h Switches AVX-VNNI preprocessor gating to __AVXVNNI__.
onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen64.h Switches AVX-VNNI preprocessor gating to __AVXVNNI__.
onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen32.h Switches AVX-VNNI preprocessor gating to __AVXVNNI__.
onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2_int8_blklen16.h Switches AVX-VNNI preprocessor gating to __AVXVNNI__.

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

Comment thread cmake/onnxruntime_mlas.cmake
@mustjab

mustjab commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This PR appears to address the compiler/assembler capability failure, but we have confirmed a related runtime issue that may remain when the AVX-VNNI probe succeeds.

We build sqnbitgemm_kernel_avx2.cpp with Clang using:

-mavx2 -mfma -mf16c -mavxvnni

@hariharans29

Copy link
Copy Markdown
Member

@copilot - Please resolve the conflict and address this comment - #28767 (comment)

@hariharans29
hariharans29 marked this pull request as ready for review July 22, 2026 18:03
…-build-issues

# Conflicts:
#	cmake/onnxruntime_mlas.cmake

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot - Please resolve the conflict and address this comment - #28767 (comment)

Conflict resolved in the latest merge commit (f42c934). The conflict was between our properly-indented endif() and main's newly-added ffp-contract=off property block — both are now preserved correctly. The previously addressed probe-flag feedback (using -mavx2 -mfma -mf16c -mavxvnni) is also retained.

@mustjab

mustjab commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The latest capability-probe update fixes the compiler/assembler failure, but it
does not appear to address the related runtime failure we reproduced.

When the probe succeeds, -mavxvnni is still applied to the complete
mlas_platform_srcs_avx2 source set. sqnbitgemm_kernel_avx2.cpp contains both
MlasSQNBitGemmDispatchAvx2 and MlasSQNBitGemmDispatchAvx2vnni, so Clang may
emit AVX-VNNI instructions into code reachable through the nominal AVX2
dispatch.

We reproduced this deterministically:

  • Intel i9-12900K: AVX2=1, AVX_VNNI=1 — passes.
  • AMD EPYC 7452: AVX2=1, AVX_VNNI=0 — EXCEPTION_ILLEGAL_INSTRUCTION.
  • AMD EPYC 7763: AVX2=1, AVX_VNNI=0 — same worker class.

Changing the preprocessor guards to defined(__AVXVNNI__) does not prevent this
when the translation unit is globally compiled with -mavxvnni, because that
macro is then defined and VNNI code generation is enabled for the whole unit.

As a validated downstream mitigation, we set
MlasSQNBitGemmDispatchAvx2.SQ8BitGemmKernel_BlkSum_CompInt8 to nullptr.
This routes 8-bit MatMulNBits to the existing FP32 fallback on non-VNNI CPUs,
while MlasSQNBitGemmDispatchAvx2vnni retains the optimized kernel. All affected
tests then passed on AMD EPYC with AVX_VNNI=0.

A durable upstream fix likely requires separate AVX2/AVX-VNNI translation units
or function-level target attributes, plus a runtime test on an AVX2-only CPU.

@hariharans29

Copy link
Copy Markdown
Member

The latest capability-probe update fixes the compiler/assembler failure, but it does not appear to address the related runtime failure we reproduced.

When the probe succeeds, -mavxvnni is still applied to the complete mlas_platform_srcs_avx2 source set. sqnbitgemm_kernel_avx2.cpp contains both MlasSQNBitGemmDispatchAvx2 and MlasSQNBitGemmDispatchAvx2vnni, so Clang may emit AVX-VNNI instructions into code reachable through the nominal AVX2 dispatch.

We reproduced this deterministically:

  • Intel i9-12900K: AVX2=1, AVX_VNNI=1 — passes.
  • AMD EPYC 7452: AVX2=1, AVX_VNNI=0 — EXCEPTION_ILLEGAL_INSTRUCTION.
  • AMD EPYC 7763: AVX2=1, AVX_VNNI=0 — same worker class.

Changing the preprocessor guards to defined(__AVXVNNI__) does not prevent this when the translation unit is globally compiled with -mavxvnni, because that macro is then defined and VNNI code generation is enabled for the whole unit.

As a validated downstream mitigation, we set MlasSQNBitGemmDispatchAvx2.SQ8BitGemmKernel_BlkSum_CompInt8 to nullptr. This routes 8-bit MatMulNBits to the existing FP32 fallback on non-VNNI CPUs, while MlasSQNBitGemmDispatchAvx2vnni retains the optimized kernel. All affected tests then passed on AMD EPYC with AVX_VNNI=0.

A durable upstream fix likely requires separate AVX2/AVX-VNNI translation units or function-level target attributes, plus a runtime test on an AVX2-only CPU.

@copilot - Please address this

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread cmake/onnxruntime_mlas.cmake Outdated
@hariharans29

Copy link
Copy Markdown
Member

@copilot - Please rebase with tip of main branch

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot - Please rebase with tip of main branch

Merged the latest main (tip: 1b1e1db - "Allow zero input for EpContext node") into the branch. The new main commits (858442c, cff0335, 1b1e1db) don't touch any MLAS files, so the merge was clean with no conflicts. Build validated: onnxruntime_mlas target compiles successfully.

@hariharans29

Copy link
Copy Markdown
Member

@copilot - There are some breaking builds:

This is one error that I spotted:

FAILED: [code=1] libonnxruntime.so.1.29.0
: && /opt/rh/gcc-toolset-14/root/usr/bin/c++ -fPIC -DNDEBUG -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -O3 -pipe -fstack-clash-protection -fcf-protection -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--strip-all "-Wl,-rpath=$ORIGIN" -Wl,--version-script=/onnxruntime_src/build/Release/Release/onnxruntime.lds -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,--dependency-file=CMakeFiles/onnxruntime.dir/link.d -shared -Wl,-soname,libonnxruntime.so.1 -o libonnxruntime.so.1.29.0 CMakeFiles/onnxruntime.dir/generated_source.c.o libonnxruntime_session.a libonnxruntime_optimizer.a libonnxruntime_providers.a libonnxruntime_lora.a libonnxruntime_framework.a libonnxruntime_graph.a libonnxruntime_util.a libonnxruntime_mlas.a libonnxruntime_common.a libonnxruntime_flatbuffers.a model_package/libmodel_package.a vcpkg_installed/x64-linux/lib/libonnx.a vcpkg_installed/x64-linux/lib/libonnx_proto.a vcpkg_installed/x64-linux/lib/libprotobuf-lite.a vcpkg_installed/x64-linux/lib/libre2.a vcpkg_installed/x64-linux/lib/libflatbuffers.a vcpkg_installed/x64-linux/lib/libabsl_synchronization.a vcpkg_installed/x64-linux/lib/libabsl_tracing_internal.a vcpkg_installed/x64-linux/lib/libabsl_time.a vcpkg_installed/x64-linux/lib/libabsl_time_zone.a vcpkg_installed/x64-linux/lib/libabsl_civil_time.a vcpkg_installed/x64-linux/lib/libabsl_symbolize.a vcpkg_installed/x64-linux/lib/libabsl_demangle_internal.a vcpkg_installed/x64-linux/lib/libabsl_demangle_rust.a vcpkg_installed/x64-linux/lib/libabsl_stacktrace.a vcpkg_installed/x64-linux/lib/libabsl_debugging_internal.a vcpkg_installed/x64-linux/lib/libabsl_malloc_internal.a vcpkg_installed/x64-linux/lib/libabsl_kernel_timeout_internal.a vcpkg_installed/x64-linux/lib/libabsl_graphcycles_internal.a vcpkg_installed/x64-linux/lib/libabsl_str_format_internal.a vcpkg_installed/x64-linux/lib/libabsl_raw_hash_set.a vcpkg_installed/x64-linux/lib/libabsl_hashtablez_sampler.a vcpkg_installed/x64-linux/lib/libabsl_cord.a vcpkg_installed/x64-linux/lib/libabsl_crc_cord_state.a vcpkg_installed/x64-linux/lib/libabsl_crc32c.a vcpkg_installed/x64-linux/lib/libabsl_cordz_info.a vcpkg_installed/x64-linux/lib/libabsl_cordz_functions.a vcpkg_installed/x64-linux/lib/libabsl_cord_internal.a vcpkg_installed/x64-linux/lib/libabsl_hash.a vcpkg_installed/x64-linux/lib/libabsl_strings.a vcpkg_installed/x64-linux/lib/libabsl_strings_internal.a vcpkg_installed/x64-linux/lib/libabsl_string_view.a vcpkg_installed/x64-linux/lib/libabsl_int128.a vcpkg_installed/x64-linux/lib/libabsl_city.a vcpkg_installed/x64-linux/lib/libabsl_throw_delegate.a vcpkg_installed/x64-linux/lib/libabsl_base.a vcpkg_installed/x64-linux/lib/libabsl_spinlock_wait.a vcpkg_installed/x64-linux/lib/libabsl_raw_logging_internal.a vcpkg_installed/x64-linux/lib/libabsl_log_severity.a -ldl -lrt vcpkg_installed/x64-linux/lib/libcpuinfo.a vcpkg_installed/x64-linux/lib/libabsl_flags_internal.a vcpkg_installed/x64-linux/lib/libabsl_flags_marshalling.a vcpkg_installed/x64-linux/lib/libabsl_flags_reflection.a vcpkg_installed/x64-linux/lib/libabsl_raw_hash_set.a vcpkg_installed/x64-linux/lib/libabsl_hashtablez_sampler.a vcpkg_installed/x64-linux/lib/libabsl_cord.a vcpkg_installed/x64-linux/lib/libabsl_cordz_info.a vcpkg_installed/x64-linux/lib/libabsl_cordz_handle.a vcpkg_installed/x64-linux/lib/libabsl_cordz_functions.a vcpkg_installed/x64-linux/lib/libabsl_exponential_biased.a vcpkg_installed/x64-linux/lib/libabsl_cord_internal.a vcpkg_installed/x64-linux/lib/libabsl_crc_cord_state.a vcpkg_installed/x64-linux/lib/libabsl_crc32c.a vcpkg_installed/x64-linux/lib/libabsl_crc_internal.a vcpkg_installed/x64-linux/lib/libabsl_crc_cpu_detect.a vcpkg_installed/x64-linux/lib/libabsl_flags_config.a vcpkg_installed/x64-linux/lib/libabsl_flags_program_name.a vcpkg_installed/x64-linux/lib/libabsl_flags_private_handle_accessor.a vcpkg_installed/x64-linux/lib/libabsl_flags_commandlineflag.a vcpkg_installed/x64-linux/lib/libabsl_flags_commandlineflag_internal.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_conditions.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_check_op.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_message.a vcpkg_installed/x64-linux/lib/libabsl_examine_stack.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_format.a vcpkg_installed/x64-linux/lib/libabsl_str_format_internal.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_structured_proto.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_log_sink_set.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_globals.a vcpkg_installed/x64-linux/lib/libabsl_log_globals.a vcpkg_installed/x64-linux/lib/libabsl_hash.a vcpkg_installed/x64-linux/lib/libabsl_city.a vcpkg_installed/x64-linux/lib/libabsl_vlog_config_internal.a vcpkg_installed/x64-linux/lib/libabsl_synchronization.a vcpkg_installed/x64-linux/lib/libabsl_tracing_internal.a vcpkg_installed/x64-linux/lib/libabsl_symbolize.a vcpkg_installed/x64-linux/lib/libabsl_demangle_internal.a vcpkg_installed/x64-linux/lib/libabsl_demangle_rust.a vcpkg_installed/x64-linux/lib/libabsl_decode_rust_punycode.a vcpkg_installed/x64-linux/lib/libabsl_utf8_for_code_point.a vcpkg_installed/x64-linux/lib/libabsl_stacktrace.a vcpkg_installed/x64-linux/lib/libabsl_debugging_internal.a vcpkg_installed/x64-linux/lib/libabsl_kernel_timeout_internal.a vcpkg_installed/x64-linux/lib/libabsl_graphcycles_internal.a vcpkg_installed/x64-linux/lib/libabsl_malloc_internal.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_fnmatch.a vcpkg_installed/x64-linux/lib/libabsl_log_sink.a vcpkg_installed/x64-linux/lib/libabsl_log_entry.a vcpkg_installed/x64-linux/lib/libabsl_time.a vcpkg_installed/x64-linux/lib/libabsl_time_zone.a vcpkg_installed/x64-linux/lib/libabsl_civil_time.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_proto.a vcpkg_installed/x64-linux/lib/libabsl_strerror.a vcpkg_installed/x64-linux/lib/libabsl_log_internal_nullguard.a vcpkg_installed/x64-linux/lib/libabsl_strings.a vcpkg_installed/x64-linux/lib/libabsl_strings_internal.a vcpkg_installed/x64-linux/lib/libabsl_string_view.a vcpkg_installed/x64-linux/lib/libabsl_int128.a vcpkg_installed/x64-linux/lib/libabsl_throw_delegate.a vcpkg_installed/x64-linux/lib/libabsl_base.a vcpkg_installed/x64-linux/lib/libabsl_spinlock_wait.a -lrt vcpkg_installed/x64-linux/lib/libabsl_raw_logging_internal.a vcpkg_installed/x64-linux/lib/libabsl_log_severity.a vcpkg_installed/x64-linux/lib/libabsl_leak_check.a -lpthread -pthread && :
/opt/rh/gcc-toolset-14/root/usr/libexec/gcc/x86_64-redhat-linux/14/ld: libonnxruntime_mlas.a(sqnbitgemm_kernel_avx2vnni.cpp.o): in function SQ4BitGemmM1Kernel_BlkLen32_CompInt8_Impl2(std::byte const*, float const*, std::byte const*, float const*, std::byte const*, float*, unsigned long, unsigned long, float const*)': sqnbitgemm_kernel_avx2vnni.cpp:(.text._Z42SQ4BitGemmM1Kernel_BlkLen32_CompInt8_Impl2PKSt4bytePKfS1_S3_S1_PfmmS3_+0x0): multiple definition of SQ4BitGemmM1Kernel_BlkLen32_CompInt8_Impl2(std::byte const*, float const*, std::byte const*, float const*, std::byte const*, float*, unsigned long, unsigned long, float const*)'; libonnxruntime_mlas.a(sqnbitgemm_kernel_avx2.cpp.o):sqnbitgemm_kernel_avx2.cpp:(.text.Z42SQ4BitGemmM1Kernel_BlkLen32_CompInt8_Impl2PKSt4bytePKfS1_S3_S1_PfmmS3+0x0): first defined here
collect2: error: ld returned 1 exit status

Can you fix these issues ?

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot - There are some breaking builds:

This is one error that I spotted:
...

Fixed in the latest commit.

The root cause: SQ4BitGemmM1Kernel_BlkLen32_CompInt8_Impl2 was defined in sqnbitgemm_m1_sym_kernel_avx2_int8_blklen32.h as a plain non-inline, non-static function. Both sqnbitgemm_kernel_avx2.cpp and the new sqnbitgemm_kernel_avx2vnni.cpp include that header, so the linker saw two definitions.

Fix: added inline to the function definition in the header (line 504). All other functions in the affected headers are either templates, static, or MLAS_FORCEINLINE (which expands to __attribute__((always_inline)) inline), so they are fine across multiple TUs. Validated with a minimal two-TU compile + link test that reproduces the original failure without the fix and passes with it.

@tianleiwu tianleiwu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the clean ISA-separation refactor — moving the AVX-VNNI kernels and dispatch table into a dedicated -mavxvnni TU while keeping the pure-AVX2 kernels in a flagless TU, and replacing the __GNUC__ > 10 heuristic with a check_cxx_source_compiles probe (__AVXVNNI__ guards), is the right structure. The two earlier threads (probe needing -mavx2; status-message -mf16c mismatch) look addressed.

One High-Priority build concern remains (inline on cmake/onnxruntime_mlas.cmake):

Undefined-reference link failure on the exact toolchains this PR targets. When the probe MLAS_COMPILER_SUPPORTS_AVXVNNI is false (RHEL 9 / GCC 11 / binutils < 2.36), the else() branch empties mlas_platform_srcs_avx2vnni, so sqnbitgemm_kernel_avx2vnni.cpp is dropped. That TU is now the only definition of MlasSQNBitGemmDispatchAvx2vnni (the prior definition in sqnbitgemm_kernel_avx2.cpp was removed here). But platform.cpp still takes its address unconditionally (this->QNBitGemmDispatch = &MlasSQNBitGemmDispatchAvx2vnni;), mlasi.h declares it extern const unconditionally, and test_sqnbitgemm_2bit_gemm.cpp references it in 6 places — none guarded by the probe result. Since the address is taken in reachable code, the linker needs the definition regardless of runtime CPUID, so the build fails with undefined reference to MlasSQNBitGemmDispatchAvx2vnni on precisely the old-binutils toolchains this PR is meant to unblock. CI won't catch it because CI toolchains support AVX-VNNI and compile the TU.

Suggested fix: always compile sqnbitgemm_kernel_avx2vnni.cpp; make only the -mavxvnni flag conditional. The __AVXVNNI__ header guards already compile the VNNI paths out when -mavxvnni is absent, so the dispatch table falls back to the correct AVX2 kernels and the symbol is always defined. Details inline.

Comment thread cmake/onnxruntime_mlas.cmake Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread onnxruntime/core/mlas/lib/sqnbitgemm_kernel_avx2vnni.cpp Outdated
@blazingphoenix7

Copy link
Copy Markdown
Contributor

Ran this branch (head 2057360) through the build matrix I have, since it is the same failure class as the probe issue in #28236 and it restructures files I have current changes near.

On gcc 15.2 / binutils 2.46 (WSL2): the probe sets MLAS_COMPILER_SUPPORTS_AVXVNNI=1 and the split does what it intends. objdump -d on the resulting objects: sqnbitgemm_kernel_avx2.cpp.o contains zero vpdpbusd, sqnbitgemm_kernel_avx2vnni.cpp.o contains 814, and MlasSQNBitGemmDispatchAvx2vnni is defined in the new TU. So nothing VNNI is stranded in the unflagged TU where it would silently compile down to the maddubs fallback, which was the thing I wanted to rule out. The probe source also compiles standalone under clang 21 with -mavxvnni. The full W2/W4/W8 CompInt8 suites pass natively (13,545 of 13,545) on an AVX2 + AVX-VNNI machine (Arrow Lake) with this branch, so the dispatch actually reaching the VNNI kernels still produces correct numbers on real silicon. Since check_cxx_source_compiles builds and links a real object, the probe also exercises the assembler, which is where the #24025 / #22519 class of failure actually lives, so the gate looks right for the old-binutils case too.

One behavior change worth a deliberate call: the new kernel guard is defined(__AVXVNNI__) || (defined(_MSC_VER) && !defined(__clang__)). clang-cl defines _MSC_VER and __clang__ but not __GNUC__, so the old !defined(__GNUC__) || (__GNUC__ > 10) guard enabled the VNNI blocks for clang-cl and the new one disables them unless something passes -mavxvnni, which the MSVC-side cmake path does not. If clang-cl is not a supported configuration for these kernels that is fine, but it is a silent capability drop rather than a build failure, so it seemed worth stating.

Also a sequencing note: #29886 modifies sqnbitgemm_kernel_avx2.cpp and sqnbitgemm_m1_sym_kernel_avx2_int8_blklen32.h, which this PR rewrites and partially relocates. Whichever lands second needs a careful rebase rather than a mechanical one, since the M=1 kernel routing moved.

@hariharans29
hariharans29 merged commit be94d53 into main Jul 27, 2026
89 of 91 checks passed
@hariharans29
hariharans29 deleted the copilot/fix-avx2-mlas-build-issues branch July 27, 2026 18:34
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.

[Build] AVX2 MLAS build requires AVX-VNNI on all toolchains

8 participants