Introduced properties for model, ort_inference_session, ort_input_nodes, and ort_output_nodes
Lazy loading of ONNX model and inference session
Caching of input and output nodes
Performance improvements:
Reduced redundant file existence checks and model loading
Optimized session creation and management
Type hinting and imports:
Added List and final to imports from typing module
Changes to helper classes:
Updated AzureDownloadableModel, SiblingModel, and TruncatedModel to work with the refactored OnnxModelInfo
Adjusted model path handling to use self._model instead of self.model in some cases
Minor updates to other files:
Modified get_sample_inputs_for_onnx_model function to accept input nodes directly
Updated various model construction and input generation methods to work with the refactored classes
Command-line argument change:
Updated help text for -t / --test-filter argument to indicate it uses regex filtering
These changes appear to focus on improving performance, reducing redundant operations, and making the code more maintainable through better encapsulation and lazy loading of resources.
This includes everything from https://github.com/nod-ai/SHARK-TestSuite/pull/357 and the following changes to make the runs fast and make the code (hopefully) easier to maintain:
OnnxModelInfo class refactoring:
__slots__
to optimize memory usagemodel
,ort_inference_session
,ort_input_nodes
, andort_output_nodes
Performance improvements:
Type hinting and imports:
List
andfinal
to imports from typing moduleChanges to helper classes:
AzureDownloadableModel
,SiblingModel
, andTruncatedModel
to work with the refactoredOnnxModelInfo
self._model
instead ofself.model
in some casesMinor updates to other files:
get_sample_inputs_for_onnx_model
function to accept input nodes directlyCommand-line argument change:
-t
/--test-filter
argument to indicate it uses regex filteringThese changes appear to focus on improving performance, reducing redundant operations, and making the code more maintainable through better encapsulation and lazy loading of resources.