-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[VitisAI] bugfix model_clone optimization #25707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
| *p->mutable_value() = std::string("<") + graph_ptr; | ||
| } else { | ||
| // Under threshold: get the data from ORT_MEM_ADDR and add it to cloned graph | ||
| std::unique_ptr<ONNX_NAMESPACE::TensorProto> tensor_proto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| } else { | ||
| *cloned_tensor = *original_tensor; | ||
| // ORT 1.22 or ealier intializer handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| *p->mutable_key() = "location"; | ||
| *p->mutable_value() = std::string("<") + graph_ptr; | ||
| // ORT 1.23 intializer handling | ||
| if (size >= external_data_threshold) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| *p->mutable_key() = "location"; | ||
| *p->mutable_value() = std::string("<") + graph_ptr; | ||
| } else { | ||
| // Under threshold: get the data from ORT_MEM_ADDR and add it to cloned graph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not rely on threshold. Some big initializers may not be converted. Use utils to test if the data is external.
We generally do not want YOU to make the decision of what is expected to be an external data in memory.
Use utilities to test and convert.
You can also get a corresponding OrtValue from the graph.
yuslepukhin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
Description
It is related to #25629
Motivation and Context
With #25320 #23979, all initialized tensor protos are associated with OrtValue, VitisiAI EP need to adapt to this change.