Skip to content

Add options to onnxruntime_perf_runner to externalize weights - #26441

Merged
Dmitri Smirnov (yuslepukhin) merged 1 commit into
mainfrom
yuslepukhin/add_external_weights
Nov 4, 2025
Merged

Add options to onnxruntime_perf_runner to externalize weights#26441
Dmitri Smirnov (yuslepukhin) merged 1 commit into
mainfrom
yuslepukhin/add_external_weights

Conversation

@yuslepukhin

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RunConfig struct 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.

Comment thread onnxruntime/test/perftest/command_args_parser.cc
@yuslepukhin
Dmitri Smirnov (yuslepukhin) merged commit 4de6893 into main Nov 4, 2025
169 of 205 checks passed
@yuslepukhin
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants