Add options to onnxruntime_perf_runner to externalize weights - #26441
Merged
Dmitri Smirnov (yuslepukhin) merged 1 commit intoNov 4, 2025
Conversation
Dmitri Smirnov (yuslepukhin)
requested review from
Chi Lo (chilo-ms) and
Copilot
October 29, 2025 22:41
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for saving optimized ONNX models with external initializers in the performance testing tool. The changes enable users to specify external data file parameters when saving optimized models, including weight minimum size thresholds and pre-packed constant initializers.
- Added command-line flags for external initializer configuration (
--opt_data,--opt_weight_min_size,--opt_save_prepacks) - Extended
RunConfigstruct to store external initializer file parameters - Implemented logic to pass these configurations to the ONNX Runtime session options
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| onnxruntime/test/perftest/test_configuration.h | Added new fields to RunConfig for external initializer configuration |
| onnxruntime/test/perftest/command_args_parser.cc | Added command-line flag parsing for external initializer options |
| onnxruntime/test/perftest/ort_test_session.cc | Implemented session option configuration for external initializers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Chi Lo (chilo-ms)
approved these changes
Oct 30, 2025
Dmitri Smirnov (yuslepukhin)
deleted the
yuslepukhin/add_external_weights
branch
November 4, 2025 20:32
Rohanjames1997
pushed a commit
to Rohanjames1997/onnxruntime
that referenced
this pull request
Dec 4, 2025
…oft#26441) ### Description Allow the user to externalize weights, set the minimum weight threshold, and save pre-packs when saving an optimized model. ### Motivation and Context Add several options that make the tool more useful. Some models fail to optimize because they are too large. Externalizing initializers makes this possible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allow the user to externalize weights, set the minimum weight threshold, and save pre-packs when saving an optimized model.
Motivation and Context
Add several options that make the tool more useful.
Some models fail to optimize because they are too large. Externalizing initializers makes this possible.