Reject package-controlled optimized model paths (#33059)
This pull request introduces a validation to prevent setting the
`optimized_model_path` session option in model package session options
for variants, and adds a corresponding unit test to ensure this behavior
is enforced.
Validation improvements:
*
[`onnxruntime/core/session/model_package/model_package_context.cc`](diffhunk://#diff-6a79338f7a8572899c7eededd031dee511908b441d67e6b1b9936a21382df2ccR489-R495):
Added a check in the `ModelPackageContext` constructor to throw an error
if `kOrtSessionOptionsConfigOptimizedModelFilePath` is set in variant
session options, preventing unsupported configuration.
Testing:
*
[`onnxruntime/test/autoep/test_model_package.cc`](diffhunk://#diff-bfa4122a85543ae2d80bf4cf6d9f85248e51c2276a5956af32f9bd8c8983d23aR883-R909):
Added a new test, `VariantSessionOption_RejectsOptimizedModelPath`, to
verify that setting `kOrtSessionOptionsConfigOptimizedModelFilePath` in
variant session options results in an error and that the error message
contains the expected option name.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>