Skip to content

Commit

Permalink
Add option to force generic algorithms on x86 (microsoft#22917)
Browse files Browse the repository at this point in the history
Option is named onnxruntime_FORCE_GENERIC_ALGORITHMS

Follow up to microsoft#22125.

### Description
This change adds compile-time option to disable optimized algorithms and
use generic algorithms (exclude AVX* and SSE etc in GEMM) on x86. This
new option is intended only for testing these algorithms, not for
production use.

Following build command on linux x86_64 builds onnxruntime with new
option enabled:
`./build.sh --parallel --cmake_extra_defines
onnxruntime_FORCE_GENERIC_ALGORITHMS=1`

### Motivation and Context
This change allows testing generic algorithms. This may be needed for
platforms which don't have optimized implementations available, like in
microsoft#22125.
  • Loading branch information
AlekseiNikiforovIBM authored and ankitm3k committed Dec 11, 2024
1 parent 72bd746 commit 5b13a5c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions onnxruntime/core/mlas/lib/qgemm.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ MlasGemmQuantGetDispatch(
{
const MLAS_GEMM_QUANT_DISPATCH* GemmQuantDispatch = &MlasGemmQuantDispatchDefault;

#if !defined(FORCE_GENERIC_ALGORITHMS)
#if defined(MLAS_TARGET_AMD64_IX86)
if (AIsSigned) {
GemmQuantDispatch =
Expand Down

0 comments on commit 5b13a5c

Please sign in to comment.