onnxruntime
onnxruntime copied to clipboard
Same Model Hash Code Issue from different models
Describe the issue
If given models have the same architecture and identical input/output tensor names for each node, they will generate the same model hash code. Even if the model structure is the same, different weights and shapes should result in different models and thus develop different hash codes.
The hash code is only dependent on the names. https://github.com/microsoft/onnxruntime/blob/d616025884da05368c38270338b1ab3698e0ecb6/onnxruntime/core/framework/model_metadef_id_generator.cc#L52
To reproduce
Two models with the same architecture but different weights generate the same model hash code.
Urgency
No response
Platform
Linux
OS Version
Ubuntu 22.04
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
v1.10
ONNX Runtime API
C++
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response