diff --git a/onnxruntime/core/mlas/inc/mlas.h b/onnxruntime/core/mlas/inc/mlas.h index ab79559716..fd6b3df934 100644 --- a/onnxruntime/core/mlas/inc/mlas.h +++ b/onnxruntime/core/mlas/inc/mlas.h @@ -77,7 +77,6 @@ Abstract: #define MLAS_SUPPORTS_GEMM_DOUBLE #endif -#if !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) #if (!defined(_MSC_VER)) || (_MSC_VER >= 1930) #if defined(MLAS_TARGET_ARM64) || defined(MLAS_TARGET_ARM64EC) #if !defined(__APPLE__) @@ -91,7 +90,6 @@ Abstract: #endif // #endif // ARM64 #endif // Visual Studio 16 or earlier does not support fp16 intrinsic -#endif // !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) // // Basic Linear Algebra Subprograms (BLAS) types. diff --git a/onnxruntime/core/mlas/lib/halfgemm_kernel_neon.cpp b/onnxruntime/core/mlas/lib/halfgemm_kernel_neon.cpp index 35576b3e67..d7f5a90b00 100644 --- a/onnxruntime/core/mlas/lib/halfgemm_kernel_neon.cpp +++ b/onnxruntime/core/mlas/lib/halfgemm_kernel_neon.cpp @@ -14,8 +14,6 @@ Abstract: --*/ -#if !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) - #include "mlasi.h" #include "halfgemm.h" @@ -187,5 +185,3 @@ const MLAS_HALFGEMM_DISPATCH MlasHalfGemmDispatchNeon = { MLAS_HALF_GEMM_KERNEL_NEON::KernelMaxM, 32 // kernel may read beyond buffer end by 32 bytes }; - -#endif // !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) \ No newline at end of file diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 2951362f65..ad6f47b917 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -626,6 +626,13 @@ def parse_arguments(): ) # Please note in our CMakeLists.txt this is already default on. But in this file we reverse it to default OFF. parser.add_argument("--disable_rtti", action="store_true", help="Disable RTTI (reduces binary size)") + parser.add_argument( + "--disable_types", + nargs="+", + default=[], + choices=["float8", "optional", "sparsetensor"], + help="Disable selected data types (reduces binary size)", + ) parser.add_argument( "--disable_exceptions", action="store_true", @@ -889,8 +896,11 @@ def generate_build_tree( if not use_dev_mode(args): cmake_args += ["--compile-no-warning-as-error"] + types_to_disable = args.disable_types # enable/disable float 8 types - disable_float8_types = args.use_rocm or args.android or args.minimal_build + disable_float8_types = args.use_rocm or args.android or ("float8" in types_to_disable) + disable_optional_type = "optional" in types_to_disable + disable_sparse_tensors = "sparsetensor" in types_to_disable cmake_args += [ "-Donnxruntime_RUN_ONNX_TESTS=" + ("ON" if args.enable_onnx_tests else "OFF"), @@ -990,6 +1000,8 @@ def generate_build_tree( "-Donnxruntime_USE_CANN=" + ("ON" if args.use_cann else "OFF"), "-Donnxruntime_USE_TRITON_KERNEL=" + ("ON" if args.use_triton_kernel else "OFF"), "-Donnxruntime_DISABLE_FLOAT8_TYPES=" + ("ON" if disable_float8_types else "OFF"), + "-Donnxruntime_DISABLE_SPARSE_TENSORS=" + ("ON" if disable_sparse_tensors else "OFF"), + "-Donnxruntime_DISABLE_OPTIONAL_TYPE=" + ("ON" if disable_optional_type else "OFF"), ] # By default on Windows we currently support only cross compiling for ARM/ARM64 diff --git a/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml index eccc8d7a42..3eb74f3069 100644 --- a/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-cpu-minimal-build-ci-pipeline.yml @@ -247,11 +247,9 @@ jobs: --parallel \ --skip_tests \ --disable_ml_ops \ + --disable_types sparsetensor float8 optional \ --include_ops_by_config /home/onnxruntimedev/.test_data/include_no_operators.config \ - --cmake_extra_defines onnxruntime_DISABLE_SPARSE_TENSORS=ON \ - onnxruntime_DISABLE_FLOAT8_TYPES=ON \ - onnxruntime_DISABLE_OPTIONAL_TYPE=ON \ - onnxruntime_BUILD_UNIT_TESTS=OFF + --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 @@ -278,10 +276,9 @@ jobs: --disable_ml_ops \ --skip_tests \ --enable_reduced_operator_type_support \ + --disable_types sparsetensor optional float8 \ --include_ops_by_config /home/onnxruntimedev/.test_data/include_no_operators.config \ - --cmake_extra_defines onnxruntime_DISABLE_SPARSE_TENSORS=ON \ - onnxruntime_DISABLE_OPTIONAL_TYPE=ON \ - onnxruntime_BUILD_UNIT_TESTS=OFF + --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 @@ -308,10 +305,9 @@ jobs: --disable_ml_ops \ --skip_tests \ --enable_reduced_operator_type_support \ + --disable_types sparsetensor optional float8 \ --include_ops_by_config /home/onnxruntimedev/.test_data/include_no_operators.config \ - --cmake_extra_defines onnxruntime_DISABLE_SPARSE_TENSORS=ON \ - onnxruntime_DISABLE_OPTIONAL_TYPE=ON \ - onnxruntime_BUILD_UNIT_TESTS=OFF + --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2