microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.79k stars 2.94k forks source link

Add option to force generic algorithms on x86 #22917

Closed AlekseiNikiforovIBM closed 3 days ago

AlekseiNikiforovIBM commented 3 days ago

Option is named onnxruntime_FORCE_GENERIC_ALGORITHMS

Follow up to https://github.com/microsoft/onnxruntime/pull/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 https://github.com/microsoft/onnxruntime/pull/22125.

AlekseiNikiforovIBM commented 3 days ago

@tianleiwu @amarin16 , could you please take a look at this PR?

I've implemented this change as was requested in https://github.com/microsoft/onnxruntime/pull/22125. Sorry, I didn't finish this change before it was merged.

This change allows to build onnxruntime for testing those generic algorithms. If in addition to that https://github.com/microsoft/onnxruntime/pull/22125 is reverted, test failures mentioned in https://github.com/microsoft/onnxruntime/pull/22125 could be reproduced.

tianleiwu commented 3 days ago

/azp run Windows ARM64 QNN CI Pipeline,Windows x64 QNN CI Pipeline,Windows CPU CI Pipeline,Windows GPU CUDA CI Pipeline,Windows GPU DML CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows GPU TensorRT CI Pipeline,ONNX Runtime Web CI Pipeline,Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline

tianleiwu commented 3 days ago

/azp run Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,Linux OpenVINO CI Pipeline,Linux QNN CI Pipeline,MacOS CI Pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,onnxruntime-binary-size-checks-ci-pipeline,Big Models,Linux Android Emulator QNN CI Pipeline

tianleiwu commented 3 days ago

/azp run Android CI Pipeline,iOS CI Pipeline,ONNX Runtime React Native CI Pipeline,CoreML CI Pipeline,Linux DNNL CI Pipeline,Linux MIGraphX CI Pipeline,Linux ROCm CI Pipeline

azure-pipelines[bot] commented 3 days ago
Azure Pipelines successfully started running 7 pipeline(s).
azure-pipelines[bot] commented 3 days ago
Azure Pipelines successfully started running 8 pipeline(s).
azure-pipelines[bot] commented 3 days ago
Azure Pipelines successfully started running 10 pipeline(s).