diff --git a/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h b/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h index dcdd8fe88ec38..762e00debf49d 100644 --- a/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h +++ b/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h @@ -13,7 +13,7 @@ * The maximum length of the Config Key is 1024 * * The string format of a SessionOptions Config Value is defined individually for each Config. - * The maximum length of the Config Value is 2048 + * The maximum length of the Config Value is 8192 */ // Key for disable PrePacking, diff --git a/onnxruntime/core/framework/config_options.h b/onnxruntime/core/framework/config_options.h index 1c356d8cfca56..6c0d6741dd92f 100644 --- a/onnxruntime/core/framework/config_options.h +++ b/onnxruntime/core/framework/config_options.h @@ -18,7 +18,7 @@ struct ConfigOptions { // Maximum key/value string lengths specified in // core/session/onnxruntime_session_options_config_keys.h static constexpr size_t kMaxKeyLength = 1024; - static constexpr size_t kMaxValueLength = 4096; + static constexpr size_t kMaxValueLength = 8192; std::unordered_map configurations; diff --git a/onnxruntime/test/shared_lib/test_session_options.cc b/onnxruntime/test/shared_lib/test_session_options.cc index d12a586f662ac..ba58344e1e3e2 100644 --- a/onnxruntime/test/shared_lib/test_session_options.cc +++ b/onnxruntime/test/shared_lib/test_session_options.cc @@ -2,6 +2,7 @@ // Licensed under the MIT License. #include "core/common/common.h" +#include "core/framework/config_options.h" #include "core/graph/constants.h" #include "core/session/onnxruntime_cxx_api.h" #include "core/session/onnxruntime_session_options_config_keys.h" @@ -25,7 +26,7 @@ TEST(CApiTest, session_options_deterministic_compute) { TEST(CApiTest, session_options_oversized_affinity_string) { Ort::SessionOptions options; - std::string long_affinity_str(onnxruntime::kMaxStrLen + 1, '0'); + std::string long_affinity_str(ConfigOptions::kMaxValueLength + 1, '0'); try { options.AddConfigEntry(kOrtSessionOptionsConfigIntraOpThreadAffinities, long_affinity_str.c_str()); ASSERT_TRUE(false) << "Creation of config should have thrown exception";